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

CollectionCatalog::establishConsistentCollection does not check commit pending entries with a read timestamp

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

      establishConsistentCollection is used to establish a collection pointer consistent with the storage snapshot. When a DDL is commit pending, the CollectionCatalog's latest state cannot be trusted, and the collection needs to be opened from storage to double check.

      However,_needsOpenCollection only checks if a namespace is commit pending when no read timestamp is provided. Theoretically, it is possible for a caller of establishConsistentCollection to pass in the timestamp of a durably persisted DDL operation, which has yet to publish the changes to the CollectionCatalog (is in_pendingCommitUUIDs), and incorrectly get a Collection pointer which is not consistent with the snapshot.

      E.g. if the DDL is a drop committed at TS100, a concurrent query reading at TS100 might get the collection pointer from before the drop.

      For this to be possible though, the timestamp has to become externally visible.

      We should:

      • investigate if this is indeed possible.
      • fix the behaviour so it is correct by design, even if we end up discovering it is not possible in practice.

            Assignee:
            sulabh.mahajan@mongodb.com Sulabh Mahajan
            Reporter:
            yujin.kang@mongodb.com Yujin Kang Park
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: