codex01's #159 P2-S2 and P2-S3 (tests only):
- TestWALWriterBatchReuseIsBoundedByTheDurableTail: the batch planner,
with a padding wrap, is refused while a release is in memory only or the
recovered bounds are pending (no head move, no padding written), and
accepted once the tail is persisted.
- TestWALStoreRecoverBoundsPersistFailureRefusesAppendsUntilRetry: a
failing superblock write or fsync fails Recover and admits no Write; a
same-instance Recover retry persists the bounds; a later Write, Sync and
reopen keep the exact bytes.
Mutation controls (WSL): reverting only the batch planner's durable-tail
check fails the batch test alone; publishing the tail before Recover's
persist, or dropping the pending flag, fails its own control.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A full checkpoint persists head == tail (88fbb345 persists the released
tail). Sync does not persist the head, so appends after it continue
contiguously from that position; recovery now scans [pos, end) then
[0, pos) from it. The footer high-run search stays only for the legacy
(0, 0) superblock. Scanning from offset 0 let a torn unsynced record
wrapped there hide every synced record after it.
Model check (claude05's WALRecovery.tla, rule rootLww = this writer and
scan plus #156's replay by LSN, K=4, 4 LSNs): crash-only I1 and I2 hold
(247,395 distinct states).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the released tail persisted (88fbb345), a full flush persists
head == tail. Sync does not persist the head, so synced appends follow it;
recovery's head==tail path ignores the persisted position and scans from
offset 0 when no high run is found, so a torn unsynced record wrapped to 0
hides every synced record after it (claude05's S3 trace shape).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude05's ruling on the S3 torn-wrap finding (2026-11-16 07:33Z), root
fix: the WAL writer may only overwrite bytes released by the PERSISTED
superblock tail, so a torn new record can never land inside the persisted
[tail, head) and hide a synced record behind it (crash only, no
corruption).
- walWriter.durableTail: the tail of the last fsynced superblock. The
space checks (append, appendBatch planning, admission pressure) count
from it; a release made only in memory frees nothing. Bounds rebuilt by
recovery are not reusable until persisted.
- The flusher's checkpoint persists the tail it releases (the old code
persisted the pre-advance tail and advanced after), with head and tail
taken from one writer snapshot. A flush whose checkpoint is already
covered (direct frontier) still persists its tail release.
- Recover persists the rebuilt head/tail before any append when they
differ from the on-disk superblock.
The replay-side defense (resync past a bad entry, replay by LSN up to
the first gap) is #156.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude05's ruling on the S3 torn-wrap finding (2026-11-16 07:33Z): the
writer may only overwrite bytes that the PERSISTED superblock tail has
released. On main the flusher persists the pre-advance tail and the
in-memory tail moves after it, and Recover moves the writer's bounds
without persisting them, so a torn new record can land inside the
persisted [tail, head) and hide a synced record behind it.
- flusher.afterSnapshotForTest: a test-only hook in the window after the
dirty-map snapshot (an append there is covered by the persisted head
but not by the checkpoint).
- TestWALStoreAppendDuringFlushThenTornWrapKeepsSyncedRecords: the S3
trace, deterministic; crash only; synced LSN 2 is lost on main.
- TestWALStoreFlushPersistsTheReleasedTail, TestWALStoreRecoverPersists-
TheRecoveredBounds: the on-disk tail lags the writer's.
- TestWALWriterReuseIsBoundedByTheDurableTail: an in-memory release
makes its bytes reusable at once.
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>
- Master: a deletion reservation store (core/lifecycle), separate from
the desired-volume records, so an unknown id is reserved too and the
ordinary DeleteVolume/CreateVolume path cannot clear it. Held by
per-delete tokens (admitted), permanent once committed. Writes reuse
the binding store's crash-safe pattern (synced temp file, atomic
rename, synced directory); an unknown outcome keeps a protective
change in memory (fail closed). MarkVolumeDeleting records it under
RecordWorkspaceDeletion's check; new AbortVolumeDeleting and
CommitVolumeDeleting. Every gate (publication admission, reconciler,
workload planner, binding/placement/move, CreateVolume) consults it.
VolumeRecord.Deleting is gone.
- Catalog: Admission is Admit/Commit/Abort; ErrNotAdmitted marks a
definite refusal, anything else is an unknown outcome
(admissionUncertain). Every give-back aborts this delete's admission.
A commit point (HEAD deleting -> purging, conditioned on the HEAD
read) precedes the irreversible steps; a revert races on the same
write, so a delete that sampled a claim cannot undo another delete's
commit, and reports an error instead of a give-back.
- CreateSnapshot's back-out settles its name like the delete does: the
name is freed only after the attempt's tombstone or winning
publication is confirmed.
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>
- Catalog.DeleteVolume refuses a volume in use (an active HEAD with a
holder, or the caller's InUseCheck: the CLI asks the blockmaster
whether it is assigned or served) with volume_in_use, and a volume
whose snapshot a live fork claims with snapshot_claimed, before any
write.
- Then: HEAD becomes a tombstone (state deleted, no chunks) by a
conditional write on the HEAD read, so an attach in between wins;
VOLUME is marked deleted; every snapshot goes through markDeleting
(the one mark path) and its name is freed; a fork's claim on its
parent is released. GC reclaims (the tombstone holds no roots; the
snapshots drop out after grace). A rerun finishes a partial delete.
- A deleted id is never reused: EnsureVolume (attach, create) refuses a
deleted VOLUME or HEAD with volume_deleted, and so does Fork for a
deleted target or source (the source checked after the claim).
- storage: HEAD state "deleted"; the HEAD decoder accepts it only with
no chunks, holder or detachedBy.
- CLI: sw-block ops chunk volume-delete <vol> --chunk-filer --master;
gc and volume-delete share masterEvidence.
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>