From 6be992cc3988348f81906d5eabb40867c73c3e59 Mon Sep 17 00:00:00 2001 From: Evan Tschannen Date: Fri, 18 Mar 2022 15:24:31 -0700 Subject: [PATCH] fix: do not reply to a txnStateRequest for the final sequence unless we have processes the txnStateStore --- fdbserver/CommitProxyServer.actor.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fdbserver/CommitProxyServer.actor.cpp b/fdbserver/CommitProxyServer.actor.cpp index 13f3729ef0..04184c430a 100644 --- a/fdbserver/CommitProxyServer.actor.cpp +++ b/fdbserver/CommitProxyServer.actor.cpp @@ -1955,6 +1955,8 @@ struct TransactionStateResolveContext { // Pointer to transaction state store, shortcut for commitData.txnStateStore IKeyValueStore* pTxnStateStore = nullptr; + Future txnRecovery; + // Actor streams PromiseStream>* pActors = nullptr; @@ -2070,6 +2072,9 @@ ACTOR Future processTransactionStateRequestPart(TransactionStateResolveCon ASSERT(pContext->pActors != nullptr); if (pContext->receivedSequences.count(request.sequence)) { + if (pContext->receivedSequences.size() == pContext->maxSequence) { + wait(pContext->txnRecovery); + } // This part is already received. Still we will re-broadcast it to other CommitProxies pContext->pActors->send(broadcastTxnRequest(request, SERVER_KNOBS->TXN_STATE_SEND_AMOUNT, true)); wait(yield()); @@ -2095,7 +2100,8 @@ ACTOR Future processTransactionStateRequestPart(TransactionStateResolveCon if (pContext->receivedSequences.size() == pContext->maxSequence) { // Received all components of the txnStateRequest ASSERT(!pContext->processed); - wait(processCompleteTransactionStateRequest(pContext)); + pContext->txnRecovery = processCompleteTransactionStateRequest(pContext); + wait(pContext->txnRecovery); pContext->processed = true; }