diff --git a/src/mongo/db/s/create_collection_coordinator.cpp b/src/mongo/db/s/create_collection_coordinator.cpp index 3411b44b6f..11af3ced44 100644 --- a/src/mongo/db/s/create_collection_coordinator.cpp +++ b/src/mongo/db/s/create_collection_coordinator.cpp @@ -55,6 +55,8 @@ namespace mongo { namespace { +MONGO_FAIL_POINT_DEFINE(hangBeforeGettingShard); + struct OptionsAndIndexes { BSONObj options; std::vector indexSpecs; @@ -750,6 +752,10 @@ void CreateCollectionCoordinator::_finalize(OperationContext* opCtx) noexcept { shardsRefreshed.find(chunkShardId) != shardsRefreshed.end()) { continue; } + if (hangBeforeGettingShard.shouldFail()) { + hangBeforeGettingShard.pauseWhileSet(); + uasserted(ErrorCodes::InterruptedAtShutdown, "Interrupted normal execution"); + } auto shard = uassertStatusOK(shardRegistry->getShard(opCtx, chunkShardId)); try {