Skip to content

Commit

Permalink
session: add transaction start timestamp to the log when retrying (#8091
Browse files Browse the repository at this point in the history
) (#8224)
  • Loading branch information
jackysp authored and zz-jason committed Nov 7, 2018
1 parent a89b6fe commit 12439c3
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 @@ -464,6 +464,7 @@ func (s *session) retry(ctx context.Context, maxCnt uint) error {
nh := GetHistory(s)
var err error
var schemaVersion int64
orgStartTS := s.GetSessionVars().TxnCtx.StartTS
for {
s.PrepareTxnCtx(ctx)
s.sessionVars.RetryInfo.ResetOffset()
Expand Down Expand Up @@ -493,6 +494,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 12439c3

Please sign in to comment.