Repository navigation
Coordinator WAL stops fsyncing per commit: one durability policy = NORMAL - #4781
Merged
Merged
Conversation
…cy, set to NORMAL A single #comms send committed ~58 times across the coordinator's WAL stores (coordination 26, transcript_routes 12, registry 10, input_dispositions 8, turn_context 2) and, under synchronous=FULL, paid one fsync per commit — the bulk of the send burst's wall time (108 syncs/send measured). WAL keeps the database file consistent at every synchronous level. NORMAL loses nothing an application or process crash could take; only an OS crash or power loss can roll a WAL back, and only to the last checkpoint. For the coordinator that is self-healing: the bus message is the source of truth and cohort acceptance is idempotent (AlreadyApplied), so a rolled-back acceptance is re-derived on the next read. The policy was declared twice — WalStore defaulted FULL and CoordinationStore restated FULL as a literal in its own configure_connection. That duplication is why "change the durability" looked like two edits. Collapse it to one declaration on StoreWriter, the ancestor both share, and set it to NORMAL. WalStore inherits it; CoordinationStore applies cls.synchronous instead of a literal. A store that must survive power loss still overrides (goal stores declare EXTRA; transcript keeps NORMAL). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XbFMSnLEc51gw21bLFFRK1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A single
#commssend commits ~58 times across the coordinator's WAL stores (coordination 26, transcript_routes 12, registry 10, input_dispositions 8, turn_context 2). Undersynchronous=FULLeach commit fsyncs the WAL — 108 syncs per send measured (58 WAL + ~40 directory), the bulk of the send-burst wall time (0.3–0.8s, target <200ms).WAL mode keeps the database file consistent at every synchronous level.
NORMALloses nothing an application/process crash could take; only an OS crash or power loss can roll a WAL back, and only to the last checkpoint. For the coordinator that is self-healing: the bus message is the source of truth and cohort acceptance is idempotent (AlreadyApplied), so a rolled-back acceptance is re-derived on the next read.Why it was two edits, and shouldn't be
The policy was declared twice —
WalStoredefaultedFULLandCoordinationStorerestatedFULLas a literal in its ownconfigure_connection. That duplication is the factoring defect. Collapsed to one declaration onStoreWriter(the ancestor both share) set toNORMAL:WalStoreinherits it,CoordinationStoreappliescls.synchronousinstead of a literal. Stores that must survive power loss still override (goal stores declareEXTRA; transcript keepsNORMAL).No migration:
synchronousis a per-connection PRAGMA applied on every open, not persisted in the WAL header — a reinstall's new connections apply it.Tests
test_coordination,test_coordination_cohort,test_carry_coordinator_wal,test_coordination_response— 85 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01XbFMSnLEc51gw21bLFFRK1