From a0989629f252a8400e73aaa726d41bbc50de7c5f Mon Sep 17 00:00:00 2001 From: Lidor Carmel Date: Wed, 9 Feb 2022 22:03:23 -0800 Subject: [PATCH] kvcoord: removing unnecessary handling in LeafTxn LeafTxns don't use heartbeats, therefore we should never hit this condition. Release note: None --- pkg/kv/kvclient/kvcoord/txn_coord_sender.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkg/kv/kvclient/kvcoord/txn_coord_sender.go b/pkg/kv/kvclient/kvcoord/txn_coord_sender.go index 8ff89f50eef1..4d94f507805a 100644 --- a/pkg/kv/kvclient/kvcoord/txn_coord_sender.go +++ b/pkg/kv/kvclient/kvcoord/txn_coord_sender.go @@ -728,12 +728,6 @@ func (tc *TxnCoordSender) maybeRejectClientLocked( // See the comment on txnHeartbeater.mu.finalObservedStatus for more details. abortedErr := roachpb.NewErrorWithTxn( roachpb.NewTransactionAbortedError(roachpb.ABORT_REASON_CLIENT_REJECT), &tc.mu.txn) - if tc.typ == kv.LeafTxn { - // Leaf txns return raw retriable errors (which get handled by the - // root) rather than TransactionRetryWithProtoRefreshError. - return abortedErr - } - // Root txns handle retriable errors. return roachpb.NewError(tc.handleRetryableErrLocked(ctx, abortedErr)) case protoStatus != roachpb.PENDING || hbObservedStatus != roachpb.PENDING: // The transaction proto is in an unexpected state.