summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2019-09-13 01:51:22 +0000
committerevergreen <evergreen@mongodb.com>2019-09-13 01:51:22 +0000
commit9a18de96023e67ae3ee8888a4745ed923882e49f (patch)
treec26a5b1d4284482c15457dc37126e68558130762 /src/mongo/db/catalog
parent2ea0f36818d37cc790aa117cb23e9b6f976ffd43 (diff)
downloadmongo-9a18de96023e67ae3ee8888a4745ed923882e49f.tar.gz
SERVER-43295 startIndexBuild kicks off index builds on secondaries
Diffstat (limited to 'src/mongo/db/catalog')
-rw-r--r--src/mongo/db/catalog/rename_collection.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mongo/db/catalog/rename_collection.cpp b/src/mongo/db/catalog/rename_collection.cpp
index 1fcd21bd593..c66c4947e73 100644
--- a/src/mongo/db/catalog/rename_collection.cpp
+++ b/src/mongo/db/catalog/rename_collection.cpp
@@ -601,8 +601,12 @@ Status renameBetweenDBs(OperationContext* opCtx,
}
for (const auto& indexToCopy : indexesToCopy) {
- opObserver->onCreateIndex(
- opCtx, tmpName, tmpColl->uuid(), indexToCopy, fromMigrate);
+ // If two phase index builds is enabled, index build will be coordinated using
+ // startIndexBuild and commitIndexBuild oplog entries.
+ if (!IndexBuildsCoordinator::get(opCtx)->supportsTwoPhaseIndexBuild()) {
+ opObserver->onCreateIndex(
+ opCtx, tmpName, tmpColl->uuid(), indexToCopy, fromMigrate);
+ }
auto indexResult =
tmpIndexCatalog->createIndexOnEmptyCollection(opCtx, indexToCopy);