Skip to content

Commit

Permalink
fix lint check and address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
asddongmen committed Nov 30, 2022
1 parent 7f3b885 commit 3994ea0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cdc/sinkv2/eventsink/txn/mysql/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,17 @@ func (s *mysqlBackend) execDMLWithMaxRetries(pctx context.Context, dmls *prepare
// we set write source for each txn,
// so we can use it to trace the data source
if err = s.setWriteSource(ctx, tx); err != nil {
err := logDMLTxnErr(
cerror.WrapError(cerror.ErrMySQLTxnError, err),
start, s.changefeed,
fmt.Sprintf("SET SESSION %s = %d", "tidb_cdc_write_source",
s.cfg.SourceID),
dmls.rowCount, dmls.startTs)
if rbErr := tx.Rollback(); rbErr != nil {
if errors.Cause(rbErr) != context.Canceled {
log.Warn("failed to rollback txn", zap.Error(rbErr))
}
}
return 0, err
}

Expand Down

0 comments on commit 3994ea0

Please sign in to comment.