From 4e682143bca253a840f07604c0d7c522d48b5c29 Mon Sep 17 00:00:00 2001 From: Esha Maharishi Date: Thu, 11 Aug 2016 21:37:26 -0400 Subject: Revert "SERVER-25507 use node's existing options if restart flag passed to ReplSetTest's start()" This reverts commit c31b1f07582a39a910de14aa9c72b4a9b1bbe10e. --- jstests/replsets/auth1.js | 2 +- src/mongo/shell/replsettest.js | 17 +++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/jstests/replsets/auth1.js b/jstests/replsets/auth1.js index 23054b9c38d..d6ced2108f4 100644 --- a/jstests/replsets/auth1.js +++ b/jstests/replsets/auth1.js @@ -52,7 +52,7 @@ load("jstests/replsets/rslib.js"); print("start up rs"); var rs = new ReplSetTest({"name": name, "nodes": 3}); print("restart 0 with keyFile"); - m = rs.start(0, {"keyFile": key1_600, noCleanData: true}); + m = rs.restart(0, {"keyFile": key1_600}); print("restart 1 with keyFile"); rs.start(1, {"keyFile": key1_600}); print("restart 2 with keyFile"); diff --git a/src/mongo/shell/replsettest.js b/src/mongo/shell/replsettest.js index 5634ba016a8..de35e14d9dd 100644 --- a/src/mongo/shell/replsettest.js +++ b/src/mongo/shell/replsettest.js @@ -914,16 +914,12 @@ var ReplSetTest = function(opts) { options.binVersion = MongoRunner.versionIterator(options.binVersion); } - // If restarting a node, use its existing options as the defaults. - options.restart = options.restart || restart; - if (options.restart) { - options = Object.merge(this.nodes[n].fullOptions, options); - } else { - options = Object.merge(defaults, options); - } + options = Object.merge(defaults, options); options = Object.merge(options, this.nodeOptions["n" + n]); delete options.rsConfig; + options.restart = options.restart || restart; + var pathOpts = {node: n, set: this.name}; options.pathOpts = Object.merge(options.pathOpts || {}, pathOpts); @@ -987,16 +983,13 @@ var ReplSetTest = function(opts) { }; /** - * Restarts a db without clearing the data directory by default, and using the node(s)'s - * original startup options by default. + * Restarts a db without clearing the data directory by default. If the server is not + * stopped first, this function will not work. * * Option { startClean : true } forces clearing the data directory. * Option { auth : Object } object that contains the auth details for admin credentials. * Should contain the fields 'user' and 'pwd' * - * In order not to use the original startup options, use stop() (or stopSet()) followed by - * start() (or startSet()) without passing restart: true as part of the options. - * * @param {int|conn|[int|conn]} n array or single server number (0, 1, 2, ...) or conn */ this.restart = function(n, options, signal, wait) { -- cgit v1.2.1