summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorMatthew Saltz <matthew.saltz@mongodb.com>2020-04-13 14:24:04 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-04-13 22:09:39 +0000
commitffa39df7e8eec01b3a9b41fd141ca8d0f8ad974c (patch)
tree67656f36176e83d61dcdb713ed8bbc9305f3b541 /src/mongo
parent60102e6a083fe3290e30bbad0c83c6293ba8b301 (diff)
downloadmongo-ffa39df7e8eec01b3a9b41fd141ca8d0f8ad974c.tar.gz
SERVER-47482 Shut down migrationutil executor
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/db/db.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp
index 286bc7c7fce..37a58b8dd9d 100644
--- a/src/mongo/db/db.cpp
+++ b/src/mongo/db/db.cpp
@@ -126,6 +126,7 @@
#include "mongo/db/s/collection_sharding_state_factory_standalone.h"
#include "mongo/db/s/config/sharding_catalog_manager.h"
#include "mongo/db/s/config_server_op_observer.h"
+#include "mongo/db/s/migration_util.h"
#include "mongo/db/s/op_observer_sharding_impl.h"
#include "mongo/db/s/periodic_sharded_index_consistency_checker.h"
#include "mongo/db/s/shard_server_op_observer.h"
@@ -1187,6 +1188,12 @@ void shutdownTask(const ShutdownTaskArgs& shutdownArgs) {
validator->shutDown();
}
+ // The migrationutil executor must be shut down before shutting down the CatalogCacheLoader.
+ // Otherwise, it may try to schedule work on the CatalogCacheLoader and fail.
+ auto migrationUtilExecutor = migrationutil::getMigrationUtilExecutor();
+ migrationUtilExecutor->shutdown();
+ migrationUtilExecutor->join();
+
if (ShardingState::get(serviceContext)->enabled()) {
CatalogCacheLoader::get(serviceContext).shutDown();
}