summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2019-05-24 16:28:51 -0400
committerTess Avitabile <tess.avitabile@mongodb.com>2019-05-24 18:38:29 -0400
commitc237f4c53b6a4ff04762c6aeabf56cd26552d8e8 (patch)
tree7dfa70102a66c8af9697cb2bc0a8901025c6bbc1 /src
parent0855ca379139f59a73276c0d2b24e9c47147b897 (diff)
downloadmongo-c237f4c53b6a4ff04762c6aeabf56cd26552d8e8.tar.gz
SERVER-41312 Ban internalReadAtClusterTime in transactions
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/commands/find_cmd.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/commands/find_cmd.cpp b/src/mongo/db/commands/find_cmd.cpp
index 7e386af97c3..90ded58d209 100644
--- a/src/mongo/db/commands/find_cmd.cpp
+++ b/src/mongo/db/commands/find_cmd.cpp
@@ -286,6 +286,12 @@ public:
" commands are enabled",
!qr->getReadAtClusterTime() || getTestCommandsEnabled());
+ uassert(
+ ErrorCodes::OperationNotSupportedInTransaction,
+ "The '$_internalReadAtClusterTime' option is not supported within a transaction.",
+ !txnParticipant || !txnParticipant.inActiveOrKilledMultiDocumentTransaction() ||
+ !qr->getReadAtClusterTime());
+
uassert(ErrorCodes::InvalidOptions,
"The '$_internalReadAtClusterTime' option is only supported when replication is"
" enabled",