summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJudah Schvimer <judah@mongodb.com>2017-01-17 13:19:01 -0500
committerJudah Schvimer <judah@mongodb.com>2017-01-19 17:37:14 -0500
commit153d6473f705afbd18e151c437f91b5fbc733370 (patch)
treea124c02868dd488a62e9351d789c9b990617682e
parent12ae6869bef461d9604d667df726825bcaa35e32 (diff)
downloadmongo-153d6473f705afbd18e151c437f91b5fbc733370.tar.gz
SERVER-27365 ensure node 2 is not primary during reconfig in reconfig_without_increased_queues.js
(cherry picked from commit 686069d0fbde93c1bf8b2fe15fad001e98dcc25d)
-rw-r--r--jstests/replsets/reconfig_without_increased_queues.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/jstests/replsets/reconfig_without_increased_queues.js b/jstests/replsets/reconfig_without_increased_queues.js
index 8b71817166d..39ef7a7e60c 100644
--- a/jstests/replsets/reconfig_without_increased_queues.js
+++ b/jstests/replsets/reconfig_without_increased_queues.js
@@ -69,6 +69,16 @@
replTest.awaitSecondaryNodes();
+ // We cannot reconfig nodes[2] to have priority 0 if it is currently the primary. After the
+ // first reconfig, it will be unelectable so this only needs to be done once.
+ if (replTest.getPrimary() === replTest.nodes[2]) {
+ jsTestLog("Stepping down node 2 before reconfig");
+ assert.throws(function() {
+ replTest.nodes[2].adminCommand({replSetStepDown: 5, force: true});
+ });
+ replTest.waitForState(replTest.nodes[2], ReplSetTest.State.SECONDARY);
+ }
+
// ** Setup different priorities
var c = replTest.getReplSetConfigFromNode();
c.members[0].priority = 99;