-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Storage Execution
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Overview
Wire the conflict detector into commit for staged writes, following design note section 7, so that write-write conflicts are decided by the detector rather than WiredTiger.
Scope of Work
- Commit ordering: take the WriteSet accumulated by the write helpers; call ConflictDetector::tryCommit(writeSet, readTs, reserveSlot); on conflict throw WriteConflictException (non-transactional writes retry, transactions abort); apply staged writes to WiredTiger at the reserved timestamp with overwrite=true cursors that bypass the staging hooks; commit the unit of work.
- Move oplog slot reservation for non-transactional writes into tryCommit.
- Forbid preparing a transaction that has staged writes.
- Measure critical-section cost.
- Contention jstests (e.g. adapted from the POC contention and sum-invariant tests).
- Note: applying staged writes at commit is a deliberate intermediate step that gives a working end-to-end checkpoint. A follow-on ticket in this epic removes it so only the oplog entry commits.
Acceptance Criteria
- Concurrent conflicting writes are correctly serialized; non-conflicting ones commit.
- Findings recorded on this ticket: every commit-path change required, and critical-section cost measurements.
- Acceptance bar: the full jstest suite passes with featureFlagStagedWrites enabled, except for specific tests excluded with a documented reason tied to prototype scope.
Technical Notes
- Prototype quality; not intended for commit to master.
- Design reference: src/mongo/db/txns/staged_writes_design.md (PR #66680).
- depends on
-
SERVER-138761 Prototype StagedWriteBuffer and staging hooks in the WiredTiger write helpers
-
- Open
-
-
SERVER-138758 Prototype exact and lossy ConflictDetector implementations with tests
-
- Closed
-
- is depended on by
-
SERVER-138771 Identify candidate workloads and tentative performance goals for conflict detection
-
- Open
-
-
SERVER-138762 Remove apply-at-commit so only the oplog entry commits on the primary
-
- Backlog
-
-
SERVER-138766 Verify unique index constraint enforcement with staged writes
-
- Backlog
-
-
SERVER-138768 Prototype startup recovery and failover with staged writes and primary application
-
- Backlog
-
-
SERVER-138772 Produce delivery plan and architecture update from conflict detection prototype findings
-
- Backlog
-