The guard fenced silently: when renewals kept failing until the lease
expired, it drained the volume through blockvolume's lease-stop path, which
logged nothing, and returned the raw RPC error (issue #205).
- Every fence records its first cause: lease expired without a successful
renewal, expired after a failed renewal (with the renewal's latency and
error), an invalid reply, a reply that arrived after the deadline,
revocation by the master, or shutdown. The guard logs it once as
"workspace lease: fenced ...", FenceCause() returns it, and the non-ACK
drain error carries it.
- Every failed renewal is logged with its latency and the lease deadline,
also when the lease is still valid: a run of them is the warning before
an expiry fence.
- An expiry after a failed renewal returns "workspace lease expired:
renewal failed after <d>: <err>", wrapping the RPC error.
- blockvolume logs when it stops because the guard requested the drain.
The fence behaviour itself is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
codex01 review of 7c6a29d8:
- P1: ValidateMigrationV3 lacked the checked extent end, so an aligned
geometry whose extent end overflows passed, the backup and the map were
written, and only the slot validation refused. The geometry check now
applies the same bounds (volume, extent, block, the checked WAL and
extent ends, the file end within MaxInt64), and the tool runs it, and a
file-size bound on the v2 WAL, before the WAL is read or anything is
written.
- P2: the scan allocated the v2 WAL size from the superblock before any
bound; it is now bounded by the file size first, with no wrapping sum.
- P2: a rerun that found the v2 chunk bitmap already renamed skipped the
directory fsync an earlier run may have failed; it now fsyncs it.
Controls: an overflowing extent end, a WAL past the file end and a WAL
size whose sums wrap are each refused with no byte written; a retirement
whose directory fsync failed is made durable by the rerun. Mutants: no
checked file end, no file-size bound, the rerun skipping the fsync. The
WAL-region overflow check alone is equivalent: the file-size bound also
refuses that case.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DESIGN r17.4 section 10.1. The tool (cmd/sw-block/migrate.go) runs the
steps, each durable before the next: the read-only exhaustive scan and
the geometry check (a refusal changes no byte), the atomic operator
backup of the v2 superblock, the initial map sidecar (generation 1, every
chunk UNKNOWN, covered = the v2 checkpoint), the prepared slot B at 4096,
slot A at phase 0 (the commit point), slot B at phase 0, then the v2
chunk bitmap retirement, and prints the new descriptor hash. A rerun
decides from the slot bytes alone (the 10.1 table): a v2 A restarts with
a full rescan; a committed A finishes the rollover and the retirement; a
committed B only the retirement; a prepared B with an invalid A refuses
with ErrMigrationIncomplete; neither valid refuses. It never reads or
restores the backup.
core/storage/migrate_v3.go is the tool-only export: it reuses the row-1
slot codec and the row-6 map codec (no second encoder), keeps the extent
base (new WALSize = old - 4096), and opens or serves nothing.
Controls through the actual CLI entry and, tagged, the actual v3 open:
a clean migration (extent unchanged, backup, retirement, the old binary
refuses, an idempotent rerun, v3 serves the v2 blocks with an all-UNKNOWN
map), refusals changing nothing, a crash after each step, the old binary
after preparation, a partly and wholly overwritten prepared B, and the
backup never restored. Mutants: no clean scan, commit before prepare,
retire before the commit, no rollover on rerun, an unrefused incomplete
state, a clean initial map. Not yet: the shared advisory lock (12b) and
committed raw v2 fixtures (13c).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DESIGN r17.4 section 10.1, the read-only half of `sw-block migrate-v3`:
cmd/sw-block/internal/v2legacy holds the frozen v2/impl1 superblock reader
(precondition 2: magic, version 2, walstore, impl version 1; impl 2 is
refused) and the one-record v2 entry probe, so the v3 open code keeps no
legacy reader and row 14 can delete the legacy production code.
ScanClean is precondition 3: it tries the frozen decoder at every byte
offset of the whole WAL region, circularly, and refuses any CRC- and
EntrySize-valid record of a known type whose type-derived footprint fits
the region (38 + Length for write, batch and padding; 38 for trim and
barrier, whose Length is an affected range) and whose last LSN is above
the checkpoint, plus any CRC-valid batch whose count cannot be
classified. Records at or below the checkpoint are ignored. It never
runs recovery or replay and writes nothing.
Controls: every record shape (wrapped, trim range, batch last LSN, zero
count, embedded in a payload, bad CRC) and real v2 stores (cleanly
closed scans clean; synced but never flushed refuses).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--durable-impl now defaults to empty (auto). A new volume is created as
walstore. An existing volume opens with the implementation its on-disk
superblock names, so volumes created under the old smartwal default keep
opening (no ImplKindMismatch on upgrade). An explicit selector keeps the
exact ErrImplKindMismatch refusal, and an unrecognized on-disk format is
still refused.
- core/frontend/durable: ImplAuto (the zero value) is resolved per volume
in openOrCreate; openExisting/createFresh take the resolved
implementation, and each volume handle records it, so DurableStatuses
reports the on-disk implementation. ImplSmartWAL is documented as
experimental; the 'production default' comments are removed.
- cmd/blockvolume: --durable-impl default '' with help text 'auto';
smartwal (experimental). The walstore-only options still require an
explicit --durable-impl=walstore.
- README: smartwal listed under 'Not claimed yet' with its open issues.
Tests: auto creates walstore; auto opens existing smartwal, walstore and
parallel-walstore volumes by their on-disk format; auto refuses an
unrecognized file; the flag default is empty; explicit values accepted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- .github/workflows/test.yml, job 'go test (linux)': on pull_request and on
push to main; Go from go.mod; go build ./..., go vet ./..., and
go test -short -count=1 -timeout 10m ./... with CGO_ENABLED=0. Actions are
pinned by commit SHA, permissions are contents: read, and a new push to a
PR cancels the older run.
- core/ops/surface_test.go: fix the two go vet warnings (resp used before
the error check), so vet covers the whole module.
- cmd/blockvolume: a withdrawn port no longer has to answer ECONNREFUSED.
A successful connect still fails; any other dial error passes only if the
address can be bound again.
- core/host/volume: probe tests dial a listener they opened and closed,
not the fixed 127.0.0.1:1.
- core/replication/component: on failure, the G5-5C and G9A catch-up tests
log frontiers, peer status and the engine trace. Assertions and timeouts
are unchanged.
Test files and the workflow only; no product code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comments in source and tests named individual reviewers and carried the
time a decision was taken (for example "(name's ruling, 06:47Z)"). Those
are review bookkeeping, not design rationale. Remove the names and the
dates/timestamps; keep the rationale, issue and PR references (#51, #82,
#83, #142, #159) and spec section references as plain text.
Comment-only: no code, test logic or string literal changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
codex01's review of f8d43653 (V:/share/rdma/codex01-block155-review-
20261116T0644Z/REVIEW.md) and claude05's ruling (A), 06:47Z. Against the
reviewed production code (its replay cutoff and positional smartwal
fail-closed; smartwal warning accessors stubbed so the tests build):
- a damaged STALE record in a released range drops retained, synced
LSN 3 (TestWALStoreRecoverStaleReleasedGarbageKeepsRetainedData);
- a torn smartwal slot accepted by one recovery becomes wal_corrupt
after a frontier jump and a new sync
(TestSmartWALTornSlotSurvivesAFrontierJump);
- a smartwal mid-history hole is an outage instead of a warning
(TestDurableStartup_Issue51_SmartWALHoleIsAWarningNotAnOutage);
- plus codex01's advisory: a healthy primary stays healthy with a
warning (TestStatusServer_StatusCarriesRecoveryWarnings..., which
passes either way: the plumbing never forced health).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude05's rulings (2026-11-16 06:10Z, 06:14Z). Controls with real
corrupted WALs, failing against stubs that restore today's behaviour:
walstore (interim: a power loss must never become an outage):
- (a) a corrupted mid-history synced entry: recovery succeeds to the
prefix, but no wal_hole_suspected warning, no count
(TestWALStoreRecoverWarnsOnMidHistoryHole);
- (c) the newer batch wrapped to offset 0 is replayed past a corrupted
older entry (TestWALStoreRecoverNoReplayPastAHoleAcrossWrappedRanges);
- the durable status and /status carry no warning
(TestDurableStartup_Issue51_WALStoreHoleIsAWarningNotAnOutage,
TestStatusServer_StatusCarriesRecoveryWarningsWithoutChangingHealth).
- controls that pass either way: (b) an out-of-order unsynced tail
recovers, a torn tail recovers.
smartwal (fail closed on a mid-history hole):
- a corrupted committed slot with later valid records starts Ready
(TestDurableStartup_Issue51_SmartWALMidHistoryHoleIsWALCorrupt);
- controls: the issue's exact mutation is wal_corrupt (ea1faf6a), a
torn tail recovers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Fork's early replay of a completed request refuses (volume_deleted)
a target whose HEAD is deleting, purging or deleted, also before its
VOLUME is marked, like the later publication path.
- Host.ImportLifecycleVolume registers a cluster-spec volume under the
CreateVolume RPC's boundary (workspaceMu, reservation check through
the create); blockmaster startup uses it, skipping (and logging) a
reserved id, and the placement import skips reserved ids too.
Unreserved ids keep importing idempotently.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
codex01's r4 review (V:/share/rdma/codex01-block152-r4-review-
20261116T0445Z/REVIEW.md). Controls failing against stubs:
- Fork's early replay reports success for a target past the delete mark
(deleting, purging, HEAD deleted before VOLUME is marked)
(TestCatalog_ForkReplayRefusesADeletingTarget);
- the cluster-spec import re-creates and places a reserved id after a
restart with the original spec (TestClusterSpecImportSkipsAReserved
Volume).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude05's cut (04:08Z): volume-delete refuses with
volume_has_snapshots while the volume has any snapshot name record (a
published snapshot, one being deleted, or an attempt in flight); the
operator deletes snapshots first. The delete never touches snapshot
names, attempts or roots: the snapshot loop, the claim check and claim
release (a claim lives on a named snapshot; a deleted target's claim is
dead by rule), and CreateSnapshot's back-out are gone. CreateSnapshot
and Fork still refuse once they see the delete mark.
codex01's r3 P2s:
- the snapshot check, the revert and the commit are bound to one
deleting incarnation (its generation); if HEAD moved, the check runs
again on the incarnation found;
- the CLI's admission token is --request-id (required), so a rerun
adopts and can give back an earlier invocation's hold;
- CreateVolume holds workspaceMu through the create;
- the reservation store syncs its parent directory before use (the
binding store's helper).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude05's 04:08Z cut (no snapshot cascade) and codex01's r3 P2s
(V:/share/rdma/codex01-block152-r3-review-20261116T0405Z/REVIEW.md).
Controls failing against stubs:
- the cut: a volume with a snapshot, an in-flight snapshot attempt, or
a fork's snapshot is deleted (TestCatalog_DeleteVolumeRefusesWhile
SnapshotsExist, TestCatalog_InFlightSnapshotRefusesTheDelete, ...Fork
DuringTheDeleteMarkRefuses, ...TombstonesAndRefusesReuse);
- incarnation: a claim check under generation G commits a re-marked G'
(TestCatalog_DeleteCommitIsBoundToItsIncarnation);
- lost CLI token: a rerun cannot release the earlier hold
(TestOpsChunk_VolumeDelete, real master, restart);
- CreateVolume drops workspaceMu before the create
(TestMarkVolumeDeleting_CreateHoldsTheReservationLock);
- the reservation directory's parent is not synced
(TestDeletionReservations_ParentSyncBeforeUse).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of dfc8f19 (codex01, V:/share/rdma/codex01-block152-r2-review-
20261116T0342Z/REVIEW.md). Controls failing against stubs restoring the
reviewed behaviour:
- P1: an unknown id's admission and a known record's ordinary
DeleteVolume leave CreateVolume free, also after a restart
(TestMarkVolumeDeleting_ReservesUnknownIdsAndSurvivesDeleteAndRestart).
- P2 persistence: the mark is intent-only (no write/sync); write,
rename and directory-sync faults and a restart lose it
(TestDeletionReservations_*).
- P2 rollback: a give-back (claim, held HEAD) leaves the master
exclusion in place; a lost admission response reads as a refusal
(TestCatalog_DeleteVolumeGivesBackOnALiveClaim, ...HeldAfterAdmission
GivesBack, ...LostAdmissionResponse, TestOpsChunk_VolumeDelete with a
real master: claim refusal must leave the id usable).
- P2 failed abort: B's failed tombstone write still frees the name, so
A's late publication survives a completed delete
(TestCatalog_FailedAbortCannotHideALatePublication).
- P2 concurrent deletes: D1's revert after D2 committed counts as a
give-back (TestCatalog_ConcurrentDeleteCannotRollBackACommittedOne).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(a) Admission at the master: LifecycleService.MarkVolumeDeleting holds
workspaceMu (every assignment, placement and binding write) and marks
VolumeRecord.Deleting inside RecordWorkspaceDeletion's check (refused
with live authority without a clean revocation ACK, a pending move or
a queued placement). Afterwards publication admission, the placement
reconciler, the workload planner, binding/placement/move RPCs and
CreateVolume refuse the volume.
(b) One HEAD write from the HEAD read (active or detached, not held) to
state deleting, chunks kept. Every read decides "held" afresh.
ChunkRemote.CASHead refuses to move a deleting or deleted HEAD
(ErrChunkHeadPrecondition + ErrChunkHeadDeleted), so no attach,
claim or restore revives it; EnsureVolume refuses it; Fork and
CreateSnapshot check the volume again after taking their claim/name
and back out.
(c) Claims read after (b): a live claim reverts HEAD (detached or
active, as before) and refuses with snapshot_claimed.
(d) Then every snapshot name, published or not (an unpublished attempt
gets an aborted tombstone), goes through markDeleting and is freed;
the fork claim is released and reported only when confirmed.
(e) HEAD becomes deleted (no chunks), VOLUME is marked deleted.
A failed delete reports what it did (admitted, headMarked, reverted,
snapshots, aborted attempts, claimReleased, completed, uncertain); the
CLI prints that with the error and exits nonzero. The CLI's admission
is MarkVolumeDeleting (QueryVolumeStatus is no longer used).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of 626c7de (codex01). One control per schedule, each failing
against a stub that restores the reviewed behaviour:
- P1 1: a holder that attaches before the HEAD mark's first read is
deleted (TestCatalog_DeleteVolumeRefusesAnAttachBeforeTheMark).
- P1 2: an attach that passed EnsureVolume revives a deleting/deleted
HEAD through CASHead (TestCatalog_DeletedHeadCannotBeRevivedByAClaim).
- P1 3: after the master's delete mark, an existing placement still
leads to an assignment, the reconciler places, the id can be created
and bound again (TestMarkVolumeDeleting_StopsLaterAssignment...).
- P2: a fork claim after the check is refused only after irreversible
writes (TestCatalog_DeleteVolumeGivesBackOnALiveClaim); a fork after
the mark installs (TestCatalog_ForkAfterTheDeleteMarkRefuses); a held
snapshot publication and a snapshot started after the mark escape the
delete (TestCatalog_DeleteVolumeCatchesInFlightSnapshots); a failed
claim removal is reported released, and the CLI drops partial effects
(TestCatalog_DeleteVolumeTombstonesAndReleases, TestOpsChunk_VolumeDelete).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude05's item (2026-11-16 02:39Z): `sw-block ops chunk volume-delete`
plus Catalog.DeleteVolume. Controls, failing against a DeleteVolume
stub that deletes nothing:
- an attached volume (HEAD held) and one the blockmaster reports in use
are refused with volume_in_use, nothing written;
- a volume whose snapshot a live fork claims is refused with
snapshot_claimed, nothing written;
- fork w2 from s1, delete w2: HEAD tombstone (deleted, no chunks),
VOLUME deleted, snapshots freed; DeleteSnapshot s1 then succeeds; the
id is never attached, recreated or forked to again; an incomplete
fork's claim is released; a rerun replays;
- an attach between the check and the tombstone wins (held caller);
- the CLI needs a volume and --master and refuses an attached volume;
- real service + real GC: exactly the chunks only w2 and S1 reach are
reclaimed, w1's HEAD and S2 stay readable.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict in cmd/sw-block/chunk.go resolved as the union: the usage
string lists cut|snapshot|snapshots|snapshot-delete|fork|detach|show|
gc|usage|retain, and the switch keeps #140's "gc" case with "usage"
and "retain".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>