From 87f49488f1b5c872daa71fd2fd9b5d744409a817 Mon Sep 17 00:00:00 2001 From: Spencer T Brody Date: Thu, 15 Dec 2016 18:07:51 -0500 Subject: SERVER-27123 Only update the commit point as a secondary from oplog queries against your sync source --- .../write_concern_after_stepdown_and_stepup.js | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'jstests/replsets/write_concern_after_stepdown_and_stepup.js') diff --git a/jstests/replsets/write_concern_after_stepdown_and_stepup.js b/jstests/replsets/write_concern_after_stepdown_and_stepup.js index a5a0f0b6d64..e2667d4f66a 100644 --- a/jstests/replsets/write_concern_after_stepdown_and_stepup.js +++ b/jstests/replsets/write_concern_after_stepdown_and_stepup.js @@ -6,6 +6,9 @@ (function() { 'use strict'; + load("jstests/replsets/rslib.js"); + load("jstests/libs/write_concern_util.js"); + var name = "writeConcernStepDownAndBackUp"; var dbName = "wMajorityCheck"; var collName = "stepdownAndBackUp"; @@ -22,14 +25,6 @@ var nodes = rst.startSet(); rst.initiate(); - function waitForState(node, state) { - assert.soonNoExcept(function() { - assert.commandWorked(node.adminCommand( - {replSetTest: 1, waitForMemberState: state, timeoutMillis: rst.kDefaultTimeoutMS})); - return true; - }); - } - function waitForPrimary(node) { assert.soon(function() { return node.adminCommand('ismaster').ismaster; @@ -56,10 +51,7 @@ {a: 1}, {writeConcern: {w: 3, wtimeout: rst.kDefaultTimeoutMS}})); // Stop the secondaries from replicating. - secondaries.forEach(function(node) { - assert.commandWorked( - node.adminCommand({configureFailPoint: 'stopOplogFetcher', mode: 'alwaysOn'})); - }); + stopServerReplication(secondaries); // Stop the primary from calling into awaitReplication() assert.commandWorked(nodes[0].adminCommand( {configureFailPoint: 'hangBeforeWaitingForWriteConcern', mode: 'alwaysOn'})); @@ -86,10 +78,7 @@ jsTest.log("Wait for a new primary to be elected"); // Allow the secondaries to replicate again. - secondaries.forEach(function(node) { - assert.commandWorked( - node.adminCommand({configureFailPoint: 'stopOplogFetcher', mode: 'off'})); - }); + restartServerReplication(secondaries); waitForPrimary(nodes[1]); -- cgit v1.2.1