Skip to content

Commit

Permalink
syncer(dm): support more about Syncer with nil etcdcli (#4690)
Browse files Browse the repository at this point in the history
ref #4287
  • Loading branch information
lance6716 authored Feb 24, 2022
1 parent ed2ac96 commit 901ba1d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dm/syncer/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 901ba1d

Please sign in to comment.