store/tikv: print log when resolve lock rollback keys (#18736)

when the metric resolve lock is high, this log makes the debug process easier
This commit is contained in:
tiancaiamao
2020-07-24 12:33:35 +08:00
committed by GitHub
parent 9995ad7451
commit a57e95bcaa

View File

@ -598,6 +598,8 @@ func (lr *LockResolver) resolveLock(bo *Backoffer, l *Lock, status TxnStatus, li
}
if status.IsCommitted() {
lreq.CommitVersion = status.CommitTS()
} else {
logutil.BgLogger().Info("resolveLock rollback", zap.String("lock", l.String()))
}
if resolveLite {
@ -605,9 +607,6 @@ func (lr *LockResolver) resolveLock(bo *Backoffer, l *Lock, status TxnStatus, li
// prevent from scanning the whole region in this case.
tikvLockResolverCountWithResolveLockLite.Inc()
lreq.Keys = [][]byte{l.Key}
if !status.IsCommitted() {
logutil.BgLogger().Info("resolveLock rollback", zap.String("lock", l.String()))
}
}
req := tikvrpc.NewRequest(tikvrpc.CmdResolveLock, lreq)
resp, err := lr.store.SendReq(bo, req, loc.Region, readTimeoutShort)