Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: nolouch <[email protected]>
  • Loading branch information
nolouch committed Jun 4, 2021
1 parent de65db1 commit 7ba16de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1077,8 +1077,8 @@ type PDServerConfig struct {
MetricStorage string `toml:"metric-storage" json:"metric-storage"`
// There are some values supported: "auto", "none", or a specific address, default: "auto"
DashboardAddress string `toml:"dashboard-address" json:"dashboard-address"`
// TraceRegionFlow the option to update flow information of regions
// WARN: TraceRegionFlow is deprecate
// TraceRegionFlow the option to update flow information of regions.
// WARN: TraceRegionFlow is deprecated.
TraceRegionFlow bool `toml:"trace-region-flow" json:"trace-region-flow,string,omitempty"`
// FlowRoundByDigit used to discretization processing flow information.
FlowRoundByDigit int `toml:"flow-round-by-digit" json:"flow-round-by-digit"`
Expand Down Expand Up @@ -1118,7 +1118,7 @@ func (c *PDServerConfig) migrateConfigurationFromFile(meta *configMetaData) erro
}
case defineOld && !defineNew:
if !c.TraceRegionFlow {
c.FlowRoundByDigit = math.MaxInt64
c.FlowRoundByDigit = math.MaxInt8
}
}
return nil
Expand All @@ -1127,7 +1127,7 @@ func (c *PDServerConfig) migrateConfigurationFromFile(meta *configMetaData) erro
// MigrateDeprecatedFlags updates new flags according to deprecated flags.
func (c *PDServerConfig) MigrateDeprecatedFlags() {
if !c.TraceRegionFlow {
c.FlowRoundByDigit = math.MaxInt64
c.FlowRoundByDigit = math.MaxInt8
}
// json omity the false. next time will not persist to the kv.
c.TraceRegionFlow = false
Expand Down
4 changes: 2 additions & 2 deletions server/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ func (s *testConfigSuite) TestMigrateFlags(c *C) {
return cfg, err
}
cfg, err := load(`
[server]
[pd-server]
trace-region-flow = false
[schedule]
disable-remove-down-replica = true
Expand All @@ -294,7 +294,7 @@ disable-remove-extra-replica = true
enable-remove-extra-replica = false
`)
c.Assert(err, IsNil)
c.Assert(cfg.PDServerCfg.FlowRoundByDigit, Equals, math.MaxInt64)
c.Assert(cfg.PDServerCfg.FlowRoundByDigit, Equals, math.MaxInt8)
c.Assert(cfg.Schedule.EnableReplaceOfflineReplica, IsTrue)
c.Assert(cfg.Schedule.EnableRemoveDownReplica, IsFalse)
c.Assert(cfg.Schedule.EnableMakeUpReplica, IsFalse)
Expand Down

0 comments on commit 7ba16de

Please sign in to comment.