summaryrefslogtreecommitdiff
path: root/src/mongo/db/db.cpp
diff options
context:
space:
mode:
authorCheahuychou Mao <cheahuychou.mao@mongodb.com>2020-06-16 20:27:19 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-06-22 14:07:34 +0000
commit50f5d296f204936e4dd5d716d59ac273039dc4b5 (patch)
treeff6580ee18a1f06b5fb8c306053a24b9b5b52346 /src/mongo/db/db.cpp
parent68874103421db895d5ad8eb54ec03420793d561f (diff)
downloadmongo-50f5d296f204936e4dd5d716d59ac273039dc4b5.tar.gz
SERVER-48229 Shutdown PeriodicShardedIndexConsistencyChecker after ReplicationCoordinator so no thread will try to pause the job after it has stopped
(cherry picked from commit 6083eca15b723f878645de53158c6543769dcdb5)
Diffstat (limited to 'src/mongo/db/db.cpp')
-rw-r--r--src/mongo/db/db.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp
index 4cbafa15ee9..6cf5d39d340 100644
--- a/src/mongo/db/db.cpp
+++ b/src/mongo/db/db.cpp
@@ -950,11 +950,6 @@ void shutdownTask(const ShutdownTaskArgs& shutdownArgs) {
lsc->joinOnShutDown();
}
- // Terminate the index consistency check.
- if (serverGlobalParams.clusterRole == ClusterRole::ConfigServer) {
- PeriodicShardedIndexConsistencyChecker::get(serviceContext).onShutDown();
- }
-
// Shutdown the TransportLayer so that new connections aren't accepted
if (auto tl = serviceContext->getTransportLayer()) {
log(LogComponent::kNetwork) << "shutdown: going to close listening sockets...";
@@ -988,6 +983,11 @@ void shutdownTask(const ShutdownTaskArgs& shutdownArgs) {
// it is building an index.
repl::ReplicationCoordinator::get(serviceContext)->shutdown(opCtx);
+ // Terminate the index consistency check.
+ if (serverGlobalParams.clusterRole == ClusterRole::ConfigServer) {
+ PeriodicShardedIndexConsistencyChecker::get(serviceContext).onShutDown();
+ }
+
ShardingInitializationMongoD::get(serviceContext)->shutDown(opCtx);
// Acquire the RSTL in mode X. First we enqueue the lock request, then kill all operations,