diff --git a/dm/syncer/checkpoint.go b/dm/syncer/checkpoint.go index 6c881c9f4a4..32decfd9601 100644 --- a/dm/syncer/checkpoint.go +++ b/dm/syncer/checkpoint.go @@ -243,7 +243,7 @@ type CheckPoint interface { // SaveGlobalPointForcibly saves the global binlog stream's checkpoint forcibly. SaveGlobalPointForcibly(location binlog.Location) - // Snapshot make a snapshot of current checkpoint + // Snapshot make a snapshot of current checkpoint. If returns nil, it means nothing has changed since last call. Snapshot(isSyncFlush bool) *SnapshotInfo // FlushPointsExcept flushes the global checkpoint and tables' @@ -376,6 +376,7 @@ func (cp *RemoteCheckPoint) Snapshot(isSyncFlush bool) *SnapshotInfo { // make snapshot is visit in single thread, so depend on rlock should be enough cp.snapshotSeq++ id := cp.snapshotSeq + cp.lastSnapshotCreationTime = time.Now() tableCheckPoints := make(map[string]map[string]tablePoint, len(cp.points)) for s, tableCps := range cp.points { @@ -412,7 +413,6 @@ func (cp *RemoteCheckPoint) Snapshot(isSyncFlush bool) *SnapshotInfo { } cp.snapshots = append(cp.snapshots, snapshot) - cp.lastSnapshotCreationTime = time.Now() return &SnapshotInfo{ id: id, globalPos: globalPoint.location, diff --git a/dm/syncer/syncer.go b/dm/syncer/syncer.go index 30327c6e938..0e8aac0759b 100644 --- a/dm/syncer/syncer.go +++ b/dm/syncer/syncer.go @@ -1168,7 +1168,7 @@ func (s *Syncer) flushCheckPoints() error { snapshotInfo, exceptTables, shardMetaSQLs, shardMetaArgs := s.createCheckpointSnapshot(true) if snapshotInfo == nil { - s.tctx.L().Info("checkpoint has no change, skip sync flush checkpoint") + s.tctx.L().Debug("checkpoint has no change, skip sync flush checkpoint") return nil } @@ -1204,7 +1204,7 @@ func (s *Syncer) flushCheckPointsAsync(asyncFlushJob *job) { snapshotInfo, exceptTables, shardMetaSQLs, shardMetaArgs := s.createCheckpointSnapshot(false) if snapshotInfo == nil { - s.tctx.L().Info("checkpoint has no change, skip async flush checkpoint", zap.Int64("job seq", asyncFlushJob.flushSeq)) + s.tctx.L().Debug("checkpoint has no change, skip async flush checkpoint", zap.Int64("job seq", asyncFlushJob.flushSeq)) return }