diff options
author | Spencer T Brody <spencer@mongodb.com> | 2016-12-15 18:07:51 -0500 |
---|---|---|
committer | Spencer T Brody <spencer@mongodb.com> | 2017-01-04 16:00:25 -0500 |
commit | 87f49488f1b5c872daa71fd2fd9b5d744409a817 (patch) | |
tree | 38f4d3eaf16f933c9cfc184501f6e0068be807f1 /jstests/replsets/write_concern_after_stepdown_and_stepup.js | |
parent | a59962fab548e695f2e0efa2f261381cba771551 (diff) | |
download | mongo-87f49488f1b5c872daa71fd2fd9b5d744409a817.tar.gz |
SERVER-27123 Only update the commit point as a secondary from oplog queries against your sync source
Diffstat (limited to 'jstests/replsets/write_concern_after_stepdown_and_stepup.js')
-rw-r--r-- | jstests/replsets/write_concern_after_stepdown_and_stepup.js | 21 |
1 files changed, 5 insertions, 16 deletions
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]); |