summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/capped_utils.cpp
diff options
context:
space:
mode:
authorDianna Hohensee <dianna.hohensee@10gen.com>2019-01-22 11:47:50 -0500
committerDianna Hohensee <dianna.hohensee@10gen.com>2019-03-11 17:38:03 -0400
commitd02edd5290131978f901ffc657bee3470d03f8fd (patch)
tree3e53beb391466f36d073d0ce710dee3f88d90273 /src/mongo/db/catalog/capped_utils.cpp
parentb69c97b4da596f1da8dea2b40cf32a7c5c657870 (diff)
downloadmongo-d02edd5290131978f901ffc657bee3470d03f8fd.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.cpp4
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 =