Skip to content

Commit

Permalink
session: add transaction start timestamp to the log when retrying (pi…
Browse files Browse the repository at this point in the history
  • Loading branch information
jackysp committed Nov 8, 2018
1 parent 386ea13 commit 9b4dce7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ func (s *session) retry(ctx context.Context, maxCnt uint) error {

nh := GetHistory(s)
var err error
orgStartTS := s.GetSessionVars().TxnCtx.StartTS
for {
s.PrepareTxnCtx(ctx)
s.sessionVars.RetryInfo.ResetOffset()
Expand Down Expand Up @@ -514,6 +515,8 @@ func (s *session) retry(ctx context.Context, maxCnt uint) error {
}
s.StmtCommit()
}
log.Warnf("con:%d retrying_txn_start_ts:%d original_txn_start_ts:(%d)",
connID, s.GetSessionVars().TxnCtx.StartTS, orgStartTS)
if hook := ctx.Value("preCommitHook"); hook != nil {
// For testing purpose.
hook.(func())()
Expand Down

0 comments on commit 9b4dce7

Please sign in to comment.