diff options
author | Benety Goh <benety@mongodb.com> | 2019-09-13 01:51:22 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-09-13 01:51:22 +0000 |
commit | 9a18de96023e67ae3ee8888a4745ed923882e49f (patch) | |
tree | c26a5b1d4284482c15457dc37126e68558130762 /src/mongo/db/catalog | |
parent | 2ea0f36818d37cc790aa117cb23e9b6f976ffd43 (diff) | |
download | mongo-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.cpp | 8 |
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); |