diff options
author | Benety Goh <benety@mongodb.com> | 2020-01-19 07:05:19 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-01-19 12:50:44 +0000 |
commit | 8f1a363b05c25b0887c46fc49569977f3e876e35 (patch) | |
tree | fa0f6dd51d440a404549c8762806b3d62c45470f /src/mongo/db/commands/shutdown_d.cpp | |
parent | e9f4b9da40f5a24d220121d879b521d631a06159 (diff) | |
download | mongo-8f1a363b05c25b0887c46fc49569977f3e876e35.tar.gz |
SERVER-43988 shutdown with {force: false} lists active index builds
Diffstat (limited to 'src/mongo/db/commands/shutdown_d.cpp')
-rw-r--r-- | src/mongo/db/commands/shutdown_d.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/commands/shutdown_d.cpp b/src/mongo/db/commands/shutdown_d.cpp index b6d8154c999..67e5572125d 100644 --- a/src/mongo/db/commands/shutdown_d.cpp +++ b/src/mongo/db/commands/shutdown_d.cpp @@ -34,7 +34,9 @@ #include <string> #include "mongo/db/commands/shutdown.h" +#include "mongo/db/index_builds_coordinator.h" #include "mongo/db/repl/replication_coordinator.h" +#include "mongo/util/log.h" namespace mongo { namespace { @@ -61,6 +63,13 @@ public: timeoutSecs = cmdObj["timeoutSecs"].numberLong(); } + if (!force) { + auto indexBuildsCoord = IndexBuildsCoordinator::get(opCtx); + auto numIndexBuilds = indexBuildsCoord->getActiveIndexBuildCount(opCtx); + log() << "Index builds in progress while processing shutdown command: " + << numIndexBuilds; + } + try { repl::ReplicationCoordinator::get(opCtx)->stepDown( opCtx, force, Seconds(timeoutSecs), Seconds(120)); |