Skip to content

Commit 968b528

Browse files
contention: Remove unlimited retries in the contention resolver
Unlimited retries in the resolver for in progress transactions results in contention events for aborted transactions getting stuck in the resolver until the aborted transaction is removed from the txn id cache on the respective gateway node. If the gateway node is getting 100 txns per second, that roughly translates to 7 hours. If the transaction got aborted, we'd prefer to have the partially resolved contention event available in a timely manner. This commit changes unlimited retries for in progress transactions to 60 retries (30 minutes). Fixes: #139258 Release note: None
1 parent a345149 commit 968b528

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkg/sql/contention/resolver.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ package contention
77

88
import (
99
"context"
10-
"math"
1110
"sort"
1211
"strconv"
1312

@@ -80,10 +79,11 @@ const (
8079
// the case where the node is permanently removed from the cluster.
8180
retryBudgetForRPCFailure = uint32(3)
8281

83-
// retryBudgetForTxnInProgress is a special value indicating that the resolver should
84-
// indefinitely retry the resolution. This is because the retry is due to the
85-
// transaction is still in progress.
86-
retryBudgetForTxnInProgress = uint32(math.MaxUint32)
82+
// retryBudgetForTxnInProgress is the number of times the resolverQueue will
83+
// retry resolving until giving up. This is because the retry is due to the
84+
// transaction is still in progress. 60 retries at the default value for the
85+
// cluster setting txn_id_resolution_interval translates to 30 minutes.
86+
retryBudgetForTxnInProgress = uint32(60)
8787
)
8888

8989
// ResolverEndpoint is an alias for the TxnIDResolution RPC endpoint in the

0 commit comments

Comments
 (0)