From 23794c14b03bb272daad7a2b25eca0b80c03a31c Mon Sep 17 00:00:00 2001 From: Kevin Pulo Date: Thu, 9 Aug 2018 04:00:41 +0000 Subject: SERVER-33606 fail to create logical session in shell connected to old servers Also add --disableImplicitSessions shell cmdline arg. --- src/mongo/shell/shell_options.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/mongo/shell/shell_options.cpp') diff --git a/src/mongo/shell/shell_options.cpp b/src/mongo/shell/shell_options.cpp index 71cf4ceb147..a3e6d9e82d5 100644 --- a/src/mongo/shell/shell_options.cpp +++ b/src/mongo/shell/shell_options.cpp @@ -220,6 +220,11 @@ Status addMongoShellOptions(moe::OptionSection* options) { moe::Switch, "automatically retry write operations upon transient network errors"); + options->addOptionChaining("disableImplicitSessions", + "disableImplicitSessions", + moe::Switch, + "do not automatically create and use implicit sessions"); + options ->addOptionChaining( "rpcProtocols", "rpcProtocols", moe::String, " none, opQueryOnly, opMsgOnly, all") @@ -387,6 +392,9 @@ Status storeMongoShellOptions(const moe::Environment& params, if (params.count("retryWrites")) { shellGlobalParams.shouldRetryWrites = true; } + if (params.count("disableImplicitSessions")) { + shellGlobalParams.shouldUseImplicitSessions = false; + } if (params.count("rpcProtocols")) { std::string protos = params["rpcProtocols"].as(); auto parsedRPCProtos = rpc::parseProtocolSet(protos); -- cgit v1.2.1