Review: a second busy refusal lost the kick and fell back to the hourly
interval, so a snapshot session longer than the 30 s retry defeated it.
The kick now stays pending until a pass the volume does not refuse as
busy; every busy retry comes after the short delay. KickMaintenance
reports only a running loop (not a stopped one, nor one that ended on a
fence or lineage change).
Tests: busy -> busy -> success, then back on the interval; kicks during a
held pass coalesce into exactly one follow-up; the running-loop check;
the cut-cancels-cleaning regression bounds every wait and cancels and
joins its cleaning on failure.
Protocol contract (M8 timing change): MaintenanceOwner.tla gains the
kick, the session that makes a pass busy, and NoLostKick, with a negative
config (lost_kick: a busy pass drops the kick) that violates it; the four
existing configs keep their results. The design diagram gains the kick
and busy-retry edges; the ledger gains INV-MAINT-KICK-001 and
INV-MAINT-KICK-RETRY-001; the spec README records the run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner decision: automatic cleaning is on in v1. The holder's maintenance
pass already cleans through its own layout remote (holder-only, one
entry, refused while a snapshot session is open, the two-step conditional
removal, a cut or stop cancels it with bounded waits); it was behind
--chunk-maintenance-gc, off by default.
- --chunk-maintenance-gc defaults to true; =false is the one switch that
turns the cleaning off. The pass still runs every
--chunk-maintenance-interval (default 1h; 0 disables the whole pass).
- A snapshot deleted through the holder's control route kicks the
volume's maintenance loop for one pass now (kicks coalesce; the same
bounded pass). A kicked pass refused as busy (a cut session open) is
tried again after 30 s instead of an interval later. Retention's deletes
already precede the cleaning in the same pass; a delete made offline is
cleaned by the next periodic pass.
- Docs: operator guide, standalone deployment, and the spec README line
that called automatic GC opt-in.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lagged rounds only showed one write after the other (a 5 ms lag
against a ~1 ms conditional write), never a delete whose check and
removal overlap a reuse in flight. 128 rounds now release both kinds at
the same instant, with the same assertions whichever wins; the 8 lagged
rounds stay, for outcome coverage. The writers' 16 connections are kept
across rounds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cleaning is on by default, so the remover's DELETE and a successor's
REUSE of the same marked entry race in production. On a real weed, 16
writers per round (half DELETE with the entry's mark, half REUSE on the
metadata they read) are released together: exactly one succeeds at the
filer. A delete leaves no entry and every reuse refused; a reuse leaves
the entry unmarked under its session and every delete and other reuse
refused. Never both.
The fixture's readbacks fail the test on a read error (an unreadable
entry is never taken as absent), and each subtest bounds its setup and
readbacks with its own deadline.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A restore dies between its VOLUME and its HEAD; the operator releases it,
the snapshot is deleted and the name is taken by a new volume. The
abandoned restore's late HEAD create must be refused (the deleted HEAD in
its never-reused directory) and the new volume untouched.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The cutover removed the store's concurrent CAS test with the legacy
store. This one runs on the layout store against a real weed: 16
writers, each on its own connection, are held at the filer write until
all have arrived (after every client-side pre-read) and released
together, 4 rounds each, for HEAD updates at one generation, exclusive
HEAD creates, MARKs of one object entry, and conditional deletes of it.
Exactly one writer succeeds at the filer, the others are refused, and
the entry holds the winner's bytes; a delete with a mark the entry never
carried never succeeds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The store adapter needs no model only if the filer's conditional write
holds. On a real weed filer: a second exclusive create, a stale and a
future generation, and the right generation under another volume's
identity are each refused by the filer and leave HEAD's generation and
bytes unchanged; the same write with the true condition lands.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The cleaning has taken its HEAD view when the operator deletes a
snapshot: one HEAD update by nobody's lease that leaves the clean
activity open. The pass keeps every chunk its view named, never marks a
chunk a root still names (K6 checked at every mark), and ends; the next
pass removes the chunk only the deleted snapshot named.
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>
A new volume's primary hides its frontend until the master has recorded
every replica's store, so it answers the promotion probe "not
primary-ready" by design. Past its boot grace, the promotion gate took
that for a failed primary and fenced it, reassigning the volume. While the
master still awaits the volume's stores (read before the probe), and only
while the primary's own fresh slot is acceptable, the not-ready answer is
judged as the wait; an unreachable, ineligible or withdrawn primary is
still replaced. Fixtures that fail over an established volume now attest
its stores.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
85171f71 removed core/host/master/promotion_probe.go; the probe round
(core/host/master/probe_round.go) sets SyncAckKnown since. The row's
"Enforced in" cell still named the removed file, so
TestActiveInvariantRowsCiteExistingPaths failed (the -short CI run skips
internal/invcheck).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The re-send on a store record change held the last line in a local
adapter.AssignmentInfo variable, which the non-forgeability guard refuses
(only the publisher mints one). The stream now keeps a closure that
rebuilds the fact from the line it received.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
volume, replication: a fallen-out replica rejoins without an operator (role-call retry; degraded re-probe on by default without racing the live session)
The control slept a fixed time and could pass with no connection accepted
and dropped. It now waits for the listener's accept-then-drop and fails if
none happened; without the transport fix it fails at the store assertion.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A send or receive failure left session.conn in place, so a caller that
does not invalidate the session (the store learner) reused the dead
socket on every retry and never learned a restarted replica's store. The
barrier now detaches and closes the connection, as the catch-up and
rebuild senders do; the next barrier re-dials.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The learning barrier used the peer's connection from its own goroutine,
outside the work queue that keeps one writer per connection, so on an
exposed volume it could overlap the first ship. It is now a queue job on
that worker; it is queued only when there is room (it never saturates the
queue, which would degrade the peer) and retried otherwise.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
At bring-up the primary may install a peer whose replica does not listen
yet. The barrier that learns the replica's store then failed and degraded
the peer; nothing re-probes a degraded peer before a write, so its store
was never attested and a new volume never left creating. The store-learning
barrier now leaves the peer as it is on failure and retries in the
background (100 ms doubling to 2 s) until the store is learned or the peer
leaves.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A supporting fact cleared pendingSupport unconditionally, so a late replay
of an older line (its role call refused as stale) wiped the assignment a
newer fact left pending; the retry then admitted the newer listener but
never completed its assignment. A fact now clears or replaces the pending
assignment only when its epoch is the same or newer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fact's own successful role call released selfFenceMu before it
completed the supporting assignment, and facts run concurrently by design,
so a newer self-primary or excluding fact could cross: the old admission
then cleared that fact's primary watchdog or emitted an old marker. The
direct path and the retry now both complete through
completeSupportingIfCurrentLocked, which checks and completes without
releasing selfFenceMu: only while the desired role is still replica at that
epoch and no newer fact was seen. A newer fact records its epoch under the
lock before it acts, so it waits for the completion or supersedes it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The retry released selfFenceMu before completing a skipped supporting
assignment, and only supporting completions took the lock that ordered it,
so a newer self-primary or excluding fact could act in between; the retry
then ran supportingAdmitted for the old epoch (clearing the primary
watchdog) and emitted an old ready marker. The retry now completes under
selfFenceMu, and every fact records its epoch under that lock at the very
start of applyFact, before it acts at all (the watchdog runs before the
role call); the retry completes only while no newer epoch was seen. A newer
fact waits at that record until the completion is done. Only the record is
under the lock, so facts applied concurrently by design do not nest it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A mutex around all of applyFact deadlocked facts applied concurrently by
design (a replay worker beside the stream, a fact applied from inside
another's hook). supportMu now spans only the completion of a supporting
assignment, in the fact path after its role call released selfFenceMu and
in the retry (supportMu, then selfFenceMu), so an older epoch's completion
never lands after a newer one's. The retry completes the pending
assignment only while the host still wants the replica role at its epoch;
a newer fact moves that epoch or replaces the pending entry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When a supporting fact's replica role call failed, the fact returned before
the adapter took the line's identity and before the supporting admission
was recorded. The retry cleared the latch but never applied those, so with
no new fact the engine stayed at the old line. The skipped assignment is
now kept (pendingSupport) and the retry completes it once its role call
succeeds at that epoch, with the same steps as the assignment path. A new
mutex serialises applyFact with that completion (order: it, then
selfFenceMu), and every applied fact supersedes a pending one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After PrimePendingFor's identity check the registry lock is released
before OnAssignment, so the peer can be replaced in between. That window
is closed by the executor: every command the adapter issues runs through
the old peer's BlockExecutor and enters through beginAsyncOperation, and
UpdateReplicaSet stops a replaced peer's executor (stopped under its lock,
then in-flight work drained) before it installs the replacement and seeds
it. The lock graph on PrimePending now says so, and a test holds the
dispatch in that window (a package-private hook), replaces the peer at the
same lineage on another address of the same replica, and checks that no
late connection reaches the replica and the replacement keeps its session.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>