From 36845fa1c61413a80546d2c5a0df5e40335d3c11 Mon Sep 17 00:00:00 2001 From: lhy1024 Date: Tue, 15 Oct 2024 14:37:07 +0800 Subject: [PATCH] address comments Signed-off-by: lhy1024 --- pkg/mcs/scheduling/server/cluster.go | 4 ---- pkg/mock/mockcluster/mockcluster.go | 3 --- pkg/schedule/checker/checker_controller.go | 2 -- pkg/schedule/core/cluster_informer.go | 1 - server/cluster/scheduling_controller.go | 4 ---- 5 files changed, 14 deletions(-) diff --git a/pkg/mcs/scheduling/server/cluster.go b/pkg/mcs/scheduling/server/cluster.go index 97de7214acb..5885a9cdb84 100644 --- a/pkg/mcs/scheduling/server/cluster.go +++ b/pkg/mcs/scheduling/server/cluster.go @@ -384,10 +384,6 @@ func (c *Cluster) UpdateRegionsLabelLevelStats(regions []*core.RegionInfo) { for _, region := range regions { c.labelStats.Observe(region, c.getStoresWithoutLabelLocked(region, core.EngineKey, core.EngineTiFlash), c.persistConfig.GetLocationLabels()) } -} - -// ClearDefunctRegionsLabelLevelStats clears the defunct regions' label level stats. -func (c *Cluster) ClearDefunctRegionsLabelLevelStats() { c.labelStats.ClearDefunctRegions() } diff --git a/pkg/mock/mockcluster/mockcluster.go b/pkg/mock/mockcluster/mockcluster.go index fddb031cc59..bbd4fbb6811 100644 --- a/pkg/mock/mockcluster/mockcluster.go +++ b/pkg/mock/mockcluster/mockcluster.go @@ -125,9 +125,6 @@ func (mc *Cluster) AllocID() (uint64, error) { // UpdateRegionsLabelLevelStats updates the label level stats for the regions. func (*Cluster) UpdateRegionsLabelLevelStats(_ []*core.RegionInfo) {} -// ClearDefunctRegionsLabelLevelStats clears the defunct regions' label level stats. -func (*Cluster) ClearDefunctRegionsLabelLevelStats() {} - // LoadRegion puts region info without leader func (mc *Cluster) LoadRegion(regionID uint64, peerStoreIDs ...uint64) { // regions load from etcd will have no leader diff --git a/pkg/schedule/checker/checker_controller.go b/pkg/schedule/checker/checker_controller.go index 592e6fb8982..f9b75e942c9 100644 --- a/pkg/schedule/checker/checker_controller.go +++ b/pkg/schedule/checker/checker_controller.go @@ -141,8 +141,6 @@ func (c *Controller) PatrolRegions() { c.cluster.UpdateRegionsLabelLevelStats(regions) // When the key is nil, it means that the scan is finished. if len(key) == 0 { - // Clear the defunct regions label level statistics. - c.cluster.ClearDefunctRegionsLabelLevelStats() // update the scan limit. c.patrolRegionScanLimit = calculateScanLimit(c.cluster) // update the metrics. diff --git a/pkg/schedule/core/cluster_informer.go b/pkg/schedule/core/cluster_informer.go index 6de3dcd4b60..ce2cf01ed16 100644 --- a/pkg/schedule/core/cluster_informer.go +++ b/pkg/schedule/core/cluster_informer.go @@ -51,7 +51,6 @@ type CheckerCluster interface { GetCheckerConfig() sc.CheckerConfigProvider GetStoreConfig() sc.StoreConfigProvider UpdateRegionsLabelLevelStats(regions []*core.RegionInfo) - ClearDefunctRegionsLabelLevelStats() } // SharedCluster is an aggregate interface that wraps multiple interfaces diff --git a/server/cluster/scheduling_controller.go b/server/cluster/scheduling_controller.go index 6d8d21abd90..8578b3480d8 100644 --- a/server/cluster/scheduling_controller.go +++ b/server/cluster/scheduling_controller.go @@ -236,10 +236,6 @@ func (sc *schedulingController) UpdateRegionsLabelLevelStats(regions []*core.Reg for _, region := range regions { sc.labelStats.Observe(region, sc.getStoresWithoutLabelLocked(region, core.EngineKey, core.EngineTiFlash), sc.opt.GetLocationLabels()) } -} - -// ClearDefunctRegionsLabelLevelStats clears the status of the region label level by types. -func (sc *schedulingController) ClearDefunctRegionsLabelLevelStats() { sc.labelStats.ClearDefunctRegions() }