From 469814c1c12cbe1f7f511c5d7c952b909378a3c0 Mon Sep 17 00:00:00 2001 From: Benety Goh Date: Thu, 15 Oct 2015 18:37:15 -0400 Subject: SERVER-20964 use failpoint instead of bridging to prevent secondary from catching with primary during step down --- jstests/replsets/stepdown_killop.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'jstests/replsets') diff --git a/jstests/replsets/stepdown_killop.js b/jstests/replsets/stepdown_killop.js index 8e958fdb1e9..b3b09388808 100644 --- a/jstests/replsets/stepdown_killop.js +++ b/jstests/replsets/stepdown_killop.js @@ -1,6 +1,6 @@ // Ensure stepDown operations that are waiting for replication can be interrupted with killOp() // 1. Start up a 3 node set (1 arbiter). -// 2. Isolate the SECONDARY. +// 2. Stop replication on the SECONDARY using a fail point. // 3. Do one write and then spin up a second shell which asks the PRIMARY to StepDown. // 4. Once StepDown has begun, spin up a third shell which will attempt to do writes, which should // block waiting for stepDown to release its lock, which it never will do because no secondaries @@ -20,12 +20,18 @@ {"_id" : 1, "host" : nodes[1]}, {"_id" : 2, "host" : nodes[2], "arbiterOnly" : true}]}); - jsTestLog("Isolating primary"); - replSet.bridge(); - replSet.partition(1,0); - replSet.partition(1,2); + replSet.waitForState(replSet.nodes[0], replSet.PRIMARY, 60 * 1000); - replSet.waitForState(replSet.nodes[0], replSet.PRIMARY, 60 * 1000); + var secondary = replSet.getSecondary(); + jsTestLog('Disable replication on the SECONDARY ' + secondary.host); + assert.commandWorked( + secondary.getDB('admin').runCommand( + {configureFailPoint: 'rsSyncApplyStop', mode: 'alwaysOn'} + ), + 'Failed to configure rsSyncApplyStop failpoint.' + ); + + replSet.waitForState(replSet.nodes[0], replSet.PRIMARY, 60 * 1000); var primary = replSet.getPrimary(); assert.eq(primary.host, nodes[0], "primary assumed to be node 0"); -- cgit v1.2.1