diff --git a/server/config/config.go b/server/config/config.go index a6c565ef68a..8353af56c0c 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -577,7 +577,7 @@ func (c *PDServerConfig) adjust(meta *configutil.ConfigMetaData) error { func migrateConfigurationFromFile(meta *configutil.ConfigMetaData) error { oldName, newName := "trace-region-flow", "flow-round-by-digit" - defineOld, _ := meta.IsDefined(oldName), meta.IsDefined(newName) + defineOld := meta.IsDefined(oldName) switch { case defineOld: return errors.Errorf("config item %s and %s(deprecated) are conflict", newName, oldName) diff --git a/server/config/config_test.go b/server/config/config_test.go index cd9447a5824..b035ab22178 100644 --- a/server/config/config_test.go +++ b/server/config/config_test.go @@ -277,7 +277,7 @@ func TestMigrateFlags(t *testing.T) { } cfg, err := load(` [pd-server] -trace-region-flow = false +flow-round-by-digit = 127 [schedule] disable-remove-down-replica = true enable-make-up-replica = false diff --git a/tools/pd-ctl/tests/config/config_test.go b/tools/pd-ctl/tests/config/config_test.go index 39820a6c7b7..22a2d7d7a12 100644 --- a/tools/pd-ctl/tests/config/config_test.go +++ b/tools/pd-ctl/tests/config/config_test.go @@ -150,7 +150,6 @@ func (suite *configTestSuite) checkConfig(cluster *pdTests.TestCluster) { args = []string{"-u", pdAddr, "config", "set", "trace-region-flow", "false"} _, err = tests.ExecuteCommand(cmd, args...) re.NoError(err) - re.False(svr.GetPDServerConfig().TraceRegionFlow) origin := svr.GetPDServerConfig().FlowRoundByDigit args = []string{"-u", pdAddr, "config", "set", "flow-round-by-digit", "10"}