Skip to content

Commit

Permalink
Fix the check
Browse files Browse the repository at this point in the history
Signed-off-by: JmPotato <[email protected]>
  • Loading branch information
JmPotato committed May 22, 2024
1 parent 7df701c commit 228db1d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/core/region.go
Original file line number Diff line number Diff line change
Expand Up @@ -1680,10 +1680,11 @@ func (r *RegionsInfo) RandPendingRegions(storeID uint64, ranges []KeyRange) []*R
return r.pendingPeers[storeID].RandomRegions(randomRegionMaxRetry, ranges)
}

func (r *RegionsInfo) randLeaderRegion(storeID uint64, ranges []KeyRange) *RegionInfo {
// This function is used for test only.
func (r *RegionsInfo) randLeaderRegion(storeID uint64, ranges []KeyRange) {
r.st.RLock()
defer r.st.RUnlock()
return r.leaders[storeID].randomRegion(ranges)
_ = r.leaders[storeID].randomRegion(ranges)
}

// RandLeaderRegions randomly gets a store's n leader regions.
Expand Down

0 comments on commit 228db1d

Please sign in to comment.