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

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Shell
    • Labels:
      None

      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.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: