Skip to content

Commit

Permalink
executor: refine an error log message (#11758) (#16067)
Browse files Browse the repository at this point in the history
  • Loading branch information
sre-bot authored Apr 13, 2020
1 parent 3f6a2b9 commit 31f87b8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions executor/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,12 +518,16 @@ func (a *ExecStmt) handlePessimisticLockError(ctx context.Context, err error) (E
zap.Binary("lockKey", deadlock.LockKey),
zap.Uint64("deadlockKeyHash", deadlock.DeadlockKeyHash))
} else if terror.ErrorEqual(kv.ErrWriteConflict, err) {
conflictCommitTS := extractConflictCommitTS(err.Error())
errStr := err.Error()
conflictCommitTS := extractConflictCommitTS(errStr)
if conflictCommitTS == 0 {
logutil.Logger(ctx).Warn("failed to extract conflictCommitTS from a conflict error")
}
forUpdateTS := txnCtx.GetForUpdateTS()
logutil.Logger(ctx).Info("pessimistic write conflict, retry statement",
zap.Uint64("txn", txnCtx.StartTS),
zap.Uint64("forUpdateTS", forUpdateTS),
zap.Uint64("conflictCommitTS", conflictCommitTS))
zap.String("err", errStr))
if conflictCommitTS > forUpdateTS {
newForUpdateTS = conflictCommitTS
}
Expand Down

0 comments on commit 31f87b8

Please sign in to comment.