Add concurrency FSM jstest interleaving bulk insert with concurrent DDL (collMod, createIndex, dropIndex)

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Summary

      New concurrency jstest at jstests/concurrency/fsm_workloads/bulk_insert_concurrent_ddl.js that interleaves a multi-sub-batch bulk insert with concurrent collMod, createIndex, and dropIndex on the same collection, and asserts atomicity invariants at teardown. Targets the race surfaced by SERVER-95924 (bulk insertions are split into 64-doc sub-batches by internalInsertMaxBatchSize; DDL that lands between sub-batches is not serialized against the whole bulk).

      Workload shape

      • 4 threads, 50 iterations each
      • States: bulkInsert (100 docs per call → always crosses a sub-batch boundary), collMod (toggles validator between {} and {payload: {$exists: true}}), createIndex (on {{ {tid:1, batchId:1, seq:1}

        }}), dropIndex

      • Uniform-distribution transitions via state_transition_utils.uniformDistTransitions
      • Per-batch driver result captured in bulk_insert_concurrent_ddl_receipts for teardown reconciliation
      • DDL acceptable codes: ConflictingOperationInProgress, IndexBuildAlreadyInProgress, IndexBuildAborted, IndexNotFound, NamespaceNotFound

      Invariants asserted at teardown

      1. Per-(tid, batchId) doc completeness: clean bulk's visible count must equal nInserted; raced bulk's visible count must fall in [0, BULK_DOCS_PER_BATCH]
      2. Doc schema completeness: no visible doc missing seq or payload
      3. Index visibility atomicity: hinted vs unhinted itcount() must agree for every non-id index
      4. collMod validator atomicity: listCollections().options.validator must be exactly one of the two installed shapes — never a merged/partial state

      Failure mode

      Structured failures[] array names the (invariant, tid, batchId, indexName) that surfaced the violation. Green-by-default; failures only fire if mixed-state visibility is observed.

      Files

      • jstests/concurrency/fsm_workloads/bulk_insert_concurrent_ddl.js (264 lines, single file)
      • BUILD.bazel uses glob(["*.js"]) — no registration needed

      Related

      • SERVER-95924 — bulk insertions do not atomically serialize with concurrent DDLs
      • SERVER-125850 — setFCV timeseries downgrade × DDL race
      • SERVER-95283 — need test injecting stale catalog metadata

            Assignee:
            Unassigned
            Reporter:
            Mehar Grewal
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: