summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJudah Schvimer <judah@mongodb.com>2019-04-11 10:44:33 -0400
committerJudah Schvimer <judah@mongodb.com>2019-04-11 10:44:33 -0400
commitd50459e50a9440e703d00fab5862faa971d1cfc7 (patch)
tree6c352254cdb67fa13cab226734fe06065773a211
parent21c3aa3c2d120cac881044d1fb38834a15246448 (diff)
downloadmongo-d50459e50a9440e703d00fab5862faa971d1cfc7.tar.gz
SERVER-40572 add skipCommitTxnCheckPrepareMajorityCommitted failpoint
-rw-r--r--src/mongo/db/commands/txn_cmds.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/db/commands/txn_cmds.cpp b/src/mongo/db/commands/txn_cmds.cpp
index 477eddcf405..97cb91765d1 100644
--- a/src/mongo/db/commands/txn_cmds.cpp
+++ b/src/mongo/db/commands/txn_cmds.cpp
@@ -50,6 +50,7 @@ MONGO_FAIL_POINT_DEFINE(participantReturnNetworkErrorForAbortAfterExecutingAbort
MONGO_FAIL_POINT_DEFINE(participantReturnNetworkErrorForCommitAfterExecutingCommitLogic);
MONGO_FAIL_POINT_DEFINE(hangBeforeCommitingTxn);
MONGO_FAIL_POINT_DEFINE(hangBeforeAbortingTxn);
+MONGO_FAIL_POINT_DEFINE(skipCommitTxnCheckPrepareMajorityCommitted);
class CmdCommitTxn : public BasicCommand {
public:
@@ -121,7 +122,8 @@ public:
"commitTransaction for a prepared transaction cannot be run before its prepare "
"oplog entry has been majority committed",
replCoord->getLastCommittedOpTime().getTimestamp() >=
- txnParticipant.getPrepareOpTime().getTimestamp());
+ txnParticipant.getPrepareOpTime().getTimestamp() ||
+ MONGO_FAIL_POINT(skipCommitTxnCheckPrepareMajorityCommitted));
// commitPreparedTransaction will throw if the transaction is not prepared.
txnParticipant.commitPreparedTransaction(opCtx, optionalCommitTimestamp.get(), {});
} else {