summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPavi Vetriselvan <pvselvan@umich.edu>2019-06-27 11:10:30 -0400
committerPavi Vetriselvan <pvselvan@umich.edu>2019-06-27 11:12:58 -0400
commit78f534fa92809fd3b9366a046fa5d24988b32944 (patch)
tree95d524c9e715de19c9d571d5e0695f1e561ef975 /src
parent4b955e6a1a35b1704a05aa29bd7e6ed42612333c (diff)
downloadmongo-78f534fa92809fd3b9366a046fa5d24988b32944.tar.gz
SERVER-36824 prevent prepareTransaction command on standalone
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/s/txn_two_phase_commit_cmds.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/s/txn_two_phase_commit_cmds.cpp b/src/mongo/db/s/txn_two_phase_commit_cmds.cpp
index e7369ceb69c..1dd07473d67 100644
--- a/src/mongo/db/s/txn_two_phase_commit_cmds.cpp
+++ b/src/mongo/db/s/txn_two_phase_commit_cmds.cpp
@@ -85,6 +85,11 @@ public:
"'prepareTransaction' is not supported for replica sets with arbiters",
!replCoord->setContainsArbiter());
+ // We do not allow the prepareTransaction command to run on a standalone.
+ uassert(51239,
+ "'prepareTransaction' is not supported on standalone nodes.",
+ replCoord->isReplEnabled());
+
auto txnParticipant = TransactionParticipant::get(opCtx);
uassert(ErrorCodes::CommandFailed,
"prepareTransaction must be run within a transaction",