Skip to content

Commit

Permalink
Merge branch 'release-7.1' into cherry-pick-8675-to-release-7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot[bot] authored Oct 28, 2024
2 parents c37e443 + 9e0978b commit 49531ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/statistics/region_collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ func (r *RegionStatistics) ClearDefunctRegion(regionID uint64) {
}
}
if oldIndex, ok := r.offlineIndex[regionID]; ok {
delete(r.offlineIndex, regionID)
r.deleteOfflineEntry(oldIndex, regionID)
}
}
Expand Down
4 changes: 4 additions & 0 deletions pkg/statistics/region_collection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ func TestRegionStatistics(t *testing.T) {
stores[3] = store3
regionStats.Observe(region1, stores)
re.Empty(regionStats.stats[OfflinePeer])

regionStats.ClearDefunctRegion(1)
re.Equal(1, len(regionStats.index))
re.Equal(1, len(regionStats.offlineIndex))
}

func TestRegionStatisticsWithPlacementRule(t *testing.T) {
Expand Down

0 comments on commit 49531ee

Please sign in to comment.