diff --git a/embed/templates/scripts/run_drainer.sh.tpl b/embed/templates/scripts/run_drainer.sh.tpl index 2b5b7fca65..ce8a76bafa 100644 --- a/embed/templates/scripts/run_drainer.sh.tpl +++ b/embed/templates/scripts/run_drainer.sh.tpl @@ -30,4 +30,4 @@ exec bin/drainer \ --data-dir="{{.DataDir}}" \ --log-file="{{.LogDir}}/drainer.log" \ --config=conf/drainer.toml \ - --initial-commit-ts="{{.CommitTs}}" 2>> "{{.LogDir}}/drainer_stderr.log" + --initial-commit-ts={{.CommitTs}} 2>> "{{.LogDir}}/drainer_stderr.log" diff --git a/pkg/cluster/spec/drainer.go b/pkg/cluster/spec/drainer.go index 852ad63fa0..2f374cd696 100644 --- a/pkg/cluster/spec/drainer.go +++ b/pkg/cluster/spec/drainer.go @@ -38,7 +38,7 @@ type DrainerSpec struct { DeployDir string `yaml:"deploy_dir,omitempty"` DataDir string `yaml:"data_dir,omitempty"` LogDir string `yaml:"log_dir,omitempty"` - CommitTS int64 `yaml:"commit_ts,omitempty"` + CommitTS int64 `yaml:"commit_ts" default:"-1" validate:"commit_ts:editable"` Offline bool `yaml:"offline,omitempty"` NumaNode string `yaml:"numa_node,omitempty" validate:"numa_node:editable"` Config map[string]interface{} `yaml:"config,omitempty" validate:"config:ignore"`