summaryrefslogtreecommitdiff
path: root/src/mongo/s/commands/strategy.cpp
diff options
context:
space:
mode:
authorJack Mulrow <jack.mulrow@mongodb.com>2018-04-09 12:49:21 -0400
committerJack Mulrow <jack.mulrow@mongodb.com>2018-04-09 15:46:07 -0400
commit2a61597c7c72e82790f35b51f31358ded60e40fd (patch)
tree3fd69f9908dcde98dfedb3836eca3fa977c701c1 /src/mongo/s/commands/strategy.cpp
parent322f89e07af85e3f61d42fa97b09a89830054915 (diff)
downloadmongo-2a61597c7c72e82790f35b51f31358ded60e40fd.tar.gz
SERVER-34197 Only allow global snapshot reads when test commands are enabled
Diffstat (limited to 'src/mongo/s/commands/strategy.cpp')
-rw-r--r--src/mongo/s/commands/strategy.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/s/commands/strategy.cpp b/src/mongo/s/commands/strategy.cpp
index 769b4968c34..d8c4eff7db2 100644
--- a/src/mongo/s/commands/strategy.cpp
+++ b/src/mongo/s/commands/strategy.cpp
@@ -41,6 +41,7 @@
#include "mongo/db/auth/action_type.h"
#include "mongo/db/auth/authorization_session.h"
#include "mongo/db/commands.h"
+#include "mongo/db/commands/test_commands_enabled.h"
#include "mongo/db/curop.h"
#include "mongo/db/initialize_operation_session_info.h"
#include "mongo/db/lasterror.h"
@@ -217,6 +218,10 @@ void execCommandClient(OperationContext* opCtx,
auto& readConcernArgs = repl::ReadConcernArgs::get(opCtx);
if (readConcernArgs.getLevel() == repl::ReadConcernLevel::kSnapshotReadConcern) {
+ uassert(ErrorCodes::InvalidOptions,
+ "readConcern level snapshot is not supported on mongos",
+ getTestCommandsEnabled());
+
// TODO SERVER-33708.
if (!invocation->supportsReadConcern(readConcernArgs.getLevel())) {
auto body = result->getBodyBuilder();