summaryrefslogtreecommitdiff
path: root/src/mongo/executor/network_interface_tl.h
diff options
context:
space:
mode:
authorJason Carey <jcarey@argv.me>2019-05-13 18:24:36 -0400
committerJason Carey <jcarey@argv.me>2019-06-06 09:00:28 -0400
commitefa1ae064b9206f82136a8d14cbb86d47e8754b1 (patch)
treec4666fa197f837b5a0feaa8f980299a8eed7146a /src/mongo/executor/network_interface_tl.h
parentb1ff28c63836aa13112cf3499574160a5950c6ec (diff)
downloadmongo-efa1ae064b9206f82136a8d14cbb86d47e8754b1.tar.gz
SERVER-41133 Add TE::scheduleRemoteCommandOnAny
Add support for a mode for the task executor where rather than targetting a single host, we target any of a set of hosts. This should behave identically to scheduleRemoteCommand, except that we concurrently get() connections from the connection pool for each host, preferring the first which is available
Diffstat (limited to 'src/mongo/executor/network_interface_tl.h')
-rw-r--r--src/mongo/executor/network_interface_tl.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mongo/executor/network_interface_tl.h b/src/mongo/executor/network_interface_tl.h
index 7e7b24b8c71..8ce93e1da08 100644
--- a/src/mongo/executor/network_interface_tl.h
+++ b/src/mongo/executor/network_interface_tl.h
@@ -65,7 +65,7 @@ public:
void signalWorkAvailable() override;
Date_t now() override;
Status startCommand(const TaskExecutor::CallbackHandle& cbHandle,
- RemoteCommandRequest& request,
+ RemoteCommandRequestOnAny& request,
RemoteCommandCompletionFn&& onFinish,
const BatonHandle& baton) override;
@@ -86,21 +86,22 @@ public:
private:
struct CommandState {
CommandState(NetworkInterfaceTL* interface_,
- RemoteCommandRequest request_,
+ RemoteCommandRequestOnAny request_,
const TaskExecutor::CallbackHandle& cbHandle_,
- Promise<RemoteCommandResponse> promise_);
+ Promise<RemoteCommandOnAnyResponse> promise_);
~CommandState();
// Create a new CommandState in a shared_ptr
// Prefer this over raw construction
static auto make(NetworkInterfaceTL* interface,
- RemoteCommandRequest request,
+ RemoteCommandRequestOnAny request,
const TaskExecutor::CallbackHandle& cbHandle,
- Promise<RemoteCommandResponse> promise);
+ Promise<RemoteCommandOnAnyResponse> promise);
NetworkInterfaceTL* interface;
- RemoteCommandRequest request;
+ RemoteCommandRequestOnAny requestOnAny;
+ boost::optional<RemoteCommandRequest> request;
TaskExecutor::CallbackHandle cbHandle;
Date_t deadline = RemoteCommandRequest::kNoExpirationDate;
Date_t start;
@@ -109,7 +110,7 @@ private:
std::unique_ptr<transport::ReactorTimer> timer;
AtomicWord<bool> done;
- Promise<RemoteCommandResponse> promise;
+ Promise<RemoteCommandOnAnyResponse> promise;
};
struct AlarmState {