summaryrefslogtreecommitdiff
path: root/src/mongo/executor/remote_command_request.cpp
diff options
context:
space:
mode:
authorGeorge Wangensteen <george.wangensteen@mongodb.com>2022-11-14 15:42:16 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-11-14 16:41:47 +0000
commitd4cd973ae39fe2625a84f2f7b711f9c7ebe885e9 (patch)
tree72bc94e261e5050d0bfed4c325a1aa71c1940d9a /src/mongo/executor/remote_command_request.cpp
parent93612bf95f8003a1e1d6af27fb1b67c57c6f3e39 (diff)
downloadmongo-d4cd973ae39fe2625a84f2f7b711f9c7ebe885e9.tar.gz
SERVER-71086 Refactor hedged-read-determination code to be shared between async_rpc and other consumers
Diffstat (limited to 'src/mongo/executor/remote_command_request.cpp')
-rw-r--r--src/mongo/executor/remote_command_request.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mongo/executor/remote_command_request.cpp b/src/mongo/executor/remote_command_request.cpp
index 524541d9c59..b3fa3fb687f 100644
--- a/src/mongo/executor/remote_command_request.cpp
+++ b/src/mongo/executor/remote_command_request.cpp
@@ -80,7 +80,7 @@ RemoteCommandRequestBase::RemoteCommandRequestBase(RequestId requestId,
<< query_request_helper::kMaxTimeMSOpOnlyField,
!cmdObj.hasField(query_request_helper::kMaxTimeMSOpOnlyField));
- if (options.isHedgeEnabled) {
+ if (options.hedgeOptions.isHedgeEnabled) {
operationKey.emplace(UUID::gen());
cmdObj = cmdObj.addField(BSON("clientOperationKey" << operationKey.value()).firstElement());
}
@@ -169,9 +169,9 @@ std::string RemoteCommandRequestImpl<T>::toString() const {
out << " expDate:" << (*dateScheduled + timeout).toString();
}
- if (options.isHedgeEnabled) {
+ if (options.hedgeOptions.isHedgeEnabled) {
invariant(operationKey);
- out << " options.hedgeCount: " << options.hedgeCount;
+ out << " options.hedgeCount: " << options.hedgeOptions.hedgeCount;
out << " operationKey: " << operationKey.value();
}
@@ -199,9 +199,7 @@ template struct RemoteCommandRequestImpl<HostAndPort>;
template struct RemoteCommandRequestImpl<std::vector<HostAndPort>>;
void RemoteCommandRequestBase::Options::resetHedgeOptions() {
- hedgeCount = 0;
- maxTimeMSForHedgedReads = 0;
- isHedgeEnabled = false;
+ hedgeOptions = {};
}
} // namespace executor