Skip to content

Commit

Permalink
Use default schema reload config values when config file is empty (vi…
Browse files Browse the repository at this point in the history
…tessio#16393)

Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord authored Jul 16, 2024
1 parent 91182d3 commit 66fbbcf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 0 additions & 4 deletions go/vt/vttablet/tabletserver/tabletenv/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,17 +406,13 @@ func (cfg *TabletConfig) UnmarshalJSON(data []byte) (err error) {
if err != nil {
return err
}
} else {
cfg.SchemaReloadInterval = 0
}

if tmp.SchemaChangeReloadTimeout != "" {
cfg.SchemaChangeReloadTimeout, err = time.ParseDuration(tmp.SchemaChangeReloadTimeout)
if err != nil {
return err
}
} else {
cfg.SchemaChangeReloadTimeout = 0
}

return nil
Expand Down
4 changes: 4 additions & 0 deletions go/vt/vttablet/tabletserver/tabletenv/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ func TestConfigParse(t *testing.T) {
MaxInnoDBTrxHistLen: 1000,
MaxMySQLReplLagSecs: 400,
},
SchemaChangeReloadTimeout: 30 * time.Second,
SchemaReloadInterval: 30 * time.Minute,
}

gotBytes, err := yaml2.Marshal(&cfg)
Expand Down Expand Up @@ -93,6 +95,8 @@ replicationTracker: {}
rowStreamer:
maxInnoDBTrxHistLen: 1000
maxMySQLReplLagSecs: 400
schemaChangeReloadTimeout: 30s
schemaReloadIntervalSeconds: 30m0s
txPool: {}
`
assert.Equal(t, wantBytes, string(gotBytes))
Expand Down

0 comments on commit 66fbbcf

Please sign in to comment.