diff options
author | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2020-04-09 20:27:15 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-04-20 22:53:33 +0000 |
commit | b957b68205fbf672867cf68e30c0744ac5abfb9f (patch) | |
tree | 3cfc9b7cb90f2082b905f87701ab92d87d5297cc /src/mongo/db/s | |
parent | 41bec612516c3258984deaa022453d6721bcd542 (diff) | |
download | mongo-b957b68205fbf672867cf68e30c0744ac5abfb9f.tar.gz |
SERVER-46659 Initial sync will startup two phase index builds during the collection cloning phase to prevent a scenario where the commit quorum cannot be satisfied due to the primary node needing the initial syncing nodes vote
Diffstat (limited to 'src/mongo/db/s')
-rw-r--r-- | src/mongo/db/s/migration_destination_manager.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/s/shard_key_util.cpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/mongo/db/s/migration_destination_manager.cpp b/src/mongo/db/s/migration_destination_manager.cpp index 9dfc07a5bd3..4b3a57f2e54 100644 --- a/src/mongo/db/s/migration_destination_manager.cpp +++ b/src/mongo/db/s/migration_destination_manager.cpp @@ -651,7 +651,9 @@ void MigrationDestinationManager::cloneCollectionIndexesAndOptions( // Determine which indexes exist on the local collection that don't exist on the donor's // collection. DBDirectClient client(opCtx); - auto indexes = client.getIndexSpecs(nss); + const bool includeBuildUUIDs = false; + const int options = 0; + auto indexes = client.getIndexSpecs(nss, includeBuildUUIDs, options); for (auto&& recipientIndex : indexes) { bool dropIndex = true; for (auto&& donorIndex : collectionOptionsAndIndexes.indexSpecs) { diff --git a/src/mongo/db/s/shard_key_util.cpp b/src/mongo/db/s/shard_key_util.cpp index bd0f192dd34..7bbeed2614d 100644 --- a/src/mongo/db/s/shard_key_util.cpp +++ b/src/mongo/db/s/shard_key_util.cpp @@ -189,7 +189,9 @@ void validateShardKeyIndexExistsOrCreateIfPossible(OperationContext* opCtx, std::vector<BSONObj> ValidationBehaviorsShardCollection::loadIndexes( const NamespaceString& nss) const { - std::list<BSONObj> indexes = _localClient->getIndexSpecs(nss); + const bool includeBuildUUIDs = false; + const int options = 0; + std::list<BSONObj> indexes = _localClient->getIndexSpecs(nss, includeBuildUUIDs, options); // Convert std::list to a std::vector. return std::vector<BSONObj>{std::make_move_iterator(std::begin(indexes)), std::make_move_iterator(std::end(indexes))}; |