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

The 'AutoGetCollectionForReadLockFreePITCatalog' utility can mismatch the Sharded and StorEx parts of a collection

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • ALL
    • Execution Team 2023-03-06
    • 135
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      The newly introduced AutoGetCollectionForReadLockFreePITCatalog utility first snapshots the CollectionPtr object from the StorEx catalog and then attaches it a description. This is incorrect, because while the StorEx catalog can read at a point-in-time, the Sharding one cannot and always returns "latest". Because of this it is possible that an older collection content can be wrongly paired with a newer description, thus rendering the shard key application nonsensical.

      Until CSS::getCollectionDescription is made timestamp-aware, a check needs to be performed based on the UUID of the collection to ensure that the two can be paired and SnapshotTooOld exception should be thrown.

      Note that in practice, this is not possible to hit, because the Router Role is not going to find a history across drop/recreate so any queries will fail there.

            Assignee:
            henrik.edin@mongodb.com Henrik Edin
            Reporter:
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: