From 01a0dca61cd16b5dda0b83e7751ec2f7de085b66 Mon Sep 17 00:00:00 2001 From: dongmen <414110582@qq.com> Date: Wed, 2 Nov 2022 10:21:18 +0800 Subject: [PATCH] rever unnessarry change --- cdc/sink/mysql/mysql_syncpoint_store.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cdc/sink/mysql/mysql_syncpoint_store.go b/cdc/sink/mysql/mysql_syncpoint_store.go index 5da5176fcb4..5e1d447911e 100644 --- a/cdc/sink/mysql/mysql_syncpoint_store.go +++ b/cdc/sink/mysql/mysql_syncpoint_store.go @@ -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()