From b971391af14367437cd99fc6aeb1dc0a4e361cf4 Mon Sep 17 00:00:00 2001 From: Andrew Baptist Date: Wed, 18 Dec 2024 15:57:44 -0500 Subject: [PATCH] kvserver: only log for too many intents when set In the fix for #135841, the code had incorrectly logged and bumped the stat even if kv.transaction.max_intents_and_locks was set at the default value of 0. This caused a lot of concerning and incorrect logs. This change correctly only logs if the setting is set. Epic: none Release note: None --- pkg/kv/kvclient/kvcoord/txn_interceptor_pipeliner.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kv/kvclient/kvcoord/txn_interceptor_pipeliner.go b/pkg/kv/kvclient/kvcoord/txn_interceptor_pipeliner.go index a88024145feb..b5a2b16cd21d 100644 --- a/pkg/kv/kvclient/kvcoord/txn_interceptor_pipeliner.go +++ b/pkg/kv/kvclient/kvcoord/txn_interceptor_pipeliner.go @@ -738,7 +738,7 @@ func (tp *txnPipeliner) updateLockTracking( // Similar to the in-flight writes case above, we may have gone over the // rejectTxnMaxCount threshold because we don't accurately estimate the // number of ranged locking reads before sending the request. - if tp.writeCount > rejectTxnMaxCount { + if rejectTxnMaxCount > 0 && tp.writeCount > rejectTxnMaxCount { if tp.inflightOverBudgetEveryN.ShouldLog() || log.ExpensiveLogEnabled(ctx, 2) { log.Warningf(ctx, "a transaction has exceeded the maximum number of writes "+ "allowed by kv.transaction.max_intents_and_locks: "+