summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2018-09-13 20:09:04 -0400
committerSiyuan Zhou <siyuan.zhou@mongodb.com>2018-09-14 14:37:06 -0400
commit3d2124a52216a469f5dbc510c660d6f6cd03184d (patch)
treea91494f3814a6f55f34fc134f4e844c942fea085
parent7e8486ba84837a548f2f1470209eb204a42c293a (diff)
downloadmongo-3d2124a52216a469f5dbc510c660d6f6cd03184d.tar.gz
SERVER-35307 Remove verbose try-catch in prepareTransaction().
-rw-r--r--src/mongo/db/transaction_participant.cpp18
1 files changed, 1 insertions, 17 deletions
diff --git a/src/mongo/db/transaction_participant.cpp b/src/mongo/db/transaction_participant.cpp
index e7efc8d2308..a24a4a7df3e 100644
--- a/src/mongo/db/transaction_participant.cpp
+++ b/src/mongo/db/transaction_participant.cpp
@@ -591,23 +591,7 @@ Timestamp TransactionParticipant::prepareTransaction(OperationContext* opCtx,
lk.unlock();
opCtx->getServiceContext()->getOpObserver()->onTransactionPrepare(opCtx, prepareOplogSlot);
- // After the oplog entry is written successfully, it is illegal to implicitly abort or fail.
- try {
- abortGuard.Dismiss();
-
- lk.lock();
-
- // Although we are not allowed to abort here, we check that we don't even try to. If we do
- // try to, that is a bug and we will fassert below.
- _checkIsActiveTransaction(lk, *opCtx->getTxnNumber(), true);
-
- // Ensure that the transaction is still prepared.
- invariant(_txnState.isPrepared(lk), str::stream() << "Current state: " << _txnState);
- } catch (...) {
- severe() << "Illegal exception after transaction was prepared.";
- fassertFailedWithStatus(50906, exceptionToStatus());
- }
-
+ abortGuard.Dismiss();
return prepareOplogSlot.opTime.getTimestamp();
}