summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlake Oler <blake.oler@mongodb.com>2018-08-27 14:43:04 -0400
committerBlake Oler <blake.oler@mongodb.com>2018-08-30 15:18:29 -0400
commitb53b7547a477bacc801268e01e675fc32c394cdd (patch)
tree1dc40776889034bc75a2c6b1499095aa9fda82a7
parent47306b9f203abee01f6fc54aa8d7ab8f8e25c8c9 (diff)
downloadmongo-b53b7547a477bacc801268e01e675fc32c394cdd.tar.gz
SERVER-34757 Await replication before cloning in clone_catalog_data.js test
-rw-r--r--jstests/sharding/clone_catalog_data.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/jstests/sharding/clone_catalog_data.js b/jstests/sharding/clone_catalog_data.js
index dfb5863f69f..e3e278e2fae 100644
--- a/jstests/sharding/clone_catalog_data.js
+++ b/jstests/sharding/clone_catalog_data.js
@@ -59,6 +59,10 @@
collections.sort(sortByName);
var coll2uuid = collections[1].info.uuid;
+ // Await replication on the config server to guarantee the collections database has been
+ // propagated to all config secondaries.
+ st.configRS.awaitReplication();
+
// Have the other shard clone the DB from the primary.
assert.commandWorked(toShard.adminCommand(
{_cloneCatalogData: 'test', from: fromShard.host, writeConcern: {w: "majority"}}));
@@ -139,6 +143,10 @@
checkCount(toShard, 'coll1', 3);
checkCount(toShard, 'coll2', 0);
+ // Await replication on the config server to guarantee the collections database has been
+ // propagated to all config secondaries.
+ st.configRS.awaitReplication();
+
// Check that the command fails without writeConcern majority.
assert.commandFailedWithCode(
toShard.adminCommand({_cloneCatalogData: 'test', from: fromShard.host}),