summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Wahlin <james.wahlin@mongodb.com>2019-10-02 14:31:52 +0000
committerevergreen <evergreen@mongodb.com>2019-10-02 14:31:52 +0000
commitc86a9f91a901dc7ea3357a3caab9ec4448856bad (patch)
tree50b946d6421bce6f02f37047a255e06a8b704fb2
parente7f454160f26b31eefd0af16cfb383110cfc17b8 (diff)
downloadmongo-c86a9f91a901dc7ea3357a3caab9ec4448856bad.tar.gz
Revert "SERVER-40335 Add waitForStepDownOnNonCommandShutdown parameter"
This reverts commit 36ea8ab7ef05b9dedb133987d825a8b39cdcbfdd.
-rw-r--r--buildscripts/resmokelib/core/programs.py5
-rw-r--r--src/mongo/db/db.cpp9
-rw-r--r--src/mongo/shell/replsettest.js18
3 files changed, 1 insertions, 31 deletions
diff --git a/buildscripts/resmokelib/core/programs.py b/buildscripts/resmokelib/core/programs.py
index ba3c05ab1e7..36ca08ce309 100644
--- a/buildscripts/resmokelib/core/programs.py
+++ b/buildscripts/resmokelib/core/programs.py
@@ -77,11 +77,6 @@ def mongod_program(logger, executable=None, process_kwargs=None, **kwargs):
if "replSet" in kwargs and "writePeriodicNoops" not in suite_set_parameters:
suite_set_parameters["writePeriodicNoops"] = False
- # By default the primary waits up to 10 sec to complete a stepdown and to hand off its duties to
- # a secondary before shutting down in response to SIGTERM. Make it shut down more abruptly.
- if "replSet" in kwargs and "waitForStepDownOnNonCommandShutdown" not in suite_set_parameters:
- suite_set_parameters["waitForStepDownOnNonCommandShutdown"] = False
-
_apply_set_parameters(args, suite_set_parameters)
shortcut_opts = {
diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp
index 54b5c8fabfa..8c3d00618f3 100644
--- a/src/mongo/db/db.cpp
+++ b/src/mongo/db/db.cpp
@@ -286,8 +286,6 @@ Status restoreMissingFeatureCompatibilityVersionDocument(OperationContext* opCtx
const NamespaceString startupLogCollectionName("local.startup_log");
const NamespaceString kSystemReplSetCollection("local.system.replset");
-MONGO_EXPORT_SERVER_PARAMETER(waitForStepDownOnNonCommandShutdown, bool, true);
-
#ifdef _WIN32
const ntservice::NtServiceDefaultStrings defaultServiceStrings = {
L"MongoDB", L"MongoDB", L"MongoDB Server"};
@@ -1291,13 +1289,8 @@ void shutdownTask(const ShutdownTaskArgs& shutdownArgs) {
}
try {
- // For faster tests, we allow a short wait time with setParameter.
- auto waitTime = waitForStepDownOnNonCommandShutdown.load()
- ? Milliseconds(Seconds(10))
- : Milliseconds(100);
-
uassertStatusOK(
- replCoord->stepDown(opCtx, false /* force */, waitTime, Seconds(120)));
+ replCoord->stepDown(opCtx, false /* force */, Seconds(10), Seconds(120)));
} catch (const ExceptionFor<ErrorCodes::NotMaster>&) {
// ignore not master errors
} catch (const DBException& e) {
diff --git a/src/mongo/shell/replsettest.js b/src/mongo/shell/replsettest.js
index e8ad31580a0..116dca90c56 100644
--- a/src/mongo/shell/replsettest.js
+++ b/src/mongo/shell/replsettest.js
@@ -2082,24 +2082,6 @@ var ReplSetTest = function(opts) {
}
}
- // Make shutdown faster in tests, especially when election handoff has no viable candidate.
- // Ignore errors from setParameter, perhaps mongod is too old for this parameter.
- if (_callIsMaster()) {
- asCluster(this._liveNodes, () => {
- for (let node of this._liveNodes) {
- try {
- assert.commandWorked(node.adminCommand({
- setParameter: 1,
- waitForStepDownOnNonCommandShutdown: false,
- }));
- } catch (e) {
- print("Error in setParameter for waitForStepDownOnNonCommandShutdown:");
- print(e);
- }
- }
- });
- }
-
for (var i = 0; i < this.ports.length; i++) {
this.stop(i, signal, opts);
}