summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/mr.cpp
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/commands/mr.cpp
parent2ea0f36818d37cc790aa117cb23e9b6f976ffd43 (diff)
downloadmongo-9a18de96023e67ae3ee8888a4745ed923882e49f.tar.gz
SERVER-43295 startIndexBuild kicks off index builds on secondaries
Diffstat (limited to 'src/mongo/db/commands/mr.cpp')
-rw-r--r--src/mongo/db/commands/mr.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp
index 502d66dff8c..3319caa2fcf 100644
--- a/src/mongo/db/commands/mr.cpp
+++ b/src/mongo/db/commands/mr.cpp
@@ -637,9 +637,13 @@ void State::prepTempCollection() {
continue;
}
- // Log the createIndex operation.
- opObserver->onCreateIndex(
- _opCtx, tmpName, tempColl->uuid(), indexToInsert, fromMigrate);
+ // If two phase index builds is enabled, index build will be coordinated using
+ // startIndexBuild and commitIndexBuild oplog entries.
+ if (!IndexBuildsCoordinator::get(_opCtx)->supportsTwoPhaseIndexBuild()) {
+ // Log the createIndex operation.
+ opObserver->onCreateIndex(
+ _opCtx, tmpName, tempColl->uuid(), indexToInsert, fromMigrate);
+ }
}
if (buildUUID) {