Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-40119

A shell helper/an option for createCollection command to create the collection with the specified UUID

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Shell
    • None
    • Storage Execution

      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.

            Assignee:
            backlog-server-execution [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            linda.qin@mongodb.com Linda Qin
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: