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

config: add warning, when users set configuration to mydumper/loader/syncer b… #1410

Merged
merged 12 commits into from
Feb 2, 2021
9 changes: 9 additions & 0 deletions dm/config/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,9 @@ func (c *TaskConfig) adjust() error {
*inst.Mydumper = *rule // ref mydumper config
}
if inst.Mydumper == nil {
if len(c.Mydumpers) != 0 {
log.L().Warn("mysql instance don't refer mydumper's configuration with mydumper-config-name, the default configuration will be used", zap.Int("mysql instance", i))
}
defaultCfg := defaultMydumperConfig()
inst.Mydumper = &defaultCfg
} else if inst.Mydumper.ChunkFilesize == "" {
Expand All @@ -500,6 +503,9 @@ func (c *TaskConfig) adjust() error {
*inst.Loader = *rule // ref loader config
}
if inst.Loader == nil {
if len(c.Loaders) != 0 {
log.L().Warn("mysql instance don't refer loader's configuration with loader-config-name, the default configuration will be used", zap.Int("mysql instance", i))
}
defaultCfg := defaultLoaderConfig()
inst.Loader = &defaultCfg
}
Expand All @@ -516,6 +522,9 @@ func (c *TaskConfig) adjust() error {
*inst.Syncer = *rule // ref syncer config
}
if inst.Syncer == nil {
if len(c.Syncers) != 0 {
log.L().Warn("mysql instance don't refer syncer's configuration with syncer-config-name, the default configuration will be used", zap.Int("mysql instance", i))
lance6716 marked this conversation as resolved.
Show resolved Hide resolved
}
defaultCfg := defaultSyncerConfig()
inst.Syncer = &defaultCfg
}
Expand Down