Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
Signed-off-by: lhy1024 <[email protected]>
  • Loading branch information
lhy1024 committed Dec 5, 2024
1 parent 5538f7a commit 5b7dafe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 504 deletions.
1 change: 1 addition & 0 deletions server/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -2256,6 +2256,7 @@ func (c *RaftCluster) UpdateRegionsLabelLevelStats(regions []*core.RegionInfo) {
for _, region := range regions {
c.labelLevelStats.Observe(region, c.getStoresWithoutLabelLocked(region, core.EngineKey, core.EngineTiFlash), c.opt.GetLocationLabels())
}
c.labelLevelStats.ClearDefunctRegions()
}

func (c *RaftCluster) getRegionStoresLocked(region *core.RegionInfo) []*core.StoreInfo {
Expand Down
15 changes: 3 additions & 12 deletions server/cluster/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1105,12 +1105,8 @@ func TestRegionLabelIsolationLevel(t *testing.T) {
cfg.LocationLabels = []string{"zone"}
opt.SetReplicationConfig(cfg)
re.NoError(err)
<<<<<<< HEAD
cluster := newTestRaftCluster(ctx, mockid.NewIDAllocator(), opt, storage.NewStorageWithMemoryBackend(), core.NewBasicCluster())
=======
cluster := newTestRaftCluster(ctx, mockid.NewIDAllocator(), opt, storage.NewStorageWithMemoryBackend())
cluster.coordinator = schedule.NewCoordinator(ctx, cluster, nil)
>>>>>>> 26123dc75 (checker, statistic: avoid leak in label statistic (#8703))

for i := uint64(1); i <= 4; i++ {
var labels []*metapb.StoreLabel
Expand Down Expand Up @@ -1148,13 +1144,8 @@ func TestRegionLabelIsolationLevel(t *testing.T) {
r1 := core.NewRegionInfo(region, peers[0])
re.NoError(cluster.putRegion(r1))

<<<<<<< HEAD
cluster.UpdateRegionsLabelLevelStats([]*core.RegionInfo{r})
counter := cluster.labelLevelStats.GetLabelCounter()
=======
cluster.UpdateRegionsLabelLevelStats([]*core.RegionInfo{r1})
counter := cluster.labelStats.GetLabelCounter()
>>>>>>> 26123dc75 (checker, statistic: avoid leak in label statistic (#8703))
counter := cluster.labelLevelStats.GetLabelCounter()
re.Equal(0, counter["none"])
re.Equal(1, counter["zone"])

Expand All @@ -1168,7 +1159,7 @@ func TestRegionLabelIsolationLevel(t *testing.T) {
re.NoError(cluster.putRegion(r2))

cluster.UpdateRegionsLabelLevelStats([]*core.RegionInfo{r2})
counter = cluster.labelStats.GetLabelCounter()
counter = cluster.labelLevelStats.GetLabelCounter()
re.Equal(0, counter["none"])
re.Equal(2, counter["zone"])

Expand All @@ -1183,7 +1174,7 @@ func TestRegionLabelIsolationLevel(t *testing.T) {
)
re.NoError(cluster.HandleRegionHeartbeat(overlapRegion))
cluster.UpdateRegionsLabelLevelStats([]*core.RegionInfo{r1, r2})
counter = cluster.labelStats.GetLabelCounter()
counter = cluster.labelLevelStats.GetLabelCounter()
re.Equal(0, counter["none"])
re.Equal(1, counter["zone"])
}
Expand Down
Loading

0 comments on commit 5b7dafe

Please sign in to comment.