The execution of convertToCapped(collName) may prematurely invalidate open change streams targeting collName

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.2.0-rc0
    • Affects Version/s: 8.1.0-rc0, 8.0.0-rc4
    • Component/s: None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • v8.1, v8.0
    • CAR Team 2025-07-07
    • None
    • 3
    • TBD
    • 🟥 DDL
    • None
    • None
    • None
    • None
    • None
    • None

      SERVER-85772 introduced into ConvertToCappedCoordinator new logic to clean up stale metadata that other DDLs may have left on some  local catalogs of the participants (as documented in SERVER-87010).

      The clean up is performed through the sendDropCollectionParticipantCommandToShards command, which is incorrectly submitted with the fromMigrate: false parameter. This setting has the effect of potentially generating user-visible change stream events: in particular, a participant that holds stale metadata for the targeted collection would emit a drop entry for the targeted collection, which would cause change streams opened against such a namespace to be invalidated.

      The commit of convertToCappe is indeed supposed to invalidate change streams, but only after blocking user writes and completing the operation on the local catalog of the data-bearing shard; the early invalidation proceeding from the clean-up phase is problematic because it occurs while user writes may still be served by the cluster (and these would be missed by change stream readers).

      The problem may be addressed by just flipping the value of the fromMigrate parameter.

              Assignee:
              Paolo Polato
              Reporter:
              Paolo Polato
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: