Skip to content

Commit 0e97aef

Browse files
committed
intentresolver: drop unused ctx arg
1 parent 0426d5a commit 0e97aef

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

pkg/kv/kvserver/intentresolver/intent_resolver.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,6 @@ func (ir *IntentResolver) lockInFlightTxnCleanup(
704704
// of async task with the intention that it be used as a hook to update metrics.
705705
// It will not be called if an error is returned.
706706
func (ir *IntentResolver) CleanupTxnIntentsOnGCAsync(
707-
_ context.Context, // TODO(tbg): remove
708707
admissionHeader kvpb.AdmissionHeader,
709708
rangeID roachpb.RangeID,
710709
txn *roachpb.Transaction,

pkg/kv/kvserver/intentresolver/intent_resolver_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,7 @@ func TestCleanupTxnIntentsOnGCAsync(t *testing.T) {
226226
}
227227
txn := c.txn.Clone()
228228
txn.LockSpans = append([]roachpb.Span{}, c.intentSpans...)
229-
err := ir.CleanupTxnIntentsOnGCAsync(
230-
ctx, kvpb.AdmissionHeader{}, 1, txn, clock.Now(), onComplete)
229+
err := ir.CleanupTxnIntentsOnGCAsync(kvpb.AdmissionHeader{}, 1, txn, clock.Now(), onComplete)
231230
if err != nil {
232231
t.Fatalf("unexpected error sending async transaction")
233232
}

pkg/kv/kvserver/mvcc_gc_queue.go

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -744,18 +744,16 @@ func (mgcq *mvccGCQueue) process(
744744
},
745745
func(ctx context.Context, txn *roachpb.Transaction) error {
746746
err := repl.store.intentResolver.
747-
CleanupTxnIntentsOnGCAsync(
748-
ctx, gcAdmissionHeader(repl.store.ClusterSettings()), repl.RangeID, txn, gcTimestamp,
749-
func(pushed, succeeded bool) {
750-
if pushed {
751-
mgcq.store.metrics.GCPushTxn.Inc(1)
752-
}
753-
if succeeded {
754-
mgcq.store.metrics.GCResolveSuccess.Inc(int64(len(txn.LockSpans)))
755-
} else {
756-
mgcq.store.metrics.GCTxnIntentsResolveFailed.Inc(int64(len(txn.LockSpans)))
757-
}
758-
})
747+
CleanupTxnIntentsOnGCAsync(gcAdmissionHeader(repl.store.ClusterSettings()), repl.RangeID, txn, gcTimestamp, func(pushed, succeeded bool) {
748+
if pushed {
749+
mgcq.store.metrics.GCPushTxn.Inc(1)
750+
}
751+
if succeeded {
752+
mgcq.store.metrics.GCResolveSuccess.Inc(int64(len(txn.LockSpans)))
753+
} else {
754+
mgcq.store.metrics.GCTxnIntentsResolveFailed.Inc(int64(len(txn.LockSpans)))
755+
}
756+
})
759757
if errors.Is(err, stop.ErrThrottled) {
760758
log.Eventf(ctx, "processing txn %s: %s; skipping for future GC", txn.ID.Short(), err)
761759
return nil

0 commit comments

Comments
 (0)