diff options
author | Matthew Saltz <matthew.saltz@mongodb.com> | 2020-04-13 14:24:04 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-04-14 17:27:39 +0000 |
commit | 861c3ea80b3b8f1e9cb30ab71b78a35f76d2016c (patch) | |
tree | 4206effc486847f222140712404226251f16d4f9 | |
parent | ac237fc725e9ea3d9ec86ec49687506eab4d777d (diff) | |
download | mongo-861c3ea80b3b8f1e9cb30ab71b78a35f76d2016c.tar.gz |
SERVER-47482 Shut down migrationutil executor
(cherry picked from commit ffa39df7e8eec01b3a9b41fd141ca8d0f8ad974c)
-rw-r--r-- | src/mongo/db/db.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp index 6371b428b8d..fb18605b15d 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" @@ -1193,6 +1194,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(); } |