Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

config: disable heartbeat feature #1467

Merged
merged 6 commits into from
Mar 8, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion dm/config/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,9 @@ func (c *TaskConfig) SubTaskConfigs(sources map[string]DBConfig) ([]*SubTaskConf
cfg.Mode = c.TaskMode
cfg.CaseSensitive = c.CaseSensitive
cfg.MetaSchema = c.MetaSchema
cfg.EnableHeartbeat = c.EnableHeartbeat
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about set it false explicitly.

if c.EnableHeartbeat {
log.L().Warn("DM 2.0 does not support heartbeat feature, will overwrite it to false")
}
cfg.HeartbeatUpdateInterval = c.HeartbeatUpdateInterval
cfg.HeartbeatReportInterval = c.HeartbeatReportInterval
cfg.Timezone = c.Timezone
Expand Down
5 changes: 5 additions & 0 deletions dm/config/task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,11 @@ func (t *testConfig) TestGenAndFromSubTaskConfigs(c *C) {
// deprecated config will not recover
stCfgs[0].EnableANSIQuotes = stCfg1.EnableANSIQuotes
stCfgs[1].EnableANSIQuotes = stCfg2.EnableANSIQuotes
// some features are disabled
c.Assert(stCfg1.EnableHeartbeat, IsTrue)
c.Assert(stCfg2.EnableHeartbeat, IsTrue)
stCfg1.EnableHeartbeat = false
stCfg2.EnableHeartbeat = false
c.Assert(stCfgs[0].String(), Equals, stCfg1.String())
c.Assert(stCfgs[1].String(), Equals, stCfg2.String())
}
Expand Down