diff options
author | Dianna Hohensee <dianna.hohensee@10gen.com> | 2019-03-21 17:00:09 -0400 |
---|---|---|
committer | Dianna Hohensee <dianna.hohensee@10gen.com> | 2019-03-24 17:11:54 -0400 |
commit | 85126f13b5b26700cb9dc869df3ad747515e6a25 (patch) | |
tree | ce150ada40a6a52f712fd4681aac2c35ffb69427 /src/mongo/db/catalog/capped_utils.cpp | |
parent | 10f196bb962c6d4f983b9d7b1209aff26f97573a (diff) | |
download | mongo-85126f13b5b26700cb9dc869df3ad747515e6a25.tar.gz |
SERVER-39079 Move BackgroundOperation checks out of the catalog layer; add parallel IndexBuildsCoordinator checks for all BackgroundOperation checks
Diffstat (limited to 'src/mongo/db/catalog/capped_utils.cpp')
-rw-r--r-- | src/mongo/db/catalog/capped_utils.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/catalog/capped_utils.cpp b/src/mongo/db/catalog/capped_utils.cpp index 2ddae23aa80..0f9562d653c 100644 --- a/src/mongo/db/catalog/capped_utils.cpp +++ b/src/mongo/db/catalog/capped_utils.cpp @@ -45,6 +45,7 @@ #include "mongo/db/client.h" #include "mongo/db/concurrency/write_conflict_exception.h" #include "mongo/db/curop.h" +#include "mongo/db/index_builds_coordinator.h" #include "mongo/db/op_observer.h" #include "mongo/db/query/internal_plans.h" #include "mongo/db/query/plan_yield_policy.h" @@ -95,6 +96,8 @@ Status emptyCapped(OperationContext* opCtx, const NamespaceString& collectionNam } BackgroundOperation::assertNoBgOpInProgForNs(collectionName.ns()); + IndexBuildsCoordinator::get(opCtx)->assertNoIndexBuildInProgForCollection( + collection->uuid().get()); WriteUnitOfWork wuow(opCtx); @@ -258,6 +261,7 @@ void convertToCapped(OperationContext* opCtx, ErrorCodes::NamespaceNotFound, str::stream() << "database " << dbname << " not found", db); BackgroundOperation::assertNoBgOpInProgForDb(dbname); + IndexBuildsCoordinator::get(opCtx)->assertNoBgOpInProgForDb(dbname); // Generate a temporary collection name that will not collide with any existing collections. auto tmpNameResult = |