summaryrefslogtreecommitdiff
path: root/jstests/sharding
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-16 07:31:54 -0500
commit307fb959416370df29fe6e4c64b5ca44de262c2e (patch)
treeda78cbfe8c400066ef2bea99cbe4a32fdb70810d /jstests/sharding
parentc1b649fb7913c68e1947bf751d8c271ebc97dca5 (diff)
downloadmongo-307fb959416370df29fe6e4c64b5ca44de262c2e.tar.gz
SERVER-36965 Wait for replication on all 'setUp' writes performed by the safe_secondary_reads* tests
(cherry picked from commit 626567bcde38521d76834db0c59e1aee62344b69)
Diffstat (limited to 'jstests/sharding')
-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 2ea33c753ea..9024d479d9f 100644
--- a/jstests/sharding/safe_secondary_reads_drop_recreate.js
+++ b/jstests/sharding/safe_secondary_reads_drop_recreate.js
@@ -598,6 +598,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 3e49d6a14f1..a96831be95f 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
@@ -435,6 +435,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 cf4ad89ff97..dda3c35e981 100644
--- a/jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js
+++ b/jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js
@@ -391,6 +391,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));