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

Race condition in the `shardCollectionLegacy` logic due to usage of CatalogCache instead of CSS

    XMLWordPrintable

Details

    • Fully Compatible
    • ALL
    • Sharding 2021-02-08
    • 59

    Description

      When the legacy shardCollection logic runs, it does an optimistic check of whether the collection is already sharded with the same options using direct reads from the config server. However, later on it uses the CatalogCache in order to return information about the collection.

      If the collection was sharded from another node, the CatalogCache is not guaranteed to be up to date and it is possible that it returns that a collection is unsharded (even though it is sharded on the config server).

      Because of this, the check needs to be done using the CSS instead of direct reads.

      Attachments

        Issue Links

          Activity

            People

              marcos.grillo@mongodb.com Marcos José Grillo Ramirez
              kaloian.manassiev@mongodb.com Kaloian Manassiev
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: