summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/shell/shardingtest.js5
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 {