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

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

      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.

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