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

cloneCollectionAsCapped must support unsplittable collections

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Catalog and Routing
    • ALL

      Currently createCapped(nss) only runs on unsharded collection which before SERVER-81190 are always on the primary shard.
      The command works as follow:

      • create a new collection as capped and name it to "temp"
      • clone all the data from nss to temp
      • rename "temp" to nss with dropTarget=true

      All the three operations are running locally on the owning shard.
      In case the unsharded collection is an unsplittable collection, the rename causes nss to have a new UUID which is not updated in the CSRS.
      The goal of this ticket is to change createCapped to adapt it to the new unsplittable collection.

      In case the collection is an unsplittable collection, a quick idea could be:

      • change the local createCollection to shardsvrCreateCollection
      • Block migrations for the entire cloning phase.
      • change the local rename to shardsvrRenameCollection

      Additionally, both cloneToCapped and convertToCapped send commands to the dbPrimary, so if the unsplittable collection was moved, it would not work. We need to make sure that the command work on unsplittable collections not located in the primary shard.

            Assignee:
            backlog-server-catalog-and-routing [DO NOT USE] Backlog - Catalog and Routing
            Reporter:
            enrico.golfieri@mongodb.com Enrico Golfieri
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: