File tree Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ import (
34
34
"github.com/tikv/client-go/v2/internal/locate"
35
35
"github.com/tikv/client-go/v2/internal/logutil"
36
36
"github.com/tikv/client-go/v2/kv"
37
+ "github.com/tikv/client-go/v2/metrics"
37
38
"github.com/tikv/client-go/v2/tikvrpc"
38
39
"github.com/tikv/client-go/v2/txnkv/rangetask"
39
40
"github.com/tikv/client-go/v2/txnkv/txnlock"
@@ -244,6 +245,7 @@ func (action actionPipelinedFlush) handleSingleBatch(
244
245
// TiKV will return a PessimisticLockNotFound error directly if it encounters a different lock. Otherwise,
245
246
// TiKV returns lock.TTL = 0, and we still need to resolve the lock.
246
247
if lock .TxnID > c .startTS && ! c .isPessimistic {
248
+ metrics .LockResolverCountWithWriteConflict .Inc ()
247
249
return tikverr .NewErrWriteConflictWithArgs (
248
250
c .startTS ,
249
251
lock .TxnID ,
Original file line number Diff line number Diff line change @@ -487,6 +487,7 @@ func (handler *prewrite1BatchReqHandler) extractKeyErrs(keyErrs []*kvrpcpb.KeyEr
487
487
// TiKV returns lock.TTL = 0, and we still need to resolve the lock.
488
488
if (lock .TxnID > handler .committer .startTS && ! handler .committer .isPessimistic ) ||
489
489
handler .committer .txn .prewriteEncounterLockPolicy == NoResolvePolicy {
490
+ metrics .LockResolverCountWithWriteConflict .Inc ()
490
491
return nil , tikverr .NewErrWriteConflictWithArgs (
491
492
handler .committer .startTS ,
492
493
lock .TxnID ,
You can’t perform that action at this time.
0 commit comments