diff options
author | Randolph Tan <randolph@10gen.com> | 2016-07-14 16:16:03 -0400 |
---|---|---|
committer | Randolph Tan <randolph@10gen.com> | 2016-07-14 16:35:27 -0400 |
commit | fb5ef7d2617db15e4149a287b200c652056c775b (patch) | |
tree | 56d6fb0ee8ca5190ac333564d98f9db8c5fd0d51 | |
parent | 2ea2c7700d9ccca1150e49c181c97b948889df5e (diff) | |
download | mongo-fb5ef7d2617db15e4149a287b200c652056c775b.tar.gz |
SERVER-25049 loadClusterId should not cause an fassert on shutdown
-rw-r--r-- | src/mongo/db/repl/replication_coordinator_external_state_impl.cpp | 12 |
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 |