-
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
- 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]
- Doc schema completeness: no visible doc missing seq or payload
- Index visibility atomicity: hinted vs unhinted itcount() must agree for every non-id index
- 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
- is related to
-
SERVER-95924 Bulk insertions do not atomically serialize with concurrent ddls
-
- Blocked
-
-
SERVER-125850 A race condition exists between setFCV timeseries downgrade and DDL operations
-
- Closed
-
-
SERVER-95283 Create test(s) that injects old catalog metadata that is no longer valid
-
- Backlog
-