summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorLouis Williams <louis.williams@mongodb.com>2019-05-17 11:17:33 -0400
committerLouis Williams <louis.williams@mongodb.com>2019-05-17 11:21:12 -0400
commit99585f23be46f97d2e8a962d00fef6ca6758390c (patch)
treedfd64e6b161c170d4abe40ad748c069173fff859 /src/mongo/db
parent17fe1b7109a93402ec77afee92c1b4a5118a45d4 (diff)
downloadmongo-99585f23be46f97d2e8a962d00fef6ca6758390c.tar.gz
SERVER-40897 Default index catalog metadata to use single-phase index build format
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/catalog/index_build_block.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mongo/db/catalog/index_build_block.cpp b/src/mongo/db/catalog/index_build_block.cpp
index 46231723f62..df5e7c578a4 100644
--- a/src/mongo/db/catalog/index_build_block.cpp
+++ b/src/mongo/db/catalog/index_build_block.cpp
@@ -80,7 +80,7 @@ Status IndexCatalogImpl::IndexBuildBlock::init(OperationContext* opCtx, Collecti
}
// Setup on-disk structures.
- const auto protocol = IndexBuildProtocol::kTwoPhase;
+ const auto protocol = IndexBuildProtocol::kSinglePhase;
Status status = collection->getCatalogEntry()->prepareForIndexBuild(
opCtx, descriptor.get(), protocol, isBackgroundSecondaryBuild);
if (!status.isOK())
@@ -95,14 +95,14 @@ Status IndexCatalogImpl::IndexBuildBlock::init(OperationContext* opCtx, Collecti
_indexBuildInterceptor = stdx::make_unique<IndexBuildInterceptor>(opCtx, _entry);
_entry->setIndexBuildInterceptor(_indexBuildInterceptor.get());
- const auto sideWritesIdent = _indexBuildInterceptor->getSideWritesTableIdent();
- // Only unique indexes have a constraint violations table.
- const auto constraintsIdent = (_entry->descriptor()->unique())
- ? boost::optional<std::string>(
- _indexBuildInterceptor->getConstraintViolationsTableIdent())
- : boost::none;
-
if (IndexBuildProtocol::kTwoPhase == protocol) {
+ const auto sideWritesIdent = _indexBuildInterceptor->getSideWritesTableIdent();
+ // Only unique indexes have a constraint violations table.
+ const auto constraintsIdent = (_entry->descriptor()->unique())
+ ? boost::optional<std::string>(
+ _indexBuildInterceptor->getConstraintViolationsTableIdent())
+ : boost::none;
+
collection->getCatalogEntry()->setIndexBuildScanning(
opCtx, _entry->descriptor()->indexName(), sideWritesIdent, constraintsIdent);
}