From ae83937130d1abc097e2694de97bf9ea59ed2f32 Mon Sep 17 00:00:00 2001 From: Spencer T Brody Date: Tue, 22 Dec 2015 17:06:40 -0500 Subject: [PATCH] SERVER-21996 Wait for replication to all nodes before shutting down config server primary in test --- .../replset_config/autodiscover_config_rs_from_secondary.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jstests/sharding/replset_config/autodiscover_config_rs_from_secondary.js b/jstests/sharding/replset_config/autodiscover_config_rs_from_secondary.js index eb26f0f11ba..d0c4e84d8bd 100644 --- a/jstests/sharding/replset_config/autodiscover_config_rs_from_secondary.js +++ b/jstests/sharding/replset_config/autodiscover_config_rs_from_secondary.js @@ -25,6 +25,10 @@ var seedList = rst.name + "/" + rst.nodes[1].host; // node 1 is guaranteed to no MongoRunner.stopMongos(mongos); } +// Wait for replication to all config server replica set members to ensure that mongos +// doesn't read from a stale config server when trying to verify if the initial cluster metadata +// has been properly written. +rst.awaitReplication(); // Now take down the one electable node rst.stop(0); rst.awaitNoPrimary();