From 30ec66fb80ca88125de883188b607cf87b5f2b61 Mon Sep 17 00:00:00 2001 From: lance6716 Date: Thu, 24 Feb 2022 16:57:59 +0800 Subject: [PATCH] syncer(dm): support more about Syncer with nil etcdcli --- dm/syncer/syncer.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dm/syncer/syncer.go b/dm/syncer/syncer.go index de05b2132a8..f17d7c51003 100644 --- a/dm/syncer/syncer.go +++ b/dm/syncer/syncer.go @@ -1251,7 +1251,7 @@ func (s *Syncer) afterFlushCheckpoint(task *checkpointFlushTask) error { s.logAndClearFilteredStatistics() - if s.cliArgs != nil && s.cliArgs.StartTime != "" { + if s.cliArgs != nil && s.cliArgs.StartTime != "" && s.cli != nil { clone := *s.cliArgs clone.StartTime = "" err2 := ha.PutTaskCliArgs(s.cli, s.cfg.Name, []string{s.cfg.SourceID}, clone) @@ -3733,6 +3733,9 @@ func (s *Syncer) adjustGlobalPointGTID(tctx *tcontext.Context) (bool, error) { // delLoadTask is called when finish restoring data, to delete load worker in etcd. func (s *Syncer) delLoadTask() error { + if s.cli == nil { + return nil + } _, _, err := ha.DelLoadTask(s.cli, s.cfg.Name, s.cfg.SourceID) if err != nil { return err