summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/collection_cloner.cpp
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2020-02-19 13:56:46 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-19 19:21:40 +0000
commitfcac5c203ad459cffc85d38c26058ea8a84fb9a3 (patch)
tree4c5836c21acd1d0c720868195a0146bd258fc80e /src/mongo/db/repl/collection_cloner.cpp
parent3805c2bf3921474671fdb6bd78ea17848ecef3d9 (diff)
downloadmongo-fcac5c203ad459cffc85d38c26058ea8a84fb9a3.tar.gz
SERVER-39453 initial sync ignores in-progress index builds when cloning collections
Diffstat (limited to 'src/mongo/db/repl/collection_cloner.cpp')
-rw-r--r--src/mongo/db/repl/collection_cloner.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/db/repl/collection_cloner.cpp b/src/mongo/db/repl/collection_cloner.cpp
index 43e7630e6b0..55bc1ccce09 100644
--- a/src/mongo/db/repl/collection_cloner.cpp
+++ b/src/mongo/db/repl/collection_cloner.cpp
@@ -33,6 +33,7 @@
#include "mongo/base/string_data.h"
#include "mongo/db/commands/list_collections_filter.h"
+#include "mongo/db/index_builds_coordinator.h"
#include "mongo/db/repl/collection_bulk_loader.h"
#include "mongo/db/repl/collection_cloner.h"
#include "mongo/db/repl/database_cloner_gen.h"
@@ -153,7 +154,9 @@ BaseCloner::AfterStageBehavior CollectionCloner::countStage() {
}
BaseCloner::AfterStageBehavior CollectionCloner::listIndexesStage() {
- auto indexSpecs = getClient()->getIndexSpecs(_sourceDbAndUuid, QueryOption_SlaveOk);
+ auto indexSpecs = IndexBuildsCoordinator::supportsTwoPhaseIndexBuild()
+ ? getClient()->getReadyIndexSpecs(_sourceDbAndUuid, QueryOption_SlaveOk)
+ : getClient()->getIndexSpecs(_sourceDbAndUuid, QueryOption_SlaveOk);
if (indexSpecs.empty()) {
LOGV2_WARNING(
21143,