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

Collection acquisition establishing capped snapshot can miss collection concurrently being created

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Critical - P2 Critical - P2
    • 7.2.0-rc0, 7.1.0-rc3
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • v7.1
    • Execution EMEA Team 2023-08-21, Execution EMEA Team 2023-09-04, Execution EMEA Team 2023-09-18
    • 105

      When acquiring a collection, we establish a capped snapshot if the collection requires it. When doing so, we simply look up into the collection catalog. If such a collection is concurrently being created, in the version of the collection catalog we're using it may have been added to CollectionCatalog::_pendingCommitNamespaces as a part of the pre-commit hooks. However it's possible that we haven't yet executed the commit handlers which come after committing the storage transaction. This would mean that we haven't registered the collection with the collection catalog yet; thus the aforementioned lookup in the collection catalog would not find the collection, and we would (incorrectly) not establish a capped snapshot. Then later in the collection acquisition logic we establish a consistent collection which opens the collection because it is in CollectionCatalog::_pendingCommitNamespaces. Therefore the end state of this sequence of events is that we have performed a collection acquisition on a collection which uses capped snapshots, without performing the required capped snapshot establishment.

            Assignee:
            jordi.olivares-provencio@mongodb.com Jordi Olivares Provencio
            Reporter:
            gregory.noma@mongodb.com Gregory Noma
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: