diff --git a/txnkv/transaction/prewrite.go b/txnkv/transaction/prewrite.go index eea7f93ebe..45051c0cb3 100644 --- a/txnkv/transaction/prewrite.go +++ b/txnkv/transaction/prewrite.go @@ -215,6 +215,10 @@ func (action actionPrewrite) handleSingleBatch(c *twoPhaseCommitter, bo *retry.B }() for { attempts++ + if attempts > 1 || action.retry { + req.IsRetryRequest = true + } + if time.Since(tBegin) > slowRequestThreshold { logutil.BgLogger().Warn("slow prewrite request", zap.Uint64("startTS", c.startTS), zap.Stringer("region", &batch.region), zap.Int("attempts", attempts)) tBegin = time.Now()