Skip to content

Commit 9fdc8eb

Browse files
authored
session: add transaction start timestamp to the log when retrying (pingcap#8091)
1 parent be1933e commit 9fdc8eb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

session/session.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,7 @@ func (s *session) retry(ctx context.Context, maxCnt uint) error {
468468
nh := GetHistory(s)
469469
var err error
470470
var schemaVersion int64
471+
orgStartTS := s.GetSessionVars().TxnCtx.StartTS
471472
for {
472473
s.PrepareTxnCtx(ctx)
473474
s.sessionVars.RetryInfo.ResetOffset()
@@ -497,6 +498,8 @@ func (s *session) retry(ctx context.Context, maxCnt uint) error {
497498
}
498499
s.StmtCommit()
499500
}
501+
log.Warnf("con:%d retrying_txn_start_ts:%d original_txn_start_ts:(%d)",
502+
connID, s.GetSessionVars().TxnCtx.StartTS, orgStartTS)
500503
if hook := ctx.Value("preCommitHook"); hook != nil {
501504
// For testing purpose.
502505
hook.(func())()

0 commit comments

Comments
 (0)