summaryrefslogtreecommitdiff
path: root/jstests/sharding/rename_across_mongos.js
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@mongodb.com>2015-10-06 15:01:57 -0400
committerSpencer T Brody <spencer@mongodb.com>2015-10-06 16:41:27 -0400
commit6a462c52e99509c114fc14b5f3e089bd37a486f9 (patch)
tree53c49542464f72d51ceba832305179b047488086 /jstests/sharding/rename_across_mongos.js
parent7f62960716b37662070ba6fada747c60f5968c09 (diff)
downloadmongo-6a462c52e99509c114fc14b5f3e089bd37a486f9.tar.gz
SERVER-20690 Test with multiple mongos can fail because one of them talked to a stale secondary
Diffstat (limited to 'jstests/sharding/rename_across_mongos.js')
-rw-r--r--jstests/sharding/rename_across_mongos.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/jstests/sharding/rename_across_mongos.js b/jstests/sharding/rename_across_mongos.js
index 71ab514e3d0..5d5dc1fcaf8 100644
--- a/jstests/sharding/rename_across_mongos.js
+++ b/jstests/sharding/rename_across_mongos.js
@@ -12,6 +12,12 @@ st.s1.getDB(dbName).dropDatabase();
assert.commandWorked(st.s0.getDB(dbName).runCommand({ create: 'CollNameBeforeRename' }));
assert.writeOK(st.s0.getDB(dbName).CollNameBeforeRename.insert({ Key: 1, Value: 1 }));
+if (st.configRS) {
+ // Ensure that the second mongos will see the newly created database metadata when
+ // it tries to do the collection rename.
+ st.configRS.awaitLastOpCommitted();
+}
+
// Rename collection on second mongos and ensure the document is found
assert.commandWorked(
st.s1.getDB(dbName).CollNameBeforeRename.renameCollection('CollNameAfterRename'));