diff options
-rw-r--r-- | jstests/libs/write_concern_util.js | 6 | ||||
-rw-r--r-- | jstests/replsets/shutdown_primary.js | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/jstests/libs/write_concern_util.js b/jstests/libs/write_concern_util.js index 476a9c3e818..bfbd3b024a0 100644 --- a/jstests/libs/write_concern_util.js +++ b/jstests/libs/write_concern_util.js @@ -33,6 +33,12 @@ function restartReplSetReplication(rs) { rs.nodes.forEach(restartServerReplication); } +// Restarts replication at all replicaset secondaries. +function restartReplicationOnSecondaries(rs) { + var secondaries = rs.getSecondaries(); + secondaries.forEach(restartServerReplication); +} + // Restarts replication at all nodes in a sharded cluster. function restartReplicationOnAllShards(st) { st._rsObjects.forEach(restartReplSetReplication); diff --git a/jstests/replsets/shutdown_primary.js b/jstests/replsets/shutdown_primary.js index 2299900e21c..66d429dec89 100644 --- a/jstests/replsets/shutdown_primary.js +++ b/jstests/replsets/shutdown_primary.js @@ -13,7 +13,7 @@ */ (function() { load("jstests/libs/write_concern_util.js"); // for stopReplicationOnSecondaries, - // restartReplSetReplication + // restartReplicationOnSecondaries "use strict"; @@ -48,7 +48,7 @@ }, primary.port); jsTestLog("Resuming replication."); - restartReplSetReplication(replTest); + restartReplicationOnSecondaries(replTest); jsTestLog("Verifying primary shut down and cannot be connected to."); // Successfully starting shutdown throws a network error. |