diff options
Diffstat (limited to 'src/mongo/db/service_entry_point_common.cpp')
-rw-r--r-- | src/mongo/db/service_entry_point_common.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/service_entry_point_common.cpp b/src/mongo/db/service_entry_point_common.cpp index 7e1209c64de..20576ba4bd2 100644 --- a/src/mongo/db/service_entry_point_common.cpp +++ b/src/mongo/db/service_entry_point_common.cpp @@ -94,6 +94,8 @@ #include "mongo/rpc/metadata/tracking_metadata.h" #include "mongo/rpc/op_msg.h" #include "mongo/rpc/reply_builder_interface.h" +#include "mongo/transport/ismaster_metrics.h" +#include "mongo/transport/session.h" #include "mongo/util/fail_point.h" #include "mongo/util/log.h" #include "mongo/util/scopeguard.h" @@ -1283,6 +1285,13 @@ DbResponse receivedCommands(OperationContext* opCtx, opCtx->setExhaust(OpMsg::isFlagSet(message, OpMsg::kExhaustSupported)); + const auto session = opCtx->getClient()->session(); + if (session) { + if (!opCtx->isExhaust() || c->getName() != "isMaster"_sd) { + InExhaustIsMaster::get(session.get())->setInExhaustIsMaster(false); + } + } + execCommandDatabase(opCtx, c, request, replyBuilder.get(), behaviors); } catch (const DBException& ex) { BSONObjBuilder metadataBob; |