Skip to content

Commit

Permalink
rever unnessarry change
Browse files Browse the repository at this point in the history
  • Loading branch information
asddongmen committed Nov 2, 2022
1 parent 93a3c29 commit 01a0dca
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cdc/sink/mysql/mysql_syncpoint_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,14 @@ func (s *mysqlSyncPointStore) SinkSyncPoint(ctx context.Context,
s.syncPointRetention.Seconds())
_, err = tx.Exec(query)
if err != nil {
// It is ok to ignore the error, since it will not affect the correctness of the system,
// and no any business logic depends on this behavior, so we just log the error.
log.Error("failed to clean syncpoint table", zap.Error(cerror.WrapError(cerror.ErrMySQLTxnError, err)))
} else {
s.lastCleanSyncPointTime = time.Now()
err2 := tx.Rollback()
// It is ok to ignore the error, since clear sync point is not necessary.
if err2 != nil {
log.Error("failed to clean syncpoint table", zap.Error(cerror.WrapError(cerror.ErrMySQLTxnError, err2)))
}
}
s.lastCleanSyncPointTime = time.Now()
log.Info("clean outdate syncpoint successfully", zap.String("query", query))
}

err = tx.Commit()
Expand Down

0 comments on commit 01a0dca

Please sign in to comment.