diff options
author | Tess Avitabile <tess.avitabile@mongodb.com> | 2020-05-07 11:55:41 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-05-11 13:47:40 +0000 |
commit | 42acb126b4609f20c559d80debd0e9d2db9cff44 (patch) | |
tree | e45d4a04c584224db052ececfa31d187b302a12e /src/mongo/db/commands/shutdown_d.cpp | |
parent | c5f84d128c27f0f603afeffb6717ee823d57606d (diff) | |
download | mongo-42acb126b4609f20c559d80debd0e9d2db9cff44.tar.gz |
SERVER-35443 Update help text for shutdown commands and increase freeze time
Diffstat (limited to 'src/mongo/db/commands/shutdown_d.cpp')
-rw-r--r-- | src/mongo/db/commands/shutdown_d.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/mongo/db/commands/shutdown_d.cpp b/src/mongo/db/commands/shutdown_d.cpp index 35f3a706e05..ac5b5bf6f4a 100644 --- a/src/mongo/db/commands/shutdown_d.cpp +++ b/src/mongo/db/commands/shutdown_d.cpp @@ -53,7 +53,9 @@ Status stepDownForShutdown(OperationContext* opCtx, // for any secondaries. Ignore stepdown. if (replCoord->getConfig().getNumMembers() != 1) { try { - replCoord->stepDown(opCtx, false /* force */, waitTime, Seconds(120)); + // Specify a high freeze time, so that if there is a stall during shut down, the node + // does not run for election. + replCoord->stepDown(opCtx, false /* force */, waitTime, Days(1)); if (MONGO_unlikely(hangInShutdownAfterStepdown.shouldFail())) { LOGV2(4695100, "hangInShutdownAfterStepdown failpoint enabled"); @@ -81,12 +83,14 @@ namespace { class CmdShutdownMongoD : public CmdShutdown<CmdShutdownMongoD> { public: std::string help() const override { - return "shutdown the database. must be ran against admin db and " - "either (1) ran from localhost or (2) authenticated. If " - "this is a primary in a replica set and there is no member " - "within 10 seconds of its optime, it will not shutdown " - "without force : true. You can also specify timeoutSecs : " - "N to wait N seconds for other members to catch up."; + return "Shuts down the database. Must be run against the admin database and either (1) run " + "from localhost or (2) run while authenticated with the shutdown privilege. If the " + "node is the primary of a replica set, waits up to 'timeoutSecs' for an electable " + "node to be caught up before stepping down. If 'force' is false and no electable " + "node was able to catch up, does not shut down. If the node is in state SECONDARY " + "after the attempted stepdown, any remaining time in 'timeoutSecs' is used for " + "quiesce mode, where the database continues to allow operations to run, but directs " + "clients to route new operations to other replica set members."; } static void beginShutdown(OperationContext* opCtx, bool force, long long timeoutSecs) { |