Skip to main content

Module native_commit

Module native_commit 

Source
Expand description

Native mode commit protocol (§7.11).

Decouples bulk durability (payload bytes) from ordering (marker stream). Writers persist CommitCapsule payloads concurrently via RaptorQ encoding, then submit to the WriteCoordinator which serializes only: validation + commit_seq allocation + CommitMarker append.

Critical ordering (two fsync barriers, normative):

capsule symbols [written, not fsynced]
  → CommitProof
    → FSYNC_1 (pre-marker, group commit point)
      → CommitMarker
        → FSYNC_2 (post-marker)
          → SHM publish
            → client response

Both fsyncs are mandatory:

  • FSYNC_1 prevents “committed marker, lost data” (worst case).
  • FSYNC_2 prevents “client thinks committed, marker not persisted.”

Structs§

CommitIndex
Commit index: tracks which pages have been modified by recent commits.
CommitSubmission
A commit submission from a writer to the WriteCoordinator (§7.11.1 step 7).
FsyncBarriers
Tracks which fsync barriers have been completed for a commit.
GroupCommitBatch
A batch of pending commits that will share a single fsync.
WriteCoordinator
The WriteCoordinator serializes the validation + commit_seq allocation + marker append section of the native commit protocol (§7.11.2).

Enums§

CommitResult
Result of a commit attempt.