From 3d185a4ac5ec3d1686398697549ae447632b8488 Mon Sep 17 00:00:00 2001 From: hongyunyan <649330952@qq.com> Date: Mon, 19 Feb 2024 16:16:56 +0800 Subject: [PATCH] config(ticdc): remove useless config variables (#10610) ref pingcap/tiflow#10457 --- pkg/cmd/server/server_test.go | 9 +++------ pkg/cmd/util/helper_test.go | 5 ----- pkg/config/config_test_data.go | 9 +-------- pkg/config/server_config.go | 16 ++++++---------- pkg/config/sorter.go | 11 ----------- .../server_config_compatibility/conf/server.toml | 9 --------- 6 files changed, 10 insertions(+), 49 deletions(-) diff --git a/pkg/cmd/server/server_test.go b/pkg/cmd/server/server_test.go index 0311007c571..21ac645be04 100644 --- a/pkg/cmd/server/server_test.go +++ b/pkg/cmd/server/server_test.go @@ -209,8 +209,7 @@ func TestParseCfg(t *testing.T) { ResolvedTsStuckInterval: config.TomlDuration(5 * time.Minute), }, }, - ClusterID: "default", - MaxMemoryPercentage: config.DisableMemoryLimit, + ClusterID: "default", }, o.serverConfig) } @@ -357,8 +356,7 @@ check-balance-interval = "10s" ResolvedTsStuckInterval: config.TomlDuration(5 * time.Minute), }, }, - ClusterID: "default", - MaxMemoryPercentage: config.DisableMemoryLimit, + ClusterID: "default", }, o.serverConfig) } @@ -497,8 +495,7 @@ cert-allowed-cn = ["dd","ee"] ResolvedTsStuckInterval: config.TomlDuration(5 * time.Minute), }, }, - ClusterID: "default", - MaxMemoryPercentage: config.DisableMemoryLimit, + ClusterID: "default", }, o.serverConfig) } diff --git a/pkg/cmd/util/helper_test.go b/pkg/cmd/util/helper_test.go index eb5f889b511..f4eaaa41006 100644 --- a/pkg/cmd/util/helper_test.go +++ b/pkg/cmd/util/helper_test.go @@ -128,11 +128,6 @@ max-days = 1 max-backups = 1 [sorter] -chunk-size-limit = 10000000 -max-memory-consumption = 2000000 -max-memory-percentage = 3 -num-concurrent-worker = 4 -num-workerpool-goroutine = 5 sort-dir = "/tmp/just_a_test" [security] diff --git a/pkg/config/config_test_data.go b/pkg/config/config_test_data.go index 253c75146e7..5820c23db7e 100644 --- a/pkg/config/config_test_data.go +++ b/pkg/config/config_test_data.go @@ -123,12 +123,7 @@ const ( "processor-flush-interval": 50000000, "sorter": { "sort-dir": "/tmp/sorter", - "cache-size-in-mb": 128, - "max-memory-percentage": 0, - "max-memory-consumption": 0, - "num-workerpool-goroutine": 0, - "num-concurrent-worker": 0, - "chunk-size-limit": 0 + "cache-size-in-mb": 128 }, "security": { "ca-path": "", @@ -137,7 +132,6 @@ const ( "cert-allowed-cn": null, "mtls": false }, - "per-table-memory-quota": 0, "kv-client": { "enable-multiplexing": true, "worker-concurrent": 8, @@ -193,7 +187,6 @@ const ( } }, "cluster-id": "default", - "max-memory-percentage": 0, "gc-tuner-memory-threshold": 0 }` diff --git a/pkg/config/server_config.go b/pkg/config/server_config.go index fafc4565f0e..4bd8a745867 100644 --- a/pkg/config/server_config.go +++ b/pkg/config/server_config.go @@ -164,16 +164,12 @@ type ServerConfig struct { OwnerFlushInterval TomlDuration `toml:"owner-flush-interval" json:"owner-flush-interval"` ProcessorFlushInterval TomlDuration `toml:"processor-flush-interval" json:"processor-flush-interval"` - Sorter *SorterConfig `toml:"sorter" json:"sorter"` - Security *security.Credential `toml:"security" json:"security"` - // Deprecated: we don't use this field anymore. - PerTableMemoryQuota uint64 `toml:"per-table-memory-quota" json:"per-table-memory-quota"` - KVClient *KVClientConfig `toml:"kv-client" json:"kv-client"` - Debug *DebugConfig `toml:"debug" json:"debug"` - ClusterID string `toml:"cluster-id" json:"cluster-id"` - // Deprecated: we don't use this field anymore. - MaxMemoryPercentage int `toml:"max-memory-percentage" json:"max-memory-percentage"` - GcTunerMemoryThreshold uint64 `toml:"gc-tuner-memory-threshold" json:"gc-tuner-memory-threshold"` + Sorter *SorterConfig `toml:"sorter" json:"sorter"` + Security *security.Credential `toml:"security" json:"security"` + KVClient *KVClientConfig `toml:"kv-client" json:"kv-client"` + Debug *DebugConfig `toml:"debug" json:"debug"` + ClusterID string `toml:"cluster-id" json:"cluster-id"` + GcTunerMemoryThreshold uint64 `toml:"gc-tuner-memory-threshold" json:"gc-tuner-memory-threshold"` } // Marshal returns the json marshal format of a ServerConfig diff --git a/pkg/config/sorter.go b/pkg/config/sorter.go index 9b740593000..68526022c6a 100644 --- a/pkg/config/sorter.go +++ b/pkg/config/sorter.go @@ -26,17 +26,6 @@ type SorterConfig struct { // Cache size of sorter in MB. CacheSizeInMB uint64 `toml:"cache-size-in-mb" json:"cache-size-in-mb"` - - // Deprecated: we don't use this field anymore. - MaxMemoryPercentage int `toml:"max-memory-percentage" json:"max-memory-percentage"` - // Deprecated: we don't use this field anymore. - MaxMemoryConsumption uint64 `toml:"max-memory-consumption" json:"max-memory-consumption"` - // Deprecated: we don't use this field anymore. - NumWorkerPoolGoroutine int `toml:"num-workerpool-goroutine" json:"num-workerpool-goroutine"` - // Deprecated: we don't use this field anymore . - NumConcurrentWorker int `toml:"num-concurrent-worker" json:"num-concurrent-worker"` - // Deprecated: we don't use this field anymore. - ChunkSizeLimit uint64 `toml:"chunk-size-limit" json:"chunk-size-limit"` } // ValidateAndAdjust validates and adjusts the sorter configuration diff --git a/tests/integration_tests/server_config_compatibility/conf/server.toml b/tests/integration_tests/server_config_compatibility/conf/server.toml index 11401b52c11..1ef5388db5b 100644 --- a/tests/integration_tests/server_config_compatibility/conf/server.toml +++ b/tests/integration_tests/server_config_compatibility/conf/server.toml @@ -1,15 +1,6 @@ -per-table-memory-quota = 1024 [debug] # Ensure sure removed configarations are not used. # TiCDC should ignore the removed configuration silently. enable-pull-based-sink = true enable-db-sorter = true enable-new-sink = true - -[sorter] -# Ensure that deprecated configurations are not used and will not be validated. -# TiCDC should ignore the deprecated configuration silently. -chunk-size-limit = -1 -max-memory-consumption = -1 -num-concurrent-worker = -1 -num-workerpool-goroutine = -1