summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/tenant_collection_cloner.cpp
diff options
context:
space:
mode:
authorVishnu Kaushik <vishnu.kaushik@mongodb.com>2021-06-09 20:04:10 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-06-10 20:27:13 +0000
commit0d7c224fc2671e939ea97d94237003dd74805b54 (patch)
tree68a2a4ede2cb8c822df9ea70d14f5ab6fa75073f /src/mongo/db/repl/tenant_collection_cloner.cpp
parentefec3cc4b253d02fa9e11947ce92d53b727181b0 (diff)
downloadmongo-0d7c224fc2671e939ea97d94237003dd74805b54.tar.gz
SERVER-57532 Use donor specs for _id index in tenant migration collection cloner
Diffstat (limited to 'src/mongo/db/repl/tenant_collection_cloner.cpp')
-rw-r--r--src/mongo/db/repl/tenant_collection_cloner.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/db/repl/tenant_collection_cloner.cpp b/src/mongo/db/repl/tenant_collection_cloner.cpp
index 087e0da1261..7dc2a965097 100644
--- a/src/mongo/db/repl/tenant_collection_cloner.cpp
+++ b/src/mongo/db/repl/tenant_collection_cloner.cpp
@@ -387,7 +387,11 @@ BaseCloner::AfterStageBehavior TenantCollectionCloner::createCollectionStage() {
// means that we have a collection with the same namespace but a different UUID, in which
// case we should also fail the migration.
auto status =
- getStorageInterface()->createCollection(opCtx.get(), _sourceNss, _collectionOptions);
+ getStorageInterface()->createCollection(opCtx.get(),
+ _sourceNss,
+ _collectionOptions,
+ !_idIndexSpec.isEmpty() /* createIdIndex */,
+ _idIndexSpec);
uassertStatusOKWithContext(status, "Tenant collection cloner: create collection");
}