diff options
author | Mathias Stearn <mathias@10gen.com> | 2017-07-24 15:36:03 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2017-08-17 22:13:09 -0400 |
commit | 112982eeaddf92cbc14be655061200e23069250a (patch) | |
tree | c5ccae14cc77916823f87eea07f6b39e7d6718e5 /src/mongo/tools | |
parent | 5f85627971603bf9f5c832f9d4ca2808b31b0efd (diff) | |
download | mongo-112982eeaddf92cbc14be655061200e23069250a.tar.gz |
SERVER-28510 Add DBClient::runFireAndForgetCommand() and use it to implement legacy op emulation
Diffstat (limited to 'src/mongo/tools')
-rw-r--r-- | src/mongo/tools/bridge.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mongo/tools/bridge.cpp b/src/mongo/tools/bridge.cpp index 07942a6a61b..5f9eac1e4e0 100644 --- a/src/mongo/tools/bridge.cpp +++ b/src/mongo/tools/bridge.cpp @@ -150,6 +150,8 @@ public: request = std::move(swm.getValue()); } + const bool isFireAndForgetCommand = OpMsg::isFlagSet(request, OpMsg::kMoreToCome); + boost::optional<OpMsgRequest> cmdRequest; if ((request.operation() == dbQuery && NamespaceString(DbMessage(request).getns()).isCommand()) || @@ -170,6 +172,8 @@ public: // The 'request' is consumed by the mongobridge and does not get forwarded to // 'dest'. if (auto status = maybeProcessBridgeCommand(cmdRequest)) { + invariant(!isFireAndForgetCommand); + auto replyBuilder = rpc::makeReplyBuilder(rpc::protocolForMessage(request)); BSONObj metadata; BSONObj reply; @@ -222,8 +226,9 @@ public: // Send the message we received from '_mp' to 'dest'. 'dest' returns a response for // OP_QUERY, OP_GET_MORE, and OP_COMMAND messages that we respond back to // '_mp' with. - if (request.operation() == dbQuery || request.operation() == dbGetMore || - request.operation() == dbCommand || request.operation() == dbMsg) { + if (!isFireAndForgetCommand && + (request.operation() == dbQuery || request.operation() == dbGetMore || + request.operation() == dbCommand || request.operation() == dbMsg)) { // TODO dbMsg moreToCome // Forward the message to 'dest' and receive its reply in 'response'. response.reset(); |