Two parts of the rule are added. Certification needs the store to have
been created by this process start (an in-memory bit, never persisted):
a fresh marker left by an earlier start, an older binary or another
opener is never trusted, so a first start that dies before its attach
commit pays one scan. And the order is: the attach commit retires the
marker, then the marking is made durable, then the volume serves; a
crash between the first two leaves no marker and every chunk UNKNOWN
(one scan). The user guide states that every explicit implementation
other than walstore-chunk refuses a chunk root.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A fresh store (its .chunkfresh marker present at the attach, no BASE) has
never had a write or a fill reach it, so every chunk its claimed HEAD
does not name is zero on both sides. Its attach samples, under the
capture barrier, the token of each such chunk whose owned-map entry is
still the creation value, and clears only their UNKNOWN through the cut's
own map publication, before the attach commit. The first cut of a fresh
volume, hand-over target or restore target then scans only the chunks
written since, not every chunk of the volume. Chunks HEAD names stay
absent and are hydrated from HEAD.
The premise is enforced: every implementation other than walstore-chunk,
explicit as well as auto, refuses a root carrying chunk metadata, so no
plain walstore write can reach a store whose marker says none did.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A store created empty against a HEAD never claimed, with two chunks
written (one checkpointed out of the WAL), must have two first-cut
candidates and publish both; today all chunks start Unknown and every
chunk of the volume is scanned. Two tests that pass today pin the scope:
a store created against a claimed HEAD, and a restore target, keep every
locally held chunk a candidate.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b=X and c=Y synced, then b=Z unsynced: the flusher skips b (its newest
entry is unsynced) and its checkpoint passes X's record, which never
reached the extent. Crash after the checkpoint, with the WAL region as of
the last sync that covered it: b reads Z, because the flusher's sync is
the whole-file fsync of the one descriptor. The control models an
extent-only flusher sync and loses X (b reads the bytes from before X),
showing the checkpoint bound rests on that. INV-WAL-FLUSH-SYNC-COVERS-WAL-001
moves from STUB to ACTIVE with this test; INV-WAL-V3-WRITE-AHEAD-001
states the dependency.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The flusher keeps only the snapshot's synced entries before its empty
check, so a cycle over unsynced writes alone writes no extent and makes
no fsync (it fsynced an empty batch before). A new test drives a guest
that never flushes: below the WAL pressure threshold nothing reaches the
extent; past it, the flusher's pressure sync makes the writes durable and
the same cycle writes every block's newest bytes and advances the
checkpoint.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Page writeback has no order across offsets of one file, so an extent
written from a WAL record that is not yet durable could survive a power
loss that loses the record: extent bytes no recovered record or map
entry accounts for, under a chunk certified equal to HEAD. The flusher
now skips dirty entries above the synced (acknowledged) WAL frontier;
they stay dirty until a Sync or the pressure sync makes them durable,
and the checkpoint is computed from the written entries only (it was
already clamped to that frontier). Recover and the install log already
fsync their records before raising the frontier.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The flusher writes a dirty block's extent before its WAL record is synced
(below the WAL pressure threshold it does not sync first). The test runs
the real flusher, cuts the power at its fsync (the extent page it wrote
kept, the unsynced WAL record lost, no checkpoint), recovers and
re-attaches: the block reads the lost write's bytes locally while HEAD
holds the chunk without them, and the chunk is not a cut candidate, so
nothing reconciles local and published. Fails on main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
StagedChunks is counted when staging remembers a chunk for reuse, so a
round interrupted partway counts what it finished instead of nothing;
the copy window, which shares the upload stream, does not count. The
counter's contract (only grows, a re-staged chunk counts again,
in-process) is stated in the status and in a new invariant row with its
tests: an exact count of 6 for a failed attempt, 0 for its reusing retry,
and 5 of 6 for a round whose upload fails at the sixth chunk.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A cut's PayloadNs now counts its staging rounds even when they uploaded
nothing (every staged chunk was zero), so a first cut that spent its time
reading and hashing shows it. The layer status gains StagedChunks: the
chunks staged by every cut attempt, failed ones included, so a cut retried
after its deadline shows the progress its earlier attempts made.
DirtyChunks is documented as the next cut's candidates, not its progress.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TEST V1-SPEC r2.104: after every cut attempt HEADSZ stores the volume's
whole chunk section of its durable status as served (every counter and the
full LastCut), so a term the named fields do not cover can still be read.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
TEST V1-SPEC r2.100: after every cut attempt HEADSZ records the volume's
DirtyChunks (capture candidates) and its last successful cut's
CandidateChunks, UnchangedChunks and PayloadNs, as the durable status
reports them, so the candidate count and its cost are measured per size.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
TEST V1-SPEC r2.99/r2.100: the shared sw-block runner kills a command after
150 s, so a cut longer than that never reached the server's own operation
deadline. HEADSZ now runs the snapshot command with its own bound, the
command's --timeout plus a minute, and records a command it still has to
kill as an attempt. It also records the volume's DirtyChunks (its capture
candidates) before the first cut.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Under systemd blockvolume refuses --volume-lock-dir-test-only (exit 2), so
the first run never reached the filer check. systemd 249 reports the start
limit as a failed unit with Result=exit-code and 'Start request repeated
too quickly', not Result=start-limit-hit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TEST V1-SPEC r2.99: HEADSZ_SNAPSHOT_TIMEOUT passes the snapshot command's
--timeout (the server caps it at its operation deadline); HEADSZ_ATTEMPTS
retries a failed cut with the same request id. Every attempt is recorded
with its error, wall time, the volume's last cut and its chunk-key count in
the filer afterwards, so a retry shows whether an earlier attempt's uploads
were kept. A cut that never completes is recorded as cut_not_completed.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
INV-VOL-GEOMETRY-FLAGS-RECORD-001: in create mode a ReadVolume error was
taken as an absent record, so a wrong --durable-blocks could still create a
wrong-size store when the record could not be read. The error is now
classified (one type check): the filer failed the read (remote unavailable,
deadline) -> exit 75, retried: 'the volume record of V could not be read
(<cause>); no local store was created; retrying'; the record is there but
does not decode -> exit 78, not a retry loop: 'the volume record of V is
unreadable (corrupt: <cause>); no local store was created; restore or
recreate the record'. An absent record (not found) keeps the create path.
A first start with the filer down was already safe: it ends at the startup
filer check (exit 1) before this one.
Tests: unit, both classes (a failing LookupEntry -> 75 for a wrong and a
right flag, the record read; a corrupt VOLUME entry -> 78);
TestCorruptRecordIsRefusedBeforeTheStoreIsCreated (filer up, the VOLUME
entry undecodable: 78 and no store for both flags; restored: 78 for the
wrong flag, the right flag serves); TestFirstStartWithTheFilerDownCreatesNoStore
(guard). The ledger row and the operator guide say so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IMPL V1-SPEC r2.94: an env-gated integration test (HEADSZ_RUN=1) that writes
one 4 KiB block in every 1 GiB segment of a volume per size in HEADSZ_SIZES,
takes a snapshot, then snapshots after one changed block each, and reports
per cut the HEAD entry's byte size from the filer, the segments it lists, the
cut's timings and the bytes it uploaded. A size the durable root cannot hold
is recorded as refused by the headroom check. No assertion on the numbers.
The weed cluster helper gains a sized variant; existing callers keep the
same 32 x 256 MB volume server.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The unreadable-record control reads a valid volume through a filer whose
lookups fail and asserts the read happened. The cure test's right-flag
start on the planted store must exit 75 with the attach check's
geometry_mismatch and never log a frontend phase over its life. The
ledger statement keeps its meaning in 288 characters.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
INV-VOL-GEOMETRY-FLAGS-RECORD-001. A create-mode start whose
--durable-blocks/--durable-blocksize disagree with the volume record exits 78
(no restart) with a line naming both geometries, before the durable provider
is built, so no local store of the wrong size is created. An existing local
store is never rechecked against the flags (its geometry is checked at
attach, as before); a missing record keeps the create path; an unreadable
record falls through to the attach check.
Tests: TestGeometryFlagsRefusalComparesTheRecord (unit);
TestWrongGeometryFlagIsRefusedBeforeTheStoreIsCreated (real binaries, red on
the previous main: exit 75 after 35 s and a wrong-size store). The cure for a
store an earlier release left stays: TestWrongGeometryCureAsWritten plants
that store from a readable text fixture of a 2129a736 capture (sha256 checked
per file); the operator guide scopes the cure to such a store.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>