ExportXMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • Fully Compatible
    • Storage Execution 2026-11-09, Storage Execution 2026-11-23
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Overview

      Define the internal API and key model for a conflict detection module that is separate from the storage engine, as part of the SPM-4946 prototype. This header is the seam that the detector implementations, commit-path integration, staged writes, and log-and-apply work all build on.

      Background

      Today WiredTiger detects write-write conflicts while writes are staged. The proposed design stages writes in the RecoveryUnit and asks an in-memory detector at commit time. The detector must never miss a conflict. It may report false conflicts. The approach is modeled on the Aurora DSQL adjudicator. The existing POC on branch conflict-detector-poc (src/mongo/db/repl/adjudicator.h) is reference material only.

      Scope of Work

      • Define ConflictKey: (ident, keyspace kind [record store / index], KeyString or RecordId bytes), plus a stable hash.
      • Define WriteSet: how it is built from RecoveryUnit staged ops, and dedup.
      • Define ConflictDetector::tryCommit(writeSet, readTs, reserveSlot) -> optional<OpTime>:
        • "No conflict" means the oplog slot is reserved and the keys are recorded at the commit timestamp.
        • Commit timestamps are recorded in the order oplog slots are reserved.
        • reserveSlot is not called when there is a conflict.
        • The floor timestamp, for step-up, restart, and GC.
      • Sketch (do not implement) where read-set hooks for serializable and for the optimistic read-your-writes check would attach.

      Acceptance Criteria

      • Header(s) in the project branch, with doc comments stating the contract.
      • Findings recorded on this ticket: API trade-offs, open questions, and recommendations for the follow-on production milestone.

      Technical Notes

      • Prototype quality; not intended for commit to master.
      • Out of scope: concrete detector implementations and commit-path wiring. Those are follow-on tickets in this epic.

            Assignee:
            Dan Larkin-York
            Reporter:
            Dan Larkin-York
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: