From 971d883db700e8800daefbc2add15e24046030d2 Mon Sep 17 00:00:00 2001 From: Trevor Clinkenbeard Date: Mon, 27 Jul 2026 13:03:21 -0700 Subject: [PATCH] Prevent client profiling maintenance from profiling itself --- fdbclient/DatabaseContext.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fdbclient/DatabaseContext.cpp b/fdbclient/DatabaseContext.cpp index 1a869c854d..8630651e51 100644 --- a/fdbclient/DatabaseContext.cpp +++ b/fdbclient/DatabaseContext.cpp @@ -616,13 +616,19 @@ struct TrInfoChunk { static const Key CLIENT_LATENCY_INFO_PREFIX = "client_latency/"_sr; static const Key CLIENT_LATENCY_INFO_CTR_PREFIX = "client_latency_counter/"_sr; +static void resetClientStatusTransaction(Transaction* tr) { + tr->reset(); + // Profiling maintenance must not generate more records for itself to persist. + tr->trState->trLogInfo.clear(); +} + static Future transactionInfoCommitActor(Transaction* tr, std::vector* chunks) { const Key clientLatencyAtomicCtr = CLIENT_LATENCY_INFO_CTR_PREFIX.withPrefix(fdbClientInfoPrefixRange.begin); int retryCount = 0; while (true) { Error err; try { - tr->reset(); + resetClientStatusTransaction(tr); tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); tr->setOption(FDBTransactionOptions::LOCK_AWARE); [[maybe_unused]] Future> vstamp = tr->getVersionstamp(); @@ -656,7 +662,7 @@ static Future delExcessClntTxnEntriesActor(Transaction* tr, int64_t client while (true) { Error err; try { - tr->reset(); + resetClientStatusTransaction(tr); tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS); tr->setOption(FDBTransactionOptions::LOCK_AWARE); Optional ctrValue = co_await tr->get(KeyRef(clientLatencyAtomicCtr), Snapshot::True);