diff options
author | Judah Schvimer <judah@mongodb.com> | 2017-09-26 13:54:59 -0400 |
---|---|---|
committer | Judah Schvimer <judah@mongodb.com> | 2017-09-26 13:54:59 -0400 |
commit | e90f530a1f03490743bb66481e0011c72adaab53 (patch) | |
tree | 5f6bb8655a3066868d71205f51034230287ee049 /src/mongo/db/repl/check_quorum_for_config_change.h | |
parent | 726e5544108d7ef417de351d103f52c028feae3b (diff) | |
download | mongo-e90f530a1f03490743bb66481e0011c72adaab53.tar.gz |
SERVER-28794 Only use PV0 style heartbeats when choosing to use PV0
Diffstat (limited to 'src/mongo/db/repl/check_quorum_for_config_change.h')
-rw-r--r-- | src/mongo/db/repl/check_quorum_for_config_change.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mongo/db/repl/check_quorum_for_config_change.h b/src/mongo/db/repl/check_quorum_for_config_change.h index 2bc9a289464..60918c76587 100644 --- a/src/mongo/db/repl/check_quorum_for_config_change.h +++ b/src/mongo/db/repl/check_quorum_for_config_change.h @@ -57,7 +57,7 @@ public: * * "rsConfig" must stay in scope until QuorumChecker's destructor completes. */ - QuorumChecker(const ReplSetConfig* rsConfig, int myIndex); + QuorumChecker(const ReplSetConfig* rsConfig, int myIndex, long long term); virtual ~QuorumChecker(); virtual std::vector<executor::RemoteCommandRequest> getRequests() const; @@ -91,6 +91,9 @@ private: // Index of the local node's member configuration in _rsConfig. const int _myIndex; + // The term of this node. + const long long _term; + // List of voting nodes that have responded affirmatively. std::vector<HostAndPort> _voters; @@ -118,6 +121,7 @@ private: * * "myIndex" is the index of this node's member configuration in "rsConfig". * "executor" is the event loop in which to schedule network/aysnchronous processing. + * "term" is the term of this node. * * For purposes of initiate, a quorum is only met if all of the following conditions * are met: @@ -128,7 +132,8 @@ private: */ Status checkQuorumForInitiate(executor::TaskExecutor* executor, const ReplSetConfig& rsConfig, - const int myIndex); + const int myIndex, + long long term); /** * Performs a quorum call to determine if a sufficient number of nodes are up @@ -136,6 +141,7 @@ Status checkQuorumForInitiate(executor::TaskExecutor* executor, * * "myIndex" is the index of this node's member configuration in "rsConfig". * "executor" is the event loop in which to schedule network/aysnchronous processing. + * "term" is the term of this node. * * For purposes of reconfig, a quorum is only met if all of the following conditions * are met: @@ -146,7 +152,8 @@ Status checkQuorumForInitiate(executor::TaskExecutor* executor, */ Status checkQuorumForReconfig(executor::TaskExecutor* executor, const ReplSetConfig& rsConfig, - const int myIndex); + const int myIndex, + long long term); } // namespace repl } // namespace mongo |