[SERVER-40119] A shell helper/an option for createCollection command to create the collection with the specified UUID Created: 14/Mar/19  Updated: 06/Dec/22  Resolved: 14/Mar/19

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Linda Qin Assignee: Backlog - Storage Execution Team
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Storage Execution
Participants:

 Description   

When a collection is created, it will be associated with a UUID. For a sharded collection, the UUID for this collection on all the shards should be the same. Otherwise, sharding related operations (e.g. chunk migration) will fail.

In the situation when a shard is down & lost all its data, when we try to re-create the collection on that shard, we would need to create the collection with the correct UUID. Currently it seems the only way to create a collection with the specified UUID is to run applyOps command (correct me if I have missed anything):

db.runCommand({applyOps:[{op:"c", ns:"DATABASE.$cmd", ui:UUID("COLLECTION_UUID"), o:{create:"COLLECTION"}}]})

It would be nice to have a shell helper/option for createCollection command to be able to create the collection with the specified UUID.



 Comments   
Comment by Geert Bosch [ 14/Mar/19 ]

Generally creating a collection with a specific UUID is likely to corrupt a cluster, so we don't want to add a shell helper making that easier. 

Generated at Thu Feb 08 04:54:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.