From 1dc623a8acc9f9cc46ddab868a96a78a102a9004 Mon Sep 17 00:00:00 2001 From: buffer <1045931706@qq.com> Date: Fri, 14 Jul 2023 11:39:44 +0800 Subject: [PATCH] config: remove the configuration of store limit mode (#6444) ref tikv/pd#4399 remove the configuration of store limit mode Signed-off-by: bufferflies <1045931706@qq.com> Co-authored-by: ShuNing Co-authored-by: disksing --- server/cluster/cluster.go | 2 +- server/config/config.go | 13 ------------- server/config/persist_options.go | 5 ----- tests/pdctl/config/config_test.go | 1 - 4 files changed, 1 insertion(+), 20 deletions(-) diff --git a/server/cluster/cluster.go b/server/cluster/cluster.go index bd33d873750..f0c7d10cdf0 100644 --- a/server/cluster/cluster.go +++ b/server/cluster/cluster.go @@ -878,7 +878,7 @@ func (c *RaftCluster) HandleStoreHeartbeat(heartbeat *pdpb.StoreHeartbeatRequest interval := reportInterval.GetEndTimestamp() - reportInterval.GetStartTimestamp() // c.limiter is nil before "start" is called - if c.limiter != nil && c.opt.GetStoreLimitMode() == "auto" { + if c.limiter != nil { c.limiter.Collect(newStore.GetStoreStats()) } diff --git a/server/config/config.go b/server/config/config.go index 31777cefa21..5bda5bdc9f9 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -666,14 +666,6 @@ type ScheduleConfig struct { // Only used to display SchedulersPayload map[string]interface{} `toml:"schedulers-payload" json:"schedulers-payload"` - // StoreLimitMode can be auto or manual, when set to auto, - // PD tries to change the store limit values according to - // the load state of the cluster dynamically. User can - // overwrite the auto-tuned value by pd-ctl, when the value - // is overwritten, the value is fixed until it is deleted. - // Default: manual - StoreLimitMode string `toml:"store-limit-mode" json:"store-limit-mode"` - // Controls the time interval between write hot regions info into leveldb. HotRegionsWriteInterval typeutil.Duration `toml:"hot-regions-write-interval" json:"hot-regions-write-interval"` @@ -746,7 +738,6 @@ const ( defaultHotRegionCacheHitsThreshold = 3 defaultSchedulerMaxWaitingOperator = 5 defaultLeaderSchedulePolicy = "count" - defaultStoreLimitMode = "manual" defaultEnableJointConsensus = true defaultEnableTiKVSplitRegion = true defaultEnableCrossTableMerge = true @@ -806,10 +797,6 @@ func (c *ScheduleConfig) adjust(meta *configutil.ConfigMetaData, reloading bool) if !meta.IsDefined("leader-schedule-policy") { configutil.AdjustString(&c.LeaderSchedulePolicy, defaultLeaderSchedulePolicy) } - if !meta.IsDefined("store-limit-mode") { - configutil.AdjustString(&c.StoreLimitMode, defaultStoreLimitMode) - } - if !meta.IsDefined("store-limit-version") { configutil.AdjustString(&c.StoreLimitVersion, defaultStoreLimitVersion) } diff --git a/server/config/persist_options.go b/server/config/persist_options.go index 8d6d1b6b6bc..d308f6338a2 100644 --- a/server/config/persist_options.go +++ b/server/config/persist_options.go @@ -501,11 +501,6 @@ func (o *PersistOptions) GetAllStoresLimit() map[uint64]StoreLimitConfig { return o.GetScheduleConfig().StoreLimit } -// GetStoreLimitMode returns the limit mode of store. -func (o *PersistOptions) GetStoreLimitMode() string { - return o.GetScheduleConfig().StoreLimitMode -} - // GetStoreLimitVersion returns the limit version of store. func (o *PersistOptions) GetStoreLimitVersion() string { return o.GetScheduleConfig().StoreLimitVersion diff --git a/tests/pdctl/config/config_test.go b/tests/pdctl/config/config_test.go index 9634737e18b..5f446158fb7 100644 --- a/tests/pdctl/config/config_test.go +++ b/tests/pdctl/config/config_test.go @@ -87,7 +87,6 @@ func TestConfig(t *testing.T) { scheduleConfig.EnableMakeUpReplica = false scheduleConfig.EnableRemoveExtraReplica = false scheduleConfig.EnableLocationReplacement = false - scheduleConfig.StoreLimitMode = "" re.Equal(uint64(0), scheduleConfig.MaxMergeRegionKeys) // The result of config show doesn't be 0. scheduleConfig.MaxMergeRegionKeys = scheduleConfig.GetMaxMergeRegionKeys()