summaryrefslogtreecommitdiff
path: root/src/mongo/db/transaction_participant.cpp
diff options
context:
space:
mode:
authorJack Mulrow <jack.mulrow@mongodb.com>2019-01-28 15:02:09 -0500
committerJack Mulrow <jack.mulrow@mongodb.com>2019-01-29 16:48:48 -0500
commit7380d6e9ad0a90f6c5758b52d166d4069dd5a502 (patch)
tree5bf2f22b518176d09bff84c0f5704450b3b9fa7b /src/mongo/db/transaction_participant.cpp
parent9c83ead9257d0d41d7b7ec92adf441bf34b0c3a8 (diff)
downloadmongo-7380d6e9ad0a90f6c5758b52d166d4069dd5a502.tar.gz
SERVER-39124 Mongos should abort cleared participants between retries of transaction statements
Diffstat (limited to 'src/mongo/db/transaction_participant.cpp')
-rw-r--r--src/mongo/db/transaction_participant.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mongo/db/transaction_participant.cpp b/src/mongo/db/transaction_participant.cpp
index 5e7323acc45..dd1fd62b229 100644
--- a/src/mongo/db/transaction_participant.cpp
+++ b/src/mongo/db/transaction_participant.cpp
@@ -459,11 +459,10 @@ void TransactionParticipant::beginOrContinue(TxnNumber txnNumber,
"transaction number",
serverGlobalParams.clusterRole != ClusterRole::None);
- // The active transaction number can only be reused if the transaction is not in a state
- // that indicates it has been involved in a two phase commit. In normal operation this check
- // should never fail.
- const auto restartableStates =
- TransactionState::kInProgress | TransactionState::kAbortedWithoutPrepare;
+ // The active transaction number can only be reused if the transaction is aborted and has
+ // not been involved in a two phase commit. Assuming routers target primaries in increasing
+ // order of term and in the absence of byzantine messages, this check should never fail.
+ const auto restartableStates = TransactionState::kAbortedWithoutPrepare;
uassert(50911,
str::stream() << "Cannot start a transaction at given transaction number "
<< txnNumber