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

Make it easier to copy collections and indexes

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Catalog and Routing

      Anything trying to copy collection or indexes should be able to do so without needing to extra logic to perform any transformation (this logic should be handled under the hood, if such transformation is required).

      Some examples of such api:
      Example 1: call command for getting index option, call command for creating the index by feeding the previous result as-is.
      Example 2: call command that copies index with hostName/shardName and collection as the input.

      Providing command/set of commands to perform this would be most ideal so other tools like mongosync would be benefit from this as well.

      Motivation: We have hit some CAs in the past that are very subtle and not obvious that they are incorrect just by looking at the resharding code for cloning collections/indexes. Some examples:

      SERVER-90243: listCollections doesn't include the complete options to copy the collection correctly.
      SERVER-89705: absence of collation from listIndex means simple collation, but if you didn't specify collation in createIndex, it means default collation. So passing in the index option from listIndex to createIndex directly can sometimes yield a different collation from the original index.

            Assignee:
            Unassigned Unassigned
            Reporter:
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: