summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/index_builds_manager.h
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2019-03-06 14:19:10 -0500
committerBenety Goh <benety@mongodb.com>2019-03-06 14:19:10 -0500
commit2cc9b94ea266c87f7a71a708a108ce4f2466b76c (patch)
tree5429b5d7c31f5abfe9e685c12050e143f9602c2d /src/mongo/db/catalog/index_builds_manager.h
parentd0265ef8ba219d8ebaf703bcec45ab232fd90024 (diff)
downloadmongo-2cc9b94ea266c87f7a71a708a108ce4f2466b76c.tar.gz
SERVER-39085 IndexBuildsManager supports relaxing index constraints during index builds
Diffstat (limited to 'src/mongo/db/catalog/index_builds_manager.h')
-rw-r--r--src/mongo/db/catalog/index_builds_manager.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/mongo/db/catalog/index_builds_manager.h b/src/mongo/db/catalog/index_builds_manager.h
index 255fdeba875..e2f23ad4bb6 100644
--- a/src/mongo/db/catalog/index_builds_manager.h
+++ b/src/mongo/db/catalog/index_builds_manager.h
@@ -56,6 +56,20 @@ class IndexBuildsManager {
MONGO_DISALLOW_COPYING(IndexBuildsManager);
public:
+ /**
+ * Indicates whether or not to ignore indexing constraints.
+ */
+ enum class IndexConstraints { kEnforce, kRelax };
+
+ /**
+ * Additional options for setUpIndexBuild. The default values are sufficient in most cases.
+ */
+ struct SetupOptions {
+ SetupOptions();
+ IndexConstraints indexConstraints = IndexConstraints::kEnforce;
+ bool forRecovery = false;
+ };
+
IndexBuildsManager() = default;
~IndexBuildsManager();
@@ -68,7 +82,7 @@ public:
const std::vector<BSONObj>& specs,
const UUID& buildUUID,
OnInitFn onInit,
- bool forRecovery);
+ SetupOptions options = {});
/**
* Recovers the index build from its persisted state and sets it up to run again.