Skip to content

Commit

Permalink
config(ticdc): remove useless config variables (#10610)
Browse files Browse the repository at this point in the history
ref #10457
  • Loading branch information
hongyunyan authored Feb 19, 2024
1 parent 61b73e1 commit 3d185a4
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 49 deletions.
9 changes: 3 additions & 6 deletions pkg/cmd/server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,7 @@ func TestParseCfg(t *testing.T) {
ResolvedTsStuckInterval: config.TomlDuration(5 * time.Minute),
},
},
ClusterID: "default",
MaxMemoryPercentage: config.DisableMemoryLimit,
ClusterID: "default",
}, o.serverConfig)
}

Expand Down Expand Up @@ -357,8 +356,7 @@ check-balance-interval = "10s"
ResolvedTsStuckInterval: config.TomlDuration(5 * time.Minute),
},
},
ClusterID: "default",
MaxMemoryPercentage: config.DisableMemoryLimit,
ClusterID: "default",
}, o.serverConfig)
}

Expand Down Expand Up @@ -497,8 +495,7 @@ cert-allowed-cn = ["dd","ee"]
ResolvedTsStuckInterval: config.TomlDuration(5 * time.Minute),
},
},
ClusterID: "default",
MaxMemoryPercentage: config.DisableMemoryLimit,
ClusterID: "default",
}, o.serverConfig)
}

Expand Down
5 changes: 0 additions & 5 deletions pkg/cmd/util/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
9 changes: 1 addition & 8 deletions pkg/config/config_test_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand All @@ -137,7 +132,6 @@ const (
"cert-allowed-cn": null,
"mtls": false
},
"per-table-memory-quota": 0,
"kv-client": {
"enable-multiplexing": true,
"worker-concurrent": 8,
Expand Down Expand Up @@ -193,7 +187,6 @@ const (
}
},
"cluster-id": "default",
"max-memory-percentage": 0,
"gc-tuner-memory-threshold": 0
}`

Expand Down
16 changes: 6 additions & 10 deletions pkg/config/server_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 0 additions & 11 deletions pkg/config/sorter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3d185a4

Please sign in to comment.