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

Use $listCatalog aggregation stage in MigrationDestinationManager to clone collection indexes and options

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

      Context
      Currently we use `listCollections` and `listIndexes` commands to clone the collection options and indexes. Respectively in:

      These functions are used at least by chunk migration and resharding.

      Since listIndexes is a user facing command it returns the logical format. When we want to clone indexes from one node to another, I believe we should always use the raw format instead. This will avoid passing through 2 format translation layers (raw -> logical and then logical -> raw) and reduce the likelihood of errors.

      Proposal
      Use the internal $listCatalog stage instead. This stage returns a dump of the catalog without doing any transformation of the metadata. So it feels more safe than listCollections and listIndexes that instead do a lot of metadata massaging.

            Assignee:
            Unassigned Unassigned
            Reporter:
            tommaso.tocci@mongodb.com Tommaso Tocci
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: