pingqiuandClaude Fable 5.1 ddb6ff5771 test: KNOWN-ZERO acceptance test on a fresh volume
TestKnownZeroAcceptance (tags subprocess chunkstore_integration, KZ_RUN=1)
runs the five acceptance steps on a fresh volume (KZ_SIZE, default
1T), each printing one "KZ STEP n PASS|FAIL" line with its counters into
KZ_REPORT:

1. the empty first snapshot stages and uploads nothing and HEAD names no
   segment; the fresh attach certified the chunks known-zero;
2. mkfs (ext4 and xfs) or known blocks, sync, snapshot: the cut's work is
   bounded by the chunks touched;
3. restore and fork of that snapshot on another server node: contents
   equal, the first snapshot of each target without a full scan;
4. reads of snapshot-named blocks before hydration return data, never
   zeros, and each read waits for its own fetch (AbsentChunks, Hydration);
5. the first start of a fresh volume killed before its attach commit: after
   the restart nothing is certified known-zero, the first cut scans every
   chunk once, the data reads back exactly.

KZ_ROLE source|target splits steps 3-4 onto a second host through a handoff
file; SWBLOCK_TEST_LISTEN_HOST (default 127.0.0.1) lets the test harness
bind a host address instead of loopback. KZ_DEVICE=1 uses the kernel
NVMe/TCP device, resolved only by the run's own NQN (kzResolve, with table
tests); a path given by name is never formatted.

Step 5 stops the process at the provider's existing boundary before the
fresh marker is retired, through a binary built with -tags kzhold
(HoldBeforeChunkFreshRetireForTest); a normal build contains none of it,
which TestKZHoldNeverInReleaseBuild checks.

The volume-size test's cluster and volume start move into shared helpers
(headSzStartCluster, headSzStartVolume) used by both tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-24 12:09:51 -08:00
Languages
Go 84.5%
Rust 7.9%
Shell 2.7%
templ 1.6%
Java 1%
Other 2%