summaryrefslogtreecommitdiff
path: root/src/mongo/client
diff options
context:
space:
mode:
authorDaniel Morilha <daniel.morilha@mongodb.com>2022-05-27 19:02:58 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-05-27 20:16:46 +0000
commita474d4efa5a999526e696423af5d30f4f5187613 (patch)
tree0cf942c5c123999881377e9596440a416075a39e /src/mongo/client
parent015bbbacf80e79c5661f5efef5cb255c02eacc1f (diff)
downloadmongo-a474d4efa5a999526e696423af5d30f4f5187613.tar.gz
SERVER-66260 Modify executor::RemoteCommandRequest to accept an Options argument
Transitioning from `RemoteCommandRequestBase::HedgeOptions` into a generic Options `struct`ure in order to accommodate new options into requests for remote commands. ``` struct RemoteCommandRequestBase { struct Options { size_t hedgeCount = 0; int maxTimeMSForHedgedReads = 0; bool isHedgeEnabled = false; bool fireAndForget = false; }; ``` The `boost::optional` which wrapped the previous structure was deprecated in favor of a new `isHedgeEnabled` boolean field which should be logically equivalent. `fireAndForget` was also moved from the outer class inside. Code and tests were appropriately adjusted.
Diffstat (limited to 'src/mongo/client')
-rw-r--r--src/mongo/client/async_client.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/mongo/client/async_client.cpp b/src/mongo/client/async_client.cpp
index 030e22de674..3a568fa7e31 100644
--- a/src/mongo/client/async_client.cpp
+++ b/src/mongo/client/async_client.cpp
@@ -320,9 +320,7 @@ Future<executor::RemoteCommandResponse> AsyncDBClient::runCommandRequest(
auto opMsgRequest = OpMsgRequest::fromDBAndBody(
std::move(request.dbname), std::move(request.cmdObj), std::move(request.metadata));
opMsgRequest.securityToken = request.securityToken;
- auto fireAndForget =
- request.fireAndForgetMode == executor::RemoteCommandRequest::FireAndForgetMode::kOn;
- return runCommand(std::move(opMsgRequest), baton, fireAndForget)
+ return runCommand(std::move(opMsgRequest), baton, request.options.fireAndForget)
.then([this, startTimer = std::move(startTimer)](rpc::UniqueReply response) {
return executor::RemoteCommandResponse(*response, startTimer.elapsed());
});