session: add transaction start timestamp to the log when retrying (#8091)

This commit is contained in:
Jack Yu
2018-11-07 16:12:39 +08:00
committed by GitHub
parent be1933eee8
commit 9fdc8ebe5d

View File

@ -468,6 +468,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()
@ -497,6 +498,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())()