Skip to content

Commit

Permalink
core: fix datarace in RegionsInfo
Browse files Browse the repository at this point in the history
Signed-off-by: lhy1024 <[email protected]>
  • Loading branch information
lhy1024 committed Oct 27, 2023
1 parent f9b476d commit 5f2b0ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/core/region.go
Original file line number Diff line number Diff line change
Expand Up @@ -1339,8 +1339,8 @@ func (r *RegionsInfo) GetStoreWriteRate(storeID uint64) (bytesRate, keysRate flo

// GetClusterNotFromStorageRegionsCnt gets the total count of regions that not loaded from storage anymore
func (r *RegionsInfo) GetClusterNotFromStorageRegionsCnt() int {
r.st.RLock()
defer r.st.RUnlock()
r.t.RLock()
defer r.t.RUnlock()
return r.tree.notFromStorageRegionsCnt
}

Expand Down

0 comments on commit 5f2b0ae

Please sign in to comment.