diff --git a/src/mongo/db/s/create_collection_coordinator.cpp b/src/mongo/db/s/create_collection_coordinator.cpp index 9daff7b07a5..ce409746efe 100644 --- a/src/mongo/db/s/create_collection_coordinator.cpp +++ b/src/mongo/db/s/create_collection_coordinator.cpp @@ -63,7 +63,7 @@ #define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kSharding MONGO_FAIL_POINT_DEFINE(failAtCommitCreateCollectionCoordinator); - +MONGO_FAIL_POINT_DEFINE(waitBeforeCreateIndex); namespace mongo { namespace { @@ -744,6 +744,9 @@ void CreateCollectionCoordinator::_createCollectionAndIndexes(OperationContext* boost::optional collation; std::tie(collation, _collationBSON) = getCollation(opCtx, nss(), _request.getCollation()); + if (MONGO_unlikely(waitBeforeCreateIndex.shouldFail())) { + waitBeforeCreateIndex.pauseWhileSet(); + } // We need to implicitly create a timeseries view and underlying bucket collection. if (_collectionEmpty && _request.getTimeseries()) {