diff options
author | Matthew Saltz <matthew.saltz@mongodb.com> | 2019-10-21 19:21:43 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-10-21 19:21:43 +0000 |
commit | cc18a6c1b7c833879557ed110bc300b95e1e9292 (patch) | |
tree | 74876a63b16a1f7fc5cb29fc70aadb13d7b1965a | |
parent | d7c96ec405d6fc319f32dabd9b4136d0c29bc99b (diff) | |
download | mongo-cc18a6c1b7c833879557ed110bc300b95e1e9292.tar.gz |
SERVER-42769 Add call to awaitLastOpCommitted after enableAutoSplit in ShardingTestr4.2.0
(cherry picked from commit 1bab7ef943e45caeecbc5aafbca9b5147dbdddb2)
-rw-r--r-- | src/mongo/shell/shardingtest.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/shell/shardingtest.js b/src/mongo/shell/shardingtest.js index 8f33e5445ae..2e5a10c3062 100644 --- a/src/mongo/shell/shardingtest.js +++ b/src/mongo/shell/shardingtest.js @@ -1571,6 +1571,11 @@ var ShardingTest = function(params) { authutil.asCluster(this._mongos, mongosOptions[0].keyFile, _configureCluster); } else { _configureCluster(); + // Ensure that all config server nodes are up to date with any changes made to balancer + // settings before adding shards to the cluster. This prevents shards, which read + // config.settings with readPreference 'nearest', from accidentally fetching stale values + // from secondaries that aren't up-to-date. + this.configRS.awaitLastOpCommitted(); } try { |