Race of authoritative then non-authoritative DDL coordinator can leave leftover authoritative collection entry

XMLWordPrintableJSON

    • Catalog and Routing
    • Fully Compatible
    • ALL
    • v9.0
    • CAR Team 2026-07-20, CAR Team 2026-08-03
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      For Authoritative Shards, we rely on drop DDLs (e.g. drop, rename with dropTarget...) to clean up stale collection entries in the authoritative catalog (config.shard.catalog.collections). This is only done once those DDLs are authoritative.

       

      For this to work during FCV upgrade however, we assume that once a DDL is authoritative, all following DDLs are also authoritative (e.g. the interleaving of DDLs is ...nonauthoritative-nonauthoritative-nonauthoritative-authoritative-authoritative-authoritative...).

       

      However this is not necessarily the case because the decision on the authoritativeness and the execution order are decided at two different points:

      • The authoritativeness is decided when the coordinator document is created.
      • The execution order is decided by whoever takes the DDL lock first.

      So it's possible to have an interleaving of DDLs like ...nonauthoritative-nonauthoritative-authoritative-nonauthoritative-authoritative-authoritative...).

       

      This can cause us to leave a stale authoritative sharding metadata by the same mechanism as SERVER-131541 (see attached repro).

        1. image-2026-07-16-12-06-24-566.png
          44 kB
          Joan Bruguera Micó
        2. repro-SERVER-131535.patch
          5 kB
          Joan Bruguera Micó

            Assignee:
            Joan Bruguera Micó
            Reporter:
            Joan Bruguera Micó
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: