ExportXMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • Storage Execution 2026-11-23
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Overview

      Prototype staging of table-level writes in a per-RecoveryUnit buffer, following the design note. Writes that would be sent to WiredTiger are recorded in the buffer instead, and every written key is added to the transaction's WriteSet.

      Scope of Work

      • featureFlagStagedWrites (startup/FCV-gated, read once) and ident eligibility: kAllExceptDenyList (default), kNone, and test-only kAllowList driven by an internal server parameter.
      • Deny-list: oplog, catalog/size storer/sessions, capped collections, index-build side tables, time-series buckets, change-stream pre-images. Eligibility is decided per collection, memoized per ident, and stable for the ident's lifetime.
      • Staging predicate: ident eligible AND opCtx->writesAreReplicated(). Replay always writes through.
      • Hooks in wiredTigerCursorInsert/Update/Remove/Modify: when staging applies, record the key/value in the buffer and the key in the WriteSet instead of calling WiredTiger.
      • TableBuffer<D> over integer and string key domains, StagedWriteBuffer keyed by table id, operation rules per design note section 3.2, single RecoveryUnit Change that clears the buffer on commit/abort.
      • Memory limit (stagedWriteBufferMaxBytes) raising TransactionTooLargeForCache.
      • Debug-build assertions: deny-listed idents never stage (per-ident StagedWriteRegistry); a write with caller-supplied RecordId and timestamp under writesAreReplicated(); write-through to a key already staged by the same transaction.
      • Unit tests for buffer operation rules, abort, and memory accounting.

      Acceptance Criteria

      • Buffer, hooks and eligibility in the project branch with passing unit tests.
      • Findings recorded on this ticket: helper/RecoveryUnit changes needed, deny-list gaps found.
      • 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).

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

              Created:
              Updated: