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

Forbid usage of CollectionCatalog::get without an open snapshot

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • Catalog and Routing
    • 2

    Description

      The collection catalog allows a user to acquire the latest version of the catalog by calling CollectionCatalog::get(opCtx) without having a snapshot open.

      However, this leaves open the possibility of first doing some computations on the catalog, acquiring the correct snaphsot via shard role acquisiton/AutoGetter, then getting the correct Catalog and continuing with the same assumptions.

      This could lead to potential query/data inconsistencies if we had something existing at the latest catalog but not in the snapshotted one and the rest of the code assuming the first catalog for operations instead.

      To avoid this we should forbid the implicit acquisition of the latest catalog without a snapshot and add an invariant that crashes the server if accessing the catalog without a snapshot open. We should still allow a user to explicitly ask for the latest version however.

      Attachments

        Activity

          People

            backlog-server-catalog-and-routing Backlog - Catalog and Routing
            jordi.olivares-provencio@mongodb.com Jordi Olivares Provencio
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: