File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -879,7 +879,7 @@ type KeyspaceConfig struct {
879879 // WaitRegionSplitTimeout indicates the max duration to wait region split.
880880 WaitRegionSplitTimeout typeutil.Duration `toml:"wait-region-split-timeout" json:"wait-region-split-timeout"`
881881 // DisableRawKVRegionSplit indicates whether to skip raw kv region split.
882- DisableRawKVRegionSplit bool `toml:"disable-raw-kv-region-split" json:"disable-raw-kv-region-split,string "`
882+ DisableRawKVRegionSplit bool `toml:"disable-raw-kv-region-split" json:"disable-raw-kv-region-split"`
883883 // CheckRegionSplitInterval indicates the interval to check whether the region split is complete
884884 CheckRegionSplitInterval typeutil.Duration `toml:"check-region-split-interval" json:"check-region-split-interval"`
885885}
Original file line number Diff line number Diff line change @@ -327,6 +327,25 @@ disable-make-up-replica = false
327327 re .Error (err )
328328}
329329
330+ func TestKeyspaceConfigJSONBoolEncoding (t * testing.T ) {
331+ re := require .New (t )
332+ cfg := NewConfig ()
333+ cfg .Keyspace .DisableRawKVRegionSplit = true
334+ cfg .Keyspace .WaitRegionSplit = true
335+
336+ data , err := json .Marshal (cfg )
337+ re .NoError (err )
338+
339+ var payload map [string ]any
340+ re .NoError (json .Unmarshal (data , & payload ))
341+
342+ keyspaceCfg , ok := payload ["keyspace" ].(map [string ]any )
343+ re .True (ok )
344+ re .IsType (true , keyspaceCfg ["disable-raw-kv-region-split" ])
345+ re .Equal (true , keyspaceCfg ["disable-raw-kv-region-split" ])
346+ re .IsType (true , keyspaceCfg ["wait-region-split" ])
347+ }
348+
330349func TestPDServerConfig (t * testing.T ) {
331350 re := require .New (t )
332351 tests := []struct {
You can’t perform that action at this time.
0 commit comments