summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/vote_requester.h
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2016-03-08 19:40:54 -0500
committerSiyuan Zhou <siyuan.zhou@mongodb.com>2016-04-12 16:54:42 -0400
commitded60f5d4254f08d76ccdf0d3a694d473bd14100 (patch)
tree585cd96ce9dbfc9d23e6a66911e33f464e87edf1 /src/mongo/db/repl/vote_requester.h
parent51abe7d21b799a3758ce71d18ac7d6a088f71e2c (diff)
downloadmongo-ded60f5d4254f08d76ccdf0d3a694d473bd14100.tar.gz
SERVER-22995 Protect TopoCoord with mutex rather than single thread executor.
Move scatter gather runner out of executor and protect the runner with its own mutex. Replace onComplete with callbacks scheduled on finish event.
Diffstat (limited to 'src/mongo/db/repl/vote_requester.h')
-rw-r--r--src/mongo/db/repl/vote_requester.h23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/mongo/db/repl/vote_requester.h b/src/mongo/db/repl/vote_requester.h
index 433facf345c..cb0be7fc888 100644
--- a/src/mongo/db/repl/vote_requester.h
+++ b/src/mongo/db/repl/vote_requester.h
@@ -105,26 +105,19 @@ public:
* in currentConfig, in attempt to receive sufficient votes to win the election.
*
* evh can be used to schedule a callback when the process is complete.
- * This function must be run in the executor, as it must be synchronous with the command
- * callbacks that it schedules.
* If this function returns Status::OK(), evh is then guaranteed to be signaled.
**/
- StatusWith<ReplicationExecutor::EventHandle> start(
- ReplicationExecutor* executor,
- const ReplicaSetConfig& rsConfig,
- long long candidateIndex,
- long long term,
- bool dryRun,
- OpTime lastDurableOpTime,
- const stdx::function<void()>& onCompletion = stdx::function<void()>());
+ StatusWith<ReplicationExecutor::EventHandle> start(ReplicationExecutor* executor,
+ const ReplicaSetConfig& rsConfig,
+ long long candidateIndex,
+ long long term,
+ bool dryRun,
+ OpTime lastDurableOpTime);
/**
- * Informs the VoteRequester to cancel further processing. The "executor"
- * argument must point to the same executor passed to "start()".
- *
- * Like start(), this method must run in the executor context.
+ * Informs the VoteRequester to cancel further processing.
*/
- void cancel(ReplicationExecutor* executor);
+ void cancel();
Result getResult() const;
unordered_set<HostAndPort> getResponders() const;