databasev2 4 part A, task 1. - wo_wal gains `path`: the abort diagnostic is worthless without naming the file it could not write. strdup'd in open, freed in close; NULL is tolerated so the message degrades rather than crashes - wo_wal_commit now reports WHICH half failed — WO_WAL_ERR_WRITE for pwrite, WO_WAL_ERR_SYNC for fdatasync. A short write and a device refusing the flush are different operational problems and the operator needs the right one named - wo_wal_commit_fatal(w, nrec): commits, or prints one diagnostic naming the operation, path, errno and record count, then exits WO_EXIT_DURABILITY (3 — 1 is a trap, 2 is a refusal, so this takes a third of its own) - retrying is not offered, deliberately: on Linux a failed fsync may have already discarded the dirty pages, so a second call can report success having written nothing. Replay is the recovery that works - test_wal: a failed commit is DETECTED, reports the write error specifically, keeps the batch staged (a failed commit consumes nothing), and the WAL knows its own path. 165 pass (was 156) DISCLOSED GAP: the exit path itself is not exercised. Forcing a real fdatasync failure needs a full or read-only filesystem, which the gate cannot arrange without mount privileges. No fault-injection switch was added — shipping a binary that can be told to kill itself is the worse trade, and the spec rejected it. Verified: just wovm-test — 36 suites (18 x both dispatch flavors) 0 fail, cli_smoke OK. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| CODE-LOGIC.md | ||
| db.c | ||
| db.h | ||
| table.c | ||
| table.h | ||
| wal.c | ||
| wal.h | ||