swblock_v11_format now turns on the draft v1.1 store format;
swblock_lab_bigvol lifts only the create cap and the headroom refusal.
A build with the format tag names itself in its revision
("LAB BUILD(swblock_v11_format)"), so the image refusal keys on it as it
does on the cap tag, and the CI tag check refuses either tag outside its
allowlist. CI tests each tag alone and both together.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The provider refuses the removed names and, under every selector and
before any selector comparison, a volume carrying their magic (SWAW;
SWPW in either header slot), reading the file read-only and never
modifying it. blockvolume --durable-impl and the launcher refuse the
names with the same advice; the chart schema allows walstore only.
- core/storage/smartwal, core/storage/parallelwal and
cmd/sw-block-testutil (whose one command corrupted smartwal records)
are deleted, with the helm smartwal-corruption scenario and the
parallel-walstore gate script.
- The replication harness runs on walstore; tests that ran on a removed
engine only because a stub needed some store move to walstore, and the
state_convergence label test moves to the in-memory BlockStore.
- sw-block cluster.check drops the removed engines' cases.
- Ledger: INV-OPEN-REMOVED-ENGINE-REFUSED-001 and
INV-OPEN-REMOVED-ENGINE-NAME-REFUSED-001, an OpenRefused edge in M1, and
the rows citing the removed tests updated. Docs: block-design 1.3 now
describes the removal, the smartwal deep-dive and figure are gone, the
scripts default to walstore, and the v1.1 notes carry the removal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A lab build's revision carries LAB BUILD(swblock_lab_bigvol), so -version and
the volume's /status show it. Every image Dockerfile runs
scripts/refuse-lab-binary.sh right after its go build: a binary that is a
lab build, or cannot answer -version, stops the image build, so neither
the publish workflow nor the image scripts can push one. lab-tag-check.sh
now fails closed: an allowlist of the files that may name the tag (git grep;
a scan that cannot run fails), plus the wiring (each Dockerfile refuses
after its last build; the publish workflow builds only from those, with no
go build of its own). Controls cover each contamination and the refusal
script's stand-in binaries. The lab headroom test asserts the warning, and
both invariant rows name the lab exception.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A DORMANT row's code and test exist (the ledger legend), so the
invariant tests now require it to name a test and its cited .go paths
to exist, as for ACTIVE rows, and count it in the status log.
TestInvariantRowsNameExistingTests failed for the 11 DORMANT rows
before this change.
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>
The runtime stores each volume in one content-named layout on the filer:
immutable chunks, segments and roots are ordinary filer files, and one
HEAD entry per volume carries every conditional commit. A holder claims
HEAD under its granted epoch and claim id, cuts in its own session,
commits by HEAD generation and position, and is fenced when its identity
moves. Catalog, restore, snapshot, retention, cleaning, verify and volume
delete run through the layout kernel; the master mints the layout
identity, reads HEAD proofs and holds the delete reservation and lease
barrier. The legacy store, its intents and its compatibility paths are
removed; existing stores are recreated, not converted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every pull request that added a row edited the hand-kept count line, so
each merge to main re-conflicted every open pull request. The check now
prints the count and fails if the file states one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A line starting with "<<<<<<< " or ">>>>>>> ", or a line that is exactly
"=======", in docs/design/invariants.md or the lists invcheck reads fails
the test with its file and line. The marker check is pinned on a fixture
that holds a conflicted region and two look-alikes it must not report.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
INV-WAL-DATA-SYNC-001 becomes five rows of one property each (automatic
sync choice, explicit override, status, allocation at create, prezero).
Three clauses with no test of their own are listed as enforced by
reading. Every statement in the ledger is now at most 300 characters.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Seventeen over-long rows of the local WAL store (format v3) become 92 rows
that state one property each, every statement at most 300 characters.
Clauses that only repeated a Part A transition guard point to that
transition; the write-admission wait gets its line in the table of bounded
waits. The long-statement list shrinks from 18 to 1.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Eleven over-long rows (authority store, workspace lease, forced move and
lost range, operator confirmation, frozen-request validation, host cut
budget, replica per-LBA rule, RF=3 promotion) become rows that state one
property each, every statement at most 300 characters. Clauses that only
repeated a Part A transition guard now point to that transition. 185 rows
become 216; the long-statement list shrinks from 28 to 18.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
docs/spec/README.md gains an Exhausted bounds table: one row per spec with
a configuration TLC explored completely, its bounds, its distinct state
count and what the model leaves out. internal/invcheck checks every row
(the spec and configuration exist, no cell is empty) and that every spec
has a row or is in a list that only shrinks (21 today). Eight rows are
added from results the README already states; nothing was re-run.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The list's size is pinned by a constant and, where the base commit is at
hand, every listed row must have been listed there. The head-belt fence
row again says the re-read owner is compared with the publisher's own.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Ten over-long rows of the chunk cut, workspace and GC machines become
rows of one property each (statements at most 300 characters); clauses
that only repeated a Part A transition guard become pointers to it. The
invariant check gains a length test with a list of the rows still over
300 characters, which may only shrink. Two test comments lose a
reviewer reference.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Three stale test names it found are fixed (one rename, one test removed
with the retired engine and replaced by its neighbour, one name that
exists nowhere). The count check accepts the document's wording.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Fail when a row names a test that does not exist, an ACTIVE row names no
test, an ID repeats, or the stated row count differs from the tables.
Three ACTIVE rows named removed tests; drop those names (each row keeps
its other tests).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* test(G1): red - a restarted replica applies a ship below its acknowledged epoch
fencing-gaps-todo.md G1, red test first, as the doc describes it: a
listener accepts a ship at epoch 2, is stopped and restarted on the same
store, and a ship at epoch 1 arrives. Today it is applied: the floor was
in memory only.
Adds the seam the fix uses: NewReplicaListenerWithFloor(addr, store,
floorPath), which cmd/blockvolume now uses with
<durable-root>/<volume-id>.replica-floor (empty for memback). floorPath
is ignored in this commit, so the test is red on behaviour.
Stacked on the G2 branch (it reuses G2's epoch floor).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(G1): a durable replica epoch floor, and no mutation before the role is known
fencing-gaps-todo.md G1, per the plan accepted on #83 (claude03; codex01
rounds 1-3).
- core/transport/floor.go: a versioned, volume-bound floor record,
strictly decoded (unknown/duplicate/missing fields, trailing data, wrong
schema or volume, over 4 KiB refuse); persisted by temp write+fsync,
rename, directory fsync, each checked; InitReplicaFloor creates the
bootstrap record (epoch 0) before the volume and never replaces one.
- Listener: NewReplicaListenerWithFloor(addr, store, volumeID, floorPath)
loads the record (missing or invalid refuses) and starts unassigned:
every mutating frame is refused until a role call succeeds. A frame
whose epoch raises the floor persists it inside its G2-counted section
before any effect or ACK (a barrier too); serialized under floorMu and
monotonic; a refused frame leaves the lineage unchanged.
FenceAsPrimary drains, persists, then returns; AdmitAsReplica persists
first; both return the error.
- Host: AdmitAsReplica errors fail the supporting path closed; any failed
role call sets an admission latch that makes the projection unhealthy
(writes refuse even on a prior-healthy host), reported in /status;
a later successful role call clears it. SetSelfFence returns the
replay error and cmd/blockvolume then does not serve.
- cmd/blockvolume: the floor record is created before a new volume
(DurableProvider.VolumeExists), and required on every later start.
Tests: the red test, revised to the accepted 3-phase form (epoch-2
barrier ACK; restart refused before assignment; a stale epoch-1
admission still refuses epoch 1; current epoch accepted), barrier-only
restart, fresh restart before assignment, record negatives and the
existing-empty missing-record refusal, per-step persist failures on
ship/barrier/rebuild, role-call persist failure incl. after a drain,
fence-then-crash, concurrent monotonic raises, probes never persist, and
the admission latch through the real StorageBackend. Each mechanism is
load-bearing: without persistence 5 tests fail, without the startup gate
2, without the latch 1. Ledger: INV-FENCE-FLOOR-DURABLE-001.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(G1): stale role replays never reconcile a newer failure; the floor record's key set is closed
codex01 review of 66446e0:
- R1: a stale successful role call (e.g. an epoch-2 replay after the
epoch-3 persist failed) cleared the admission latch and reopened
writes. The host's desired role is now monotonic in epoch: a role call
below the current desired epoch is refused as stale, without
replacing the desired role or touching the latch; only the current (or
a newer) epoch's success clears it, and install replay targets the
retained current role.
- R2: encoding/json struct decoding accepted case variants, so
{"epoch":7,"EPOCH":0} loaded as floor 0. The key check now runs before
decoding and accepts exactly schema, volume_id and epoch, case-sensitive,
none repeated.
Red (66446e0's floor.go and host.go) / green: codex01's two controls;
the stale-replay cases on the primary, supporting and install-replay
paths; uppercase keys, case-folded duplicates in both orders and a
case-folded schema key refuse; canonical epoch 0 stays valid. All 23
G1/G2 tests pass 3/3.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* test(G2): red - a promoted host applies the deposed primary's ship
fencing-gaps-todo.md G2, red test first. A real ReplicaListener and the
real Host.applyFact primary path: ship at epoch 1 to listener B, master
promotes B to primary at epoch 2 (a self AssignmentFact), the old primary
ships at epoch 1 again. Today the ship is applied.
Adds the seam the fix uses: Host.SetSelfFence / fenceSelf call the
host's own listener on the primary path (after UpdateReplicaSet, before
OnAssignment) and on the supporting-replica path, and replay an already
adopted role when the listener is installed later (cmd/blockvolume wires
it before Serve). The listener's FenceAsPrimary / AdmitAsReplica are
no-ops in this commit, so the test is red on behaviour.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(G2): a new primary fences its own replica listener
fencing-gaps-todo.md G2. The replica listener gets an epoch floor and a
primary flag. FenceAsPrimary(e), called by the host on the primary path
before OnAssignment, sets the floor to at least e and refuses every
replication mutation; AdmitAsReplica(e), on the supporting-replica path,
re-admits replication but keeps the floor. acceptMutationLineage, the
single gate for ship, recovery lane start and rebuild block/done,
applies both. Probes are unchanged.
Green: TestG2_PromotedHostRefusesShipFromDeposedPrimary (real
Host.applyFact primary path + real listener) passes 3/3; new listener
tests: a primary refuses ship / recovery lane start / rebuild but answers
probes; the floor stays after AdmitAsReplica and never goes down.
Ledger: INV-FENCE-SELF-ON-PROMOTE-001.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* style(G2): gofmt replica.go field alignment
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(G2): the fence drains replication mutations already past the gate
Review of cc884db (claude03 P2-1, codex01 P1): acceptMutationLineage
released r.mu before the store write, and FenceAsPrimary only flipped
flags, so a deposed-epoch ship or rebuild admitted just before promotion
was applied after the fence returned, while the host served as primary.
Each mutating frame (ship, recovery lane start, rebuild block, rebuild
done, barrier) is now counted under r.mu from before its gate check until
its storage effect is done; its ack is written after it is uncounted, so
the fence never waits on the network. FenceAsPrimary sets primary and the
floor (no new admissions), then waits for the count to reach zero, bounded
(10 s); on timeout it returns an error and the host fails closed: no
OnAssignment, as for an UpdateReplicaSet failure; master redelivers.
Lock order: Host.selfFenceMu -> ReplicaListener.mu, never the reverse;
r.mu is held only for gate state and the counter (Cond.Wait releases it),
never across storage or network calls.
Red (fence without the wait) / green: in-flight controls for ship (direct
and ApplyHook paths) and a rebuild base write fail, then pass 3/3; a
mutation stuck past the bound makes the fence report an error; the host
does not adopt primary when the fence fails.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* docs(protocol): track epoch/fencing gaps G1-G5
Opens a TODO for five fencing gaps found while reviewing the epoch
protocol at b1ff581. G1-G3 are confirmed by reading the code (replica
floor in memory only, new primary does not fence its own listener,
production promotion runs without a required ACK frontier). G4 is a
design decision (no primary lease). G5 needs a test first (caught-up
check has no epoch). Each item has the failure scenario, the proposed
fix, and the red test to write first.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs(protocol): record the G4 decision (option A, non-claim for alpha/beta)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>