diff options
author | Spencer T Brody <spencer@mongodb.com> | 2016-04-25 15:34:43 -0400 |
---|---|---|
committer | Dianna Hohensee <dianna.hohensee@10gen.com> | 2017-03-16 12:54:23 -0400 |
commit | c783668b896fbadff1a2f799bd150409794847d1 (patch) | |
tree | 7a13195f1f761cc6d8d78c966a567fe916753f1c /jstests | |
parent | 98d8e76dfaf4bbc6afadd38fa7b2c5141301528c (diff) | |
download | mongo-c783668b896fbadff1a2f799bd150409794847d1.tar.gz |
SERVER-23915 Make split_stale_mongos.js wait for split to propagate to all config servers
(cherry picked from commit d30ab0aa759d75cabc0a88ea5f2fd2b9c1a6c9a8)
SERVER-23915 Make move_stale_mongos.js wait for split and move to propagate to all config servers
(cherry picked from commit a8ebe7c54cde9b2f8effe055df29e6bbc8be663d)
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/sharding/move_stale_mongos.js | 6 | ||||
-rw-r--r-- | jstests/sharding/split_stale_mongos.js | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/jstests/sharding/move_stale_mongos.js b/jstests/sharding/move_stale_mongos.js index 44dd7a7649f..6961d8c3aee 100644 --- a/jstests/sharding/move_stale_mongos.js +++ b/jstests/sharding/move_stale_mongos.js @@ -15,10 +15,16 @@ var curShardIndex = 0; for (var i = 0; i < 100; i += 10) { assert.commandWorked(st.s0.getDB('admin').runCommand({split: testNs, middle: {_id: i}})); + if (st.configRS) { + st.configRS.awaitLastOpCommitted(); // Ensure that other mongos sees the split + } var nextShardIndex = (curShardIndex + 1) % shards.length; assert.commandWorked(st.s1.getDB('admin').runCommand( {moveChunk: testNs, find: {_id: i + 5}, to: shards[nextShardIndex]})); curShardIndex = nextShardIndex; + if (st.configRS) { + st.configRS.awaitLastOpCommitted(); // Ensure that other mongos sees the move + } } st.stop(); diff --git a/jstests/sharding/split_stale_mongos.js b/jstests/sharding/split_stale_mongos.js index e40112f0cd0..2a2a9b50cc8 100644 --- a/jstests/sharding/split_stale_mongos.js +++ b/jstests/sharding/split_stale_mongos.js @@ -12,7 +12,13 @@ assert.commandWorked(admin.runCommand({shardCollection: testNs, key: {_id: 1}})) for (var i = 0; i < 100; i += 10) { assert.commandWorked(st.s0.getDB('admin').runCommand({split: testNs, middle: {_id: i}})); + if (st.configRS) { + st.configRS.awaitLastOpCommitted(); // Ensure that other mongos sees the previous split + } assert.commandWorked(st.s1.getDB('admin').runCommand({split: testNs, middle: {_id: i + 5}})); + if (st.configRS) { + st.configRS.awaitLastOpCommitted(); // Ensure that other mongos sees the previous split + } } -st.stop();
\ No newline at end of file +st.stop(); |