summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/txn_cmds.cpp
diff options
context:
space:
mode:
authorLouis Williams <louis.williams@mongodb.com>2018-03-21 11:37:40 -0400
committerLouis Williams <louis.williams@mongodb.com>2018-03-23 13:09:35 -0400
commit8823c3dfe826cbc3bf72208025010abc7d01c80e (patch)
tree2bbc7c4b434afda5008835fe9c4611277f109403 /src/mongo/db/commands/txn_cmds.cpp
parentb388395c255f7144dff2b582ed7ad1227f7351ff (diff)
downloadmongo-8823c3dfe826cbc3bf72208025010abc7d01c80e.tar.gz
SERVER-33309 SERVER-33310 Handle WT_PREPARE_CONFLICT. Add methods in
WiredTigerSessionCache to wait and notify on prepared units of work.
Diffstat (limited to 'src/mongo/db/commands/txn_cmds.cpp')
-rw-r--r--src/mongo/db/commands/txn_cmds.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/commands/txn_cmds.cpp b/src/mongo/db/commands/txn_cmds.cpp
index d3fefaa8e68..a76b1a794d3 100644
--- a/src/mongo/db/commands/txn_cmds.cpp
+++ b/src/mongo/db/commands/txn_cmds.cpp
@@ -89,6 +89,8 @@ public:
} commitTxn;
+MONGO_FP_DECLARE(pauseAfterTransactionPrepare);
+
// TODO: This is a stub for testing storage prepare functionality.
class CmdPrepareTxn : public BasicCommand {
public:
@@ -132,6 +134,8 @@ public:
// Running commit after prepare is not allowed yet.
// Prepared units of work cannot be released by the session, so we immediately abort here.
opCtx->getWriteUnitOfWork()->prepare();
+ // This failpoint will cause readers of prepared documents to return prepare conflicts.
+ MONGO_FAIL_POINT_PAUSE_WHILE_SET(pauseAfterTransactionPrepare);
session->abortActiveTransaction(opCtx);
return true;
}