Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: fix deletion of region stats metrics after resign (#6367) #6368

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions pkg/statistics/region_collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,22 @@ func (r *RegionStatistics) Collect() {

// Reset resets the metrics of the regions' status.
func (r *RegionStatistics) Reset() {
regionStatusGauge.Reset()
offlineRegionStatusGauge.Reset()
regionMissPeerRegionCounter.Set(0)
regionExtraPeerRegionCounter.Set(0)
regionDownPeerRegionCounter.Set(0)
regionPendingPeerRegionCounter.Set(0)
regionLearnerPeerRegionCounter.Set(0)
regionEmptyRegionCounter.Set(0)
regionOversizedRegionCounter.Set(0)
regionUndersizedRegionCounter.Set(0)
regionWitnesssLeaderRegionCounter.Set(0)

offlineMissPeerRegionCounter.Set(0)
offlineExtraPeerRegionCounter.Set(0)
offlineDownPeerRegionCounter.Set(0)
offlinePendingPeerRegionCounter.Set(0)
offlineLearnerPeerRegionCounter.Set(0)
offlineOfflinePeerRegionCounter.Set(0)
}

// LabelStatistics is the statistics of the level of labels.
Expand Down
2 changes: 1 addition & 1 deletion pkg/tso/keyspace_group_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (suite *keyspaceGroupManagerTestSuite) TestNewKeyspaceGroupManager() {
// TestLoadKeyspaceGroupsAssignment tests the loading of the keyspace group assignment.
func (suite *keyspaceGroupManagerTestSuite) TestLoadKeyspaceGroupsAssignment() {
re := suite.Require()
maxCountInUse := int(mcsutils.MaxKeyspaceGroupCountInUse)
maxCountInUse := 512
// Test loading of empty keyspace group assignment.
suite.runTestLoadKeyspaceGroupsAssignment(re, 0, 0, 100)
// Test loading of single keyspace group assignment.
Expand Down