summaryrefslogtreecommitdiff
path: root/src/mongo/shell
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@mongodb.com>2016-08-15 18:26:49 -0400
committerSpencer T Brody <spencer@mongodb.com>2016-08-22 15:18:59 -0400
commit96d6fcb0c18e7d3e99bce7877714e32ed1313bbf (patch)
tree2e0d1f7ebc2c992b878f537a1b4b5553c93cfb3e /src/mongo/shell
parentffb84c82648c7b4d7d6c500bbcc0df29e017ac5c (diff)
downloadmongo-96d6fcb0c18e7d3e99bce7877714e32ed1313bbf.tar.gz
SERVER-25514 Prevent a v3.4 mongos from being used to add a v3.2 shard
Diffstat (limited to 'src/mongo/shell')
-rw-r--r--src/mongo/shell/shardingtest.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mongo/shell/shardingtest.js b/src/mongo/shell/shardingtest.js
index 6c3a67aeded..a63f2da26e8 100644
--- a/src/mongo/shell/shardingtest.js
+++ b/src/mongo/shell/shardingtest.js
@@ -727,8 +727,10 @@ var ShardingTest = function(params) {
/**
* Stops and restarts a mongos process.
*
- * If opts is specified, the new mongos is started using those options. Otherwise, it is started
- * with its previous parameters.
+ * If 'opts' is not specified, starts the mongos with its previous parameters. If 'opts' is
+ * specified and 'opts.restart' is false or missing, starts mongos with the parameters specified
+ * in 'opts'. If opts is specified and 'opts.restart' is true, merges the previous options
+ * with the options specified in 'opts', with the options in 'opts' taking precedence.
*
* Warning: Overwrites the old s (if n = 0) admin, config, and sn member variables.
*/
@@ -761,6 +763,10 @@ var ShardingTest = function(params) {
this._mongos[n] = new MongoBridge(bridgeOptions);
}
+ if (opts.restart) {
+ opts = Object.merge(mongos.fullOptions, opts);
+ }
+
var newConn = MongoRunner.runMongos(opts);
if (!newConn) {
throw new Error("Failed to restart mongos " + n);