Skip to content

Commit

Permalink
pkg: fix RegionStatsNeedUpdate condition (#8133)
Browse files Browse the repository at this point in the history
ref #7897

Signed-off-by: Ryan Leung <[email protected]>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
  • Loading branch information
rleungx and ti-chi-bot[bot] authored Apr 30, 2024
1 parent 6e3cac7 commit 8ee18a4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/statistics/region_collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,14 @@ func (r *RegionStatistics) RegionStatsNeedUpdate(region *core.RegionInfo) bool {
region.IsOversized(int64(r.conf.GetRegionMaxSize()), int64(r.conf.GetRegionMaxKeys())) {
return true
}
// expected to be zero for below type
if r.IsRegionStatsType(regionID, PendingPeer) && len(region.GetPendingPeers()) == 0 {

if r.IsRegionStatsType(regionID, PendingPeer) != (len(region.GetPendingPeers()) != 0) {
return true
}
if r.IsRegionStatsType(regionID, DownPeer) && len(region.GetDownPeers()) == 0 {
if r.IsRegionStatsType(regionID, DownPeer) != (len(region.GetDownPeers()) != 0) {
return true
}
if r.IsRegionStatsType(regionID, LearnerPeer) && len(region.GetLearners()) == 0 {
if r.IsRegionStatsType(regionID, LearnerPeer) != (len(region.GetLearners()) != 0) {
return true
}

Expand Down

0 comments on commit 8ee18a4

Please sign in to comment.