The workspace record writer copies the line's incarnation, so a lease or
journal write no longer erases it before a reload; a queued refresh for
one process is replaced when another reports at the same address; the
RefreshEndpoint transition names the restart case.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A heal, a planned or workspace move or an operator's request names no
incarnation; the publisher records the one the target reports now, so
the promoted process's first report re-issues nothing. The volume's
refusal of a line issued for another process now comes before anything
of it is recorded.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A primary restarted at the same epoch and address started its sessions
at 1 while each replica held the dead process's higher one, so every
session was refused as older. The line now records the process it was
issued for (durable); a current primary reporting another process is
re-issued its line at the next endpoint version, and a primary adopts no
line issued for another process.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lane-routing harness gets a store, and the ingress version test
starts from a replica that holds 1..119, so their live entries arrive at
the next LSN.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its image could not be brought up to date, and the latch clears only on a
completed rebuild: a probe or fencing round answer from it is never
ready, so no promotion (automatic, the operator's failover or a planned
move, each requiring the target's ready answer) can make it primary.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A replica removed and added back with its older store cannot be rebuilt
on v1 (its BASE is still installed). The store now returns the typed
storage.ErrRebuildRetainedBase, the replica listener keeps that refusal
until a rebuild completes, and the volume host reports it on its
heartbeat slot as rebuild_retained_base (ineligible), naming the replica.
The operator guide gives the recovery: wipe the data directory, re-add.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Live-ship and recovery session ids came from two process-wide counters;
once the live counter ran ahead, the replica refused every recovery as
older. Each replica now has one order, kept by the volume across its
peers and executors, and every session toward it takes the next id.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The recovery begins with BeginEpochRecovery, so the primary's live
session stays admissible and only the invalid epoch table can refuse its
frames; a recovery begun and ended is the control. The test is its own
package so its sessions do not reorder another test's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
While a recovery owns a replica's store its epoch table is invalid and its
end may sit above a gap. Such a replica is never a fencing round's target,
also with the highest end, and never completes a sync_all or sync_quorum
write.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The copy into $SWBLOCK_TEST_LOG_DIR moves to an untagged helper, so a
filesystem-only test runs with the ordinary suite: a log longer than the
kept output is copied byte for byte, an unset directory copies nothing,
and the check refuses a truncated copy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The volume's listener always has the apply gate installed, and the gate
checks each block's staleness, not the position, so the live-lane rule
applies on both paths. The tests build the listener as the volume does,
on walstore and smartwal, and check that no live entry lands while a
recovery owns the store.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Inside an epoch, a live entry above the store's next LSN is refused and
the connection closed; the primary's catch-up from the barrier end then
applies the gap in order. Fixtures that shipped hand-picked LSNs now ship
at the store's next LSN.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review: the catalog reader converted the entry's seconds to nanoseconds
without a range check, so an out-of-range mtime (year 9999) wrapped to a
negative time where the HTTP reader had reported it unknown (0). The
conversion is guarded; the master reader's refusal table has the
out-of-range case again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1 reads HEAD through the layout catalog. A unit or script that still
passes the removed flag is refused at start with a typed error
(errRemovedInV1) that names the replacement, --chunk-filer and
--chunk-path, rather than Go's generic unknown-flag message; the flag
is never accepted and ignored.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 'starting' latch could outlive a frontend that opened and failed
between two samples, excusing a real failure. It is gone: the probe answer
reads the replica-store wait before its readiness (the frontend gate reads
the same value), so a not-ready answer names the wait only if the wait
held, and a stores-complete assignment opens the frontend only after the
peers' expected stores are installed. The gate is a guard in the ledger
(INV-PROMOTE-CREATION-WAIT-001); the probe round's copy of the field is
tested on the wire.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The master read HEAD two ways with two settings: the layout catalog
(filer gRPC, --chunk-filer) for create and restore, and plain filer HTTP
?metadata=true (--workspace-head-base-url) for the workspace move admission
and the revoke ACK. The workspace reader now reads through the catalog it
already dials: BCatalog.ReadHeadObserved returns HEAD, decoded by the same
DecodeLayoutHeadEntry, with the entry's modification time from that same
lookup (seconds, as the HTTP metadata gave it). The proof mapping is
unchanged: identity from the master's lifecycle record, deleting, unclaimed,
detached, generation, epoch, holder and position; an absent HEAD refuses
with ErrHeadAbsent.
The HTTP reader and --workspace-head-base-url are deleted, with the unit's
and the env file's setting and the docs. The master tests run the same
refusal table against a catalog on the in-memory filer (the HTTP-only
redirect and envelope cases have no counterpart). The fixtures that passed
the flag give the master the filer flags instead; the head-size and F1
ladder masters had none and could not dial the catalog at all.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The operator's fencing round may fence survivors above the line whatever
it decides, and an allowed decision may still fail to publish: the fence
is now pending from the attempt until a line reaches its epoch. The
unsupported gate continues the line's own primary at e+1 on a pending
fence before any candidate check, as the supported gate does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The stores-complete assignment set the awaited count to zero before the
frontend opened, so a probe in between answered not ready without the
awaiting epoch: the shape the master reassigned. The line now stays
"starting" from its wait until its frontend has opened on it (seen by a
probe answer or a heartbeat); a later not-ready answer is a real one. The
epoch, the counts and that start are one value under one lock, so a probe
never pairs a new epoch with an old count.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A reachable RF3 sync_quorum primary's move is a planned move again and
stays refused for want of a seal; only the operator's failover of an
unreachable primary is decided on the fencing round. Adds the test where
the operator's failover and the master's promotion loop decide the same
volume at once: both fence at the same next epoch, one line is published.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The promotion gate excused a new volume's not-ready primary from the
master's own reading of the creation wait, which a master restart forgets
and which ends a moment before the primary opens its frontend. The fact's
owner now reports it: the probe answer carries the epoch of the primary's
assignment that still awaits replica stores, and the gate excuses a
not-ready primary only on that answer for the current line and while its
own fresh slot is acceptable. The master-side wait check is deleted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An operator failover whose primary has no fresh, reachable heartbeat (a
lost host) is no planned move from a live primary: it is now decided on
the fencing round for RF2 as for RF3 (one path, basis Fenced). A failover
from a reachable RF2 primary stays planned; best_effort stays refused.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A planned move of an RF3 sync_quorum volume needs a seal (its target is
not in every acknowledgement set), so the operator's failover was refused
and a volume whose primary host is lost could not be moved at all. The
fencing round is that seal: the failover now fences every other replica at
the line's next epoch and publishes only on the round's decision (enough
fenced survivors; the target holds the highest fenced end and is ready),
with basis Fenced. A refused round leaves the fence pending so a returning
primary is continued at e+1. RF2 and sync_all stay planned moves.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>