diff options
author | Cheahuychou Mao <cheahuychou.mao@mongodb.com> | 2020-01-21 11:32:46 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-01-29 03:30:29 +0000 |
commit | 367f47f7f19a6344039a15e3d0748508ad9c6c2c (patch) | |
tree | a9daabfa3c33534496c55bd4d20b87f131c0ba96 /src/mongo/s/async_requests_sender.cpp | |
parent | 5fd95451f78ad667eccca8d4934873529a35e746 (diff) | |
download | mongo-367f47f7f19a6344039a15e3d0748508ad9c6c2c.tar.gz |
SERVER-45449 Write a function to compute the desired latency for a staggered hedged read
create mode 100644 jstests/sharding/hedged_reads_server_parameters.js
rename src/mongo/s/{warmup_server_parameters.cpp => hedge_options_util.cpp} (52%)
rename src/mongo/s/{warmup_server_parameters.h => hedge_options_util.h} (74%)
create mode 100644 src/mongo/s/hedge_options_util_test.cpp
create mode 100644 src/mongo/s/mongos_server_parameters.idl
Diffstat (limited to 'src/mongo/s/async_requests_sender.cpp')
-rw-r--r-- | src/mongo/s/async_requests_sender.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mongo/s/async_requests_sender.cpp b/src/mongo/s/async_requests_sender.cpp index 5d6f0b21ccb..92bf717f5e7 100644 --- a/src/mongo/s/async_requests_sender.cpp +++ b/src/mongo/s/async_requests_sender.cpp @@ -41,6 +41,7 @@ #include "mongo/rpc/get_status_from_command_result.h" #include "mongo/s/client/shard_registry.h" #include "mongo/s/grid.h" +#include "mongo/s/hedge_options_util.h" #include "mongo/transport/baton.h" #include "mongo/transport/transport_layer.h" #include "mongo/util/assert_util.h" @@ -181,8 +182,13 @@ SemiFuture<std::vector<HostAndPort>> AsyncRequestsSender::RemoteData::resolveSha auto AsyncRequestsSender::RemoteData::scheduleRemoteCommand(std::vector<HostAndPort>&& hostAndPorts) -> SemiFuture<RemoteCommandOnAnyCallbackArgs> { - executor::RemoteCommandRequestOnAny request( - std::move(hostAndPorts), _ars->_db, _cmdObj, _ars->_metadataObj, _ars->_opCtx); + auto hedgeOptions = extractHedgeOptions(_ars->_opCtx, _cmdObj); + executor::RemoteCommandRequestOnAny request(std::move(hostAndPorts), + _ars->_db, + _cmdObj, + _ars->_metadataObj, + _ars->_opCtx, + hedgeOptions); // We have to make a promise future pair because the TaskExecutor doesn't currently support a // future returning variant of scheduleRemoteCommand |