writeonce/database/src
shoney.arickathil ceea00e0b6 feat(wal): a failed barrier is detected, and fatal — T1
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>
2026-08-28 09:16:35 +02:00
..
CODE-LOGIC.md feat: O(1) read path — index probe wired end to end 2026-08-22 16:44:56 +02:00
db.c feat: O(1) read path — index probe wired end to end 2026-08-22 16:44:56 +02:00
db.h feat: arc stage 3 T7 — transparent DB actor (WO_T_DB hole closed) 2026-08-21 13:10:26 +02:00
table.c feat: O(1) read path — index probe wired end to end 2026-08-22 16:44:56 +02:00
table.h feat: O(1) read path — index probe wired end to end 2026-08-22 16:44:56 +02:00
wal.c feat(wal): a failed barrier is detected, and fatal — T1 2026-08-28 09:16:35 +02:00
wal.h feat(wal): a failed barrier is detected, and fatal — T1 2026-08-28 09:16:35 +02:00