Repository navigation
Minimal WAL — Durability Redesign (P0 + P1) - #399
Merged
Merged
Conversation
…hunks CRC durability bugs
…t, drop dead BitmapL3 root branch, cut SavePages alloc, hoist stats chunk-0 skip; +6 tests
- Short-read race: advance _fileSize only after the async write is durable (SavePages post-FlushToDisk), never authorizing a read past physical EOF. - Grow-path latch corruption: SlotRefCount-pin the slot across the request→latch gap + bounded retry + try/finally (RequestExclusiveForGrow); never write/unlatch a slot we don't own. - Checkpoint barrier reopen stall: seed DurableLsn to the reopen frontier alongside NextLsn (LOG-08), so CK-02 isn't an unreachable target on idle reopen. Full suite now completes (was host-crashing on the latch bug); 20 residual failures are pre-existing/flaky (verified vs 66db27a).
WalCrc→Foundation Crc32CUtil; relocate checkpoint-LSN watermark to DurabilityWatermarks (M12 slice); de-collide File-Page-Index abbrevs. Add identifier-scoped grep gate StorageDurabilityIdentifierGateTests. Behavior-preserving; suite green at known baseline. Net −512 LOC.
This was referenced Jun 25, 2026
Stale test: RunCheckpointCycle_NoDirtyPages_AdvancesLsn expects 0 pages, WAL-v2 writes metadata
#403
Closed
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.
Implements the Minimal WAL durability redesign (WAL v2, Option A) — P0 + P1 of #393. The WAL carries logical truth only (
(EntityId, ComponentTypeId), never pages/chunks/bufferIds); one codec, one apply routine, checkpoint v2 with A/B slot-pairing; v1 machinery (FPI,WalReplayHelper,WalSerializer, UowRegistry persistence) is deleted.Umbrella: #393 (P0 + P1) · also completes #395 (P1). Companion docs PR in
nockawa/typhon-claude(TLA+ specs S1/S2 + design/rules) — both must merge. Close #393/#395 via/complete-taskonce both are merged.What's in this PR
IDurabilityLog;RecoveryDriver+ApplyCommitted(One True Crash Test green); checkpoint v2 (FPI fully retired, A/B slot-pairing for meta + directory twins, watermark consolidation). Plus 3 page-cache/WAL concurrency fixes (Page-cache & WAL concurrency: short-read race, grow-path latch corruption, checkpoint-barrier reopen stall #397).ChaosPageIO(record-and-damage-real-disk) + page-axis/WAL-window crash sweep (WalCrashSweepTests),ProtectedPairTests(CK-05 write-log protection). Found & fixed 2 durability bugs: RB-05NextFreeTSNresumption + enabled-bits preserved across crash rebuild. 1 residual quarantined → Checkpoint does not persist EntityMap index metadata → consolidated EntityMap orphaned on hard crash (enabled-bits loss for flat archetypes) #398..github/workflows/engine-ci.ymlruns the crash sweep (Category=CrashSweep) + the One True Crash Test (TrueCrashE2ETests) and fails on red.Program success metrics (all met)
Wal/Lsn/Fpiinsrc/Typhon.Engine/Storage/Known residual (out of scope): #398 — checkpoint metadata-durability / flat-archetype enabled-bits on hard-crash-after-consolidation (P2).
🤖 Generated with Claude Code