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_test.cpp | |
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_test.cpp')
-rw-r--r-- | src/mongo/db/repl/check_quorum_for_config_change_test.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mongo/db/repl/check_quorum_for_config_change_test.cpp b/src/mongo/db/repl/check_quorum_for_config_change_test.cpp index cdf5e7fda84..696e66764e3 100644 --- a/src/mongo/db/repl/check_quorum_for_config_change_test.cpp +++ b/src/mongo/db/repl/check_quorum_for_config_change_test.cpp @@ -34,7 +34,7 @@ #include "mongo/db/jsobj.h" #include "mongo/db/repl/check_quorum_for_config_change.h" #include "mongo/db/repl/repl_set_config.h" -#include "mongo/db/repl/repl_set_heartbeat_args.h" +#include "mongo/db/repl/repl_set_heartbeat_args_v1.h" #include "mongo/db/repl/repl_set_heartbeat_response.h" #include "mongo/executor/network_interface_mock.h" #include "mongo/executor/thread_pool_task_executor_test_fixture.h" @@ -120,14 +120,14 @@ void CheckQuorumTest::_runQuorumCheck(const ReplSetConfig& config, int myIndex) class CheckQuorumForInitiate : public CheckQuorumTest { private: virtual Status _runQuorumCheckImpl(const ReplSetConfig& config, int myIndex) { - return checkQuorumForInitiate(&getExecutor(), config, myIndex); + return checkQuorumForInitiate(&getExecutor(), config, myIndex, 0); } }; class CheckQuorumForReconfig : public CheckQuorumTest { protected: virtual Status _runQuorumCheckImpl(const ReplSetConfig& config, int myIndex) { - return checkQuorumForReconfig(&getExecutor(), config, myIndex); + return checkQuorumForReconfig(&getExecutor(), config, myIndex, 0); } }; @@ -207,13 +207,15 @@ TEST_F(CheckQuorumForInitiate, QuorumCheckFailedDueToSeveralDownNodes) { const BSONObj makeHeartbeatRequest(const ReplSetConfig& rsConfig, int myConfigIndex) { const MemberConfig& myConfig = rsConfig.getMemberAt(myConfigIndex); - ReplSetHeartbeatArgs hbArgs; + ReplSetHeartbeatArgsV1 hbArgs; hbArgs.setSetName(rsConfig.getReplSetName()); - hbArgs.setProtocolVersion(1); hbArgs.setConfigVersion(rsConfig.getConfigVersion()); - hbArgs.setCheckEmpty(rsConfig.getConfigVersion() == 1); + if (rsConfig.getConfigVersion() == 1) { + hbArgs.setCheckEmpty(); + } hbArgs.setSenderHost(myConfig.getHostAndPort()); hbArgs.setSenderId(myConfig.getId()); + hbArgs.setTerm(0); return hbArgs.toBSON(); } |