summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2018-09-10 17:36:00 +0100
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2018-11-21 03:21:52 -0500
commit4b62e25620105acde57567dcd5d44ef873ff2c3e (patch)
tree26177d972f8788305dfa1aed2729fc4fc43bd400
parent072f6a59fe9ae19b77507a550c50b973ef3124d2 (diff)
downloadmongo-4b62e25620105acde57567dcd5d44ef873ff2c3e.tar.gz
SERVER-36965 Wait for replication on all 'setUp' writes performed by the safe_secondary_reads* tests
(cherry picked from commit 626567bcde38521d76834db0c59e1aee62344b69) (cherry picked from commit 307fb959416370df29fe6e4c64b5ca44de262c2e)
-rw-r--r--jstests/sharding/safe_secondary_reads_drop_recreate.js5
-rw-r--r--jstests/sharding/safe_secondary_reads_single_migration_suspend_range_deletion.js5
-rw-r--r--jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js5
3 files changed, 15 insertions, 0 deletions
diff --git a/jstests/sharding/safe_secondary_reads_drop_recreate.js b/jstests/sharding/safe_secondary_reads_drop_recreate.js
index ca28861c2ac..1d8e98cd085 100644
--- a/jstests/sharding/safe_secondary_reads_drop_recreate.js
+++ b/jstests/sharding/safe_secondary_reads_drop_recreate.js
@@ -650,6 +650,11 @@
// Do any test-specific setup.
test.setUp(staleMongos);
+ // Wait for replication as a safety net, in case the individual setup function for a
+ // test case did not specify writeConcern itself
+ st.rs0.awaitReplication();
+ st.rs1.awaitReplication();
+
// Do dummy read from the stale mongos so it loads the routing table into memory once.
// Additionally, do a secondary read to ensure that the secondary has loaded the initial
// routing table -- the first read to the primary will refresh the mongos' shardVersion,
diff --git a/jstests/sharding/safe_secondary_reads_single_migration_suspend_range_deletion.js b/jstests/sharding/safe_secondary_reads_single_migration_suspend_range_deletion.js
index db804ad271b..36fd90bf9d2 100644
--- a/jstests/sharding/safe_secondary_reads_single_migration_suspend_range_deletion.js
+++ b/jstests/sharding/safe_secondary_reads_single_migration_suspend_range_deletion.js
@@ -444,6 +444,11 @@
// Do any test-specific setup.
test.setUp(staleMongos);
+ // Wait for replication as a safety net, in case the individual setup function for a test
+ // case did not specify writeConcern itself
+ st.rs0.awaitReplication();
+ st.rs1.awaitReplication();
+
assert.commandWorked(recipientShardPrimary.getDB(db).setProfilingLevel(2));
assert.commandWorked(donorShardSecondary.getDB(db).setProfilingLevel(2));
assert.commandWorked(recipientShardSecondary.getDB(db).setProfilingLevel(2));
diff --git a/jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js b/jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js
index 6013a8cbeb9..cb5f2e441e3 100644
--- a/jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js
+++ b/jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js
@@ -404,6 +404,11 @@
// Do any test-specific setup.
test.setUp(staleMongos);
+ // Wait for replication as a safety net, in case the individual setup function for a test
+ // case did not specify writeConcern itself
+ st.rs0.awaitReplication();
+ st.rs1.awaitReplication();
+
assert.commandWorked(recipientShardPrimary.getDB(db).setProfilingLevel(2));
assert.commandWorked(donorShardSecondary.getDB(db).setProfilingLevel(2));
assert.commandWorked(recipientShardSecondary.getDB(db).setProfilingLevel(2));