summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mongo/db/repl/replication_coordinator_external_state_impl.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp
index ca0fc21ecc8..3f1333a2f60 100644
--- a/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp
+++ b/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp
@@ -504,9 +504,15 @@ void ReplicationCoordinatorExternalStateImpl::shardingOnDrainingStateHook(Operat
// Since we *just* wrote the cluster ID to the config.version document (via
// ShardingCatalogManager::initializeConfigDatabaseIfNeeded), this should always
// succeed.
- fassertStatusOK(40217,
- ClusterIdentityLoader::get(txn)->loadClusterId(
- txn, repl::ReadConcernLevel::kLocalReadConcern));
+ status = ClusterIdentityLoader::get(txn)->loadClusterId(
+ txn, repl::ReadConcernLevel::kLocalReadConcern);
+
+ if (ErrorCodes::isShutdownError(status.code())) {
+ // Don't fassert if we're mid-shutdown, let the shutdown happen gracefully.
+ return;
+ }
+
+ fassertStatusOK(40217, status);
}
// Free any leftover locks from previous instantiations