Fix M5.7 compaction and failure recovery

This commit is contained in:
dingo
2026-09-26 19:40:16 -04:00
parent 56f533c738
commit a2a12fdc69
6 changed files with 187 additions and 29 deletions
+27 -8
View File
@@ -28,14 +28,33 @@ Executed on Windows x64 / MSVC 19.44.35207:
- `tools/windows-check.ps1 -Preset release -Action format`: passed.
- `git diff --check`: passed before commit.
New coverage validates checkpoint/journal/recovery, compaction over a published
journal, exclusive writer lock, all three injected publication boundaries, corrupt
manifest and missing published payload failure. Before-manifest failures recover
the previous generation; after-manifest replacement recovers the new generation.
Actual power-cut/full-disk behavior, POSIX syscall path, Linux CI/libFuzzer, and
filesystem-controller flush guarantees remain unverified locally. There is no
automatic orphan cleanup, production storage adapter, Kubernetes deployment or
World0 change.
New coverage validates checkpoint/journal/recovery, exact compaction over a published
journal, divergent-state rejection, exclusive writer lock, injected publication
boundaries, partial-write/out-of-space outcomes, corrupt manifest and missing payload.
Before-manifest failures recover the previous state; after replacement, reopen
recovers the new state. Actual power-cut/disk-full behavior, POSIX syscall path,
Linux CI/libFuzzer, and filesystem-controller flush guarantees remain unverified
locally. There is no automatic orphan cleanup, production storage adapter,
Kubernetes deployment or World0 change.
### M5.7 review corrections
The follow-up review found that command high-water alone allowed a divergent
checkpoint to replace an active journal. Checkpoint now compares its canonical bytes
with the fully recovered journal result before compaction. Poisoned handles reject
recovery; reopen resolves ambiguous post-replacement directory-sync failures.
Interruption tests now use a different edited payload and compare recovered canonical
state and debris across the commit point. Deterministic partial-write/out-of-space
injection covers payload and manifest temporaries, including retry, and a directory
sync failure hook verifies poison/reopen behavior. The injection models a partial
write outcome; it is not a physical disk-full or power-cut test.
Revalidated after these corrections on Windows x64 / MSVC 19.44.35207:
- Release configure/build and 47/47 CTests passed.
- clang-tidy analysis build and 47/47 CTests passed.
- ASan build and 47/47 CTests passed.
- clang-format and `git diff --check` passed.
## Tools and host