Skip to content

Commit

Permalink
fix RegionStatsNeedUpdate condition
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <[email protected]>
  • Loading branch information
rleungx committed Apr 28, 2024
1 parent aae410f commit a0e23e5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/statistics/region_collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ func (r *RegionStatistics) RegionStatsNeedUpdate(region *core.RegionInfo) bool {
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 a0e23e5

Please sign in to comment.