serialize multiple create timeseries collections with different OFCV

XMLWordPrintableJSON

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

      Remove the TODO associated with this ticket and run the relative test.

      Show
      Remove the TODO associated with this ticket and run the relative test.
    • 🟦 Shard Catalog
    • None
    • None
    • None
    • None
    • None
    • None

      In the shard-local implementation of create collection we take the MODE_IX lock on the collection. This means that multiple create operations can run concurrently for the same namespace. Consider the following problematic scenario:

      1. operation_A: starts with OFCV 8.0 sees that the collection does not exists yet
      2. FCV transition from 8.0 to 9.0
      3. operation_B: starts with OFCV 9.0 sees that the collection does not exists yet
      4. operation_A (OFCV 8.0): create the legacy timeseries buckets collection (`db.system.buckets.ts_coll`)
      5. operation_B (OFCV 9.0): create a viewless timeseries (`db.ts_coll`)

      So we end up with an inconsistent state in the catalog where both `db.ts_coll` and `db.system.buckets.ts_coll` exists as timeseries collections.

      The bug can occur only if:

      • viewless timeseries feature flag is enabled in FCV 9.0
      • We are on a replicaset cluster. On sharded clusters create operations are serialized through the DDL collection lock.

            Assignee:
            Unassigned
            Reporter:
            Tommaso Tocci
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: