summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSamy Lanka <samy.lanka@mongodb.com>2018-11-13 17:54:25 -0500
committerSamy Lanka <samy.lanka@mongodb.com>2018-11-14 15:59:19 -0500
commitc1d4e0b8e1a4c197aac2530259f78eb88fb4acd3 (patch)
tree735fff720cc1b39e7ec9382773bb5016d4e78dca /src
parentdd2b355042d8f64e2a10d7b9986265ba563dddd8 (diff)
downloadmongo-c1d4e0b8e1a4c197aac2530259f78eb88fb4acd3.tar.gz
SERVER-36587 Disallow the first operation in a transaction to be killCursors
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/transaction_validation.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/transaction_validation.cpp b/src/mongo/db/transaction_validation.cpp
index 819a92087a9..ae6404506d4 100644
--- a/src/mongo/db/transaction_validation.cpp
+++ b/src/mongo/db/transaction_validation.cpp
@@ -103,6 +103,12 @@ void validateSessionOptions(const OperationSessionInfoFromClient& sessionOptions
str::stream() << "It is illegal to provide a txnNumber for command " << cmdName,
commandCanCheckOutSession(cmdName) || shouldCommandSkipSessionCheckout(cmdName));
}
+
+ if (sessionOptions.getStartTransaction()) {
+ uassert(ErrorCodes::OperationNotSupportedInTransaction,
+ "Cannot run killCursors as the first operation in a multi-document transaction.",
+ cmdName != "killCursors");
+ }
}
} // namespace mongo