Skip to content

Commit

Permalink
kvcoord: removing unnecessary handling in LeafTxn
Browse files Browse the repository at this point in the history
LeafTxns don't use heartbeats, therefore we should never hit
this condition.

Release note: None
  • Loading branch information
lidorcarmel committed Feb 15, 2022
1 parent c00ea84 commit a098962
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions pkg/kv/kvclient/kvcoord/txn_coord_sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a098962

Please sign in to comment.