- GetVolume reports a restore target's recorded restore tuple (source
volume, snapshot, create request id): three additive read-only fields
filled from the lifecycle record. --abort reads it before any change
and refuses another restore's target, a plain volume, or a record with
no tuple (a blockmaster before v1.0.1) with nothing changed.
- restore reads the placement (QueryWorkspace) before placing: once the
authority line is published the master refuses any placement, so a
line for this replica with this binding is this restore's placement,
and a line for anything else refuses naming the abort.
- backup labels its snapshot with its request and accepts only an answer
carrying that label (the holder answers an existing name with the
snapshot already there); every printed fact must be present.
- Tests run the production volume-delete and release against the layout
catalog: dependent removal, the tombstone refusal, interrupted aborts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The master's refusal of a restore whose snapshot names another volume's
chunks carries a typed reason (an ErrorInfo detail, RESTORE_SOURCE_NOT_OWN)
and the CLI maps it to its existing JSON code restore_source_not_own
instead of the generic not_admitted. A volume the master does not know
(NotFound from the resolve) exits with volume_not_found. A client decides
by these codes, never by message text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main now has a test (from the refused-restore change) that commits a HEAD
through layout.RunCommit; with the cause argument it passes
layout.CauseCommit. Test only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A HEAD is written by three store calls: the conditional update (only
through runTransition), the exclusive create, and the tombstone. Each now
takes a typed HeadWriteCause, one value per row of the HEAD writer
census, so a writer without a row does not compile. The transitions that
serve one row pass it; RunAbort, RunEndClean and RunCommit, which serve
several, take it from their caller. The layout store refuses a cause
outside the census, a first HEAD not written as create and a tombstone
not written as tombstone. No behaviour changes otherwise.
TestEveryHeadWriteIsACensusRow scans the production source: every HEAD
write names a census constant or forwards its function's cause, and
every row has a writer (both directions); it logs the writers by row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-up. The template unit takes the volume id from its
instance name, so a settings file cannot name another volume (a fourth
per-instance directive, kept by the drift test). /status/guests and its
schema say what it is: the counted frontends (NVMe/TCP, iSCSI) only; an
absent frontend is not served or not counted; a vanished host stays
counted until TCP closes; 0 is not proof that nothing uses the volume.
The endpoint test's callbacks use atomics.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What volume start and volume stop need, before the commands.
/status/guests?volume=<v> reports the guests connected now through each
frontend served: NVMe/TCP hosts (live admin controllers) and iSCSI
initiators (Normal sessions past login; Discovery sessions do not count),
read at request time, and their sum.
deploy/systemd/sw-blockvolume@.service runs one volume per instance
from /etc/sw-block/volumes/<volume>.env with its own state directory;
apart from three per-instance directives it is sw-blockvolume.service,
and a test keeps the two the same.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remove unnamed roots, segments and chunks through one conditional mark/delete writer. Resume chunk cursors after bounded passes; re-plan metadata first and retain the session initial root set through operator snapshot deletes. Add a local trigger of the existing snapshot schedule for qualification.
The ledger row for the identity rule this change keeps: one name, one
layout identity; no directory but the record's holds a live HEAD. Its
scope: only a refused restore's record (never left the creation phase)
is removed; a served volume's deleted name is never created again. A
guard test proves that name is refused for a plain create, the same
restore request and a new one, with no record and no filer write.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Generated on the v1.0.0 tag checkout (25a3b755), on Linux: the lifecycle
stores (volume records, placements, node inventory, deletion
reservations, bindings), the authority store (lines and lost ranges) and
the store attestations. Today's stores write the same files (volume
records compared with their store-minted layout ids blanked) and read
them as the same records; each file's blob hash is pinned.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment only: a dependent may have been recorded and released by the
operator before the snapshot was deleted. No code change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-up. A restore can pass the master's snapshot check, write
its record, and then meet a snapshot deleted in between (refused for good
by target creation); a crash, or a removal that fails, leaves the record.
The replay then stops at the master's own snapshot check: it now removes
the matching not-ready record there, since a recorded dependent keeps
its snapshot, so an absent snapshot proves the target was never recorded
on the source. A removal that fails answers Unavailable (retry), not the
refusal.
Tests through the real catalog: a restore of a restore target's snapshot
is refused with no filer write and no record; a failure after the
dependent's write keeps the record and the replay completes it with the
same target id. Renewal on a not-ready name: admitted deletion untyped,
committed deletion typed DELETED.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CreateVolume of a restore target wrote its lifecycle record, then target
creation refused a snapshot naming another volume's chunks (a snapshot of
a restore target). The not-ready record stayed: the name resolved, the
documented delete found no HEAD, and workspace show advised a retry of a
CreateVolume that is refused for a deleted name.
When target creation refuses for good before any write (a foreign or
absent snapshot; no replay changes either), the master removes the
record in the same command. Any other error keeps it for the replay. The
workspace checks look at deletion before store readiness.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The NVMe initiator renews its deadline (nvmeIODeadline, 60 s) before every
I/O command, so it bounds each command instead of the connection's whole
life: requireBlocks' 65,536 reads no longer race one dial-time deadline.
- reviewBindingHostBeforeStart's context is a hang guard for the whole test
(60 s, was 10 s), so a slow host's setup does not use up the time the
later calls and the successor probe need.
TestNVMeInitiatorDeadlineBoundsEachCommand and
TestWorkspaceRPCSameHostForcedRecoveryOutlivesASlowSetup pass; test-only,
no product change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two tests fail on a slow host while CI passes (a WSL run with its scratch
on a mounted Windows drive). Both fail because a fixed bound in the test,
not the product, runs out:
- TestWorkspaceRPCSameHostForcedRecoveryRecordsLoss: the successor probe and
the later calls run under reviewBindingHostBeforeStart's 10 s context, and
a slow setup uses it up ("signal: killed"). The new
TestWorkspaceRPCSameHostForcedRecoveryOutlivesASlowSetup pauses 11 s
before the probe (both clocks the test reads are fake, so no lease
changes) and fails on main on any host.
- TestCutoverWriteSnapshotKillRestartRestore: the NVMe initiator sets one
deadline at dial (60 s) and requireBlocks then reads all 65,536 blocks on
that connection. The new TestNVMeInitiatorDeadlineBoundsEachCommand shortens
the deadline (now the variable nvmeIODeadline) to 2 s, idles 2.5 s and
reads one block: it fails on main on any host.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CreateVolume and the cluster-spec start check refuse a new volume above
geometry.MaxNewVolumeBytes with ErrVolumeTooLarge, naming the size and the
maximum, before any record or store exists. The check is at creation
only: a volume that already exists keeps opening under the uint32-LBA
limit. The value is a placeholder (MaxVolumeBytes) until it is set from
the measured capacity limit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lost-reply tests now run through the executor's registered callbacks:
a proxy forwards every frame to the replica (which admits and acts on it)
and discards its replies, so the fence and the catch-up really fail at
the sender; the failure is forwarded and the healthy verdict that
follows heals the peer, and live traffic is acknowledged. A behind peer
(R < H) is not healed by the healthy verdict, heals only through a
catch-up's registered close (every block equal to the primary's), and
then takes live traffic. The census now covers every reference to the
session order in the adapter's production source (constructor binding
and each draw by case), with helper, alias and outside-a-case controls.
Each control is red against its mutant: no afterFence wiring, no
afterSessionClose wiring, no re-draw on failure.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The replica takes a session's lineage when it admits it; the sender saw
only the exchange's result. A fence the replica admitted whose reply was
lost, or a recovery session whose close failed, left the replica above
the live session with no re-draw. The fence-complete and session-close
callbacks now re-draw the live session above the session on any outcome
(a completed recovery still advances the cursor and heals). A guard test
over the adapter's draw switch lists every command kind that draws a
session and what re-draws after it; the refresh's log line names the
session and the reason instead of 'after recovery='.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>