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>
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>
Priming and the adapter lookup were keyed by ReplicaID. A dispatch the loop
admitted for an old degraded peer, delayed while a lineage bump replaced the
peer under the same ReplicaID, then primed the new healthy peer's adapter,
whose probe raced the volume's live session again. The registry now keeps
the exact peer each adapter was added for; PrimePendingFor and
AdapterForPeer compare it under the registry lock, and a mismatch primes
nothing and sends no wire probe.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test waited for its registry adapter to probe the new peer right after
the add, which is the adapter acting on a healthy peer the volume's live
session owns. It now checks the adapter has issued nothing at the add and
wires the probe loop as the binary does (priming on the first dispatch for
a degraded peer); its degrade, recover and replay assertions are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the degraded-peer probe loop on, the per-peer adapter registry primed
each new peer's engine at the add, and the engine's assignment probe and
fence ran on the replica with sessions of their own while the volume's
seed barrier and live ship owned it. The replica keeps the newest session,
so it refused the volume's own barrier as stale and the next write missed
quorum. The registry now records the identity at the add and primes the
adapter only on the probe loop's first dispatch for the peer, which comes
only once the peer is degraded (its live session failed and was
invalidated); that first dispatch is the adapter's own probe, not a second
one. With the race gone, --degraded-probe-interval defaults to 5s, so a
replica that fell out of the volume rejoins without an operator.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A replica whose floor could not be persisted (a full or read-only disk)
latched its role failure and stayed out of the volume until an operator
restarted it. The host now re-applies the current replica role with
backoff and clears the latch on success; a refusal that a retry cannot
change (ErrRoleRefused: the ingress is closed, or the volume refuses
replica peers) keeps its reason and is not retried.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The move of the ship order to the store keyed on the listener role, which
a primary fence sets before the move runs. A refused move followed by a
replay of the same line skipped it, and so did a genuine primary after the
excluded-replica path had fenced the listener as primary only to close
ingress. The host now records 'ship order prepared' itself: cleared when
it takes a replica role, set only after a successful move.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An initial replica replaced during the wait (a new replica id) is no
longer waited for: the count is over the current replica slots, and the
wait is cleared for good the first time every current replica has a
recorded store, so a later replacement never closes the volume again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A host whose replication slot does not count peers by recorded store
counts no peer ack, so the creation wait does not close its frontend.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The frontier-0 store barriers run in parallel after UpdateReplicaSet
releases v.mu. A replica refused for an unrecorded store stays Healthy with
its learned store, so the next attestation records it with no operator.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test's gate fake fenced its survivors without saying their evidence
was read, so since a fenced answer counts only on a read, valid table, it
had no survivor and the failover it asserts never came.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A replica applies entries through replication, so its store's next LSN
moves while the write observer's ship cursor stays where the observer was
installed. Promoted, its first local write waited in the LSN resequencer
for an entry that never comes as a local write, and every write after a
failover failed at its deadline. On a transition into the primary role
(listener fenced as primary, frontend not serving yet) the host moves the
ship cursor to the store's next LSN.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A peer counts toward write ACKs only while its barrier store equals the
store the master recorded for it from a primary's attestation, carried in
the replica descriptor; empty never matches, and the peer's own word never
changes it. A record change re-sends the assignment at the same
generation and the primary updates expected stores in place.
A volume's first bind records its initial replicas: until each has an
attested store the fact carries the awaited count, the primary serves no
frontend I/O and reports "creating: waiting for replica attestations
(n of N)"; the primary learns new peers' stores with a barrier at LSN 0.
Replica rows show store_attested/store_id.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An unacknowledged replica's ack does not complete a sync_quorum flush
(it does once its store is acknowledged). The first-heartbeat window's
defect is pinned by a skipped red test: a fresh primary with healthy
replicas must fail no flush before its first acknowledged heartbeat.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Where the primary attests its write-ACK stores (every heartbeat of a
volume host), a Healthy peer counts toward write ACKs only once the
master has acknowledged the attestation naming its current store. A peer
rebuilt onto a new store still answers barriers (that is how its store
is learned) but does not count until that store is acked, so it can
never be the only holder of an acknowledged write that a promotion
cannot verify. The host passes an acknowledged attestation to the
replication volume after each successful heartbeat.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An answer whose epoch table is absent, or whose evidence could not be
read, reported no table and so was never marked invalid: it counted
toward N-K+1 with end 0 and could let a lower end become the target.
A fenced answer (and the heal's own answer) now counts only when its
evidence was read on a present, valid table, from the attested store.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>