diff --git a/conf/config.toml b/conf/config.toml index a2ccfb9496a..78132f6084a 100644 --- a/conf/config.toml +++ b/conf/config.toml @@ -67,7 +67,7 @@ leader-schedule-limit = 4 region-schedule-limit = 1024 replica-schedule-limit = 1024 merge-schedule-limit = 8 -tolerant-size-ratio = 0 +#tolerant-size-ratio = 5.0 # customized schedulers, the format is as below # if empty, it will use balance-leader, balance-region, hot-region as default @@ -83,6 +83,8 @@ max-replicas = 3 # For example, ["zone", "rack"] means that we should place replicas to # different zones first, then to different racks if we don't have enough zones. location-labels = [] +# Strictly checks if the label of TiKV is matched with location labels. +#strictly-match-label = false [label-property] # Do not assign region leaders to stores that have these tags. diff --git a/server/config.go b/server/config.go index 36cda4aebcc..7a1d405b1c1 100644 --- a/server/config.go +++ b/server/config.go @@ -350,7 +350,7 @@ func (m *configMetaData) CheckUndecoded() error { func (c *Config) Adjust(meta *toml.MetaData) error { configMetaData := newConfigMetadata(meta) if err := configMetaData.CheckUndecoded(); err != nil { - return err + c.WarningMsgs = append(c.WarningMsgs, err.Error()) } if c.Name == "" { @@ -682,7 +682,7 @@ type ReplicationConfig struct { // For example, ["zone", "rack"] means that we should place replicas to // different zones first, then to different racks if we don't have enough zones. LocationLabels typeutil.StringSlice `toml:"location-labels,omitempty" json:"location-labels"` - // StrictlyMatchLabel strictly checks if the label of TiKV is matched with LocaltionLabels. + // StrictlyMatchLabel strictly checks if the label of TiKV is matched with LocationLabels. StrictlyMatchLabel bool `toml:"strictly-match-label,omitempty" json:"strictly-match-label,string"` } diff --git a/server/config_test.go b/server/config_test.go index 5a5e413a509..86dc933e11e 100644 --- a/server/config_test.go +++ b/server/config_test.go @@ -17,6 +17,7 @@ import ( "fmt" "os" "path" + "strings" "time" "github.com/BurntSushi/toml" @@ -131,7 +132,8 @@ type = "random-merge" meta, err = toml.Decode(cfgData, &cfg) c.Assert(err, IsNil) err = cfg.Adjust(&meta) - c.Assert(err, NotNil) + c.Assert(err, IsNil) + c.Assert(strings.Contains(cfg.WarningMsgs[0], "Config contains undefined item"), IsTrue) // Check misspelled schedulers name cfgData = `