Fold of the #248 review:
- the v3 seed logs after the capture and lifecycle locks are released,
and names its intervals for what they include (lock wait, store mutex
and validation, data sync incl. sync serialization, checkpoint publish);
- the HEAD claim logs its start before the claim's own HEAD read and its
elapsed time on failure; the observed HEAD is logged as an observation;
- a close during the attach retry backoff ends the wait as closed, not
superseded.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- master slow store: each held Put takes a generation; a renewal is credited
with the generation it read before its call, so a reply computed before
the hold never releases it. slow.release() runs as the first cleanup, so a
held Put cannot block the publisher/extender joins after a failure.
- authority WritersExtendersClose: only grants of calls that started after
the extension write was held count (flag set before the hold blocks).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- core/host/master TestWorkspaceLeaseGuardSurvivesSlowAuthorityStore: each
lease write is held until a renewal succeeded during the hold (slowness by
progress), three held writes must complete, a sampler records any fence;
replaces the 2.5 s sleeps and the 10 s watch. A renewal that waited for the
store would let the guard lapse and fail the test at once.
- TestWorkspaceHeldRenewalBoundary, TestWorkspaceMoveRestoresLazilyAndFencesOldHost:
the test context has no wall-clock bound (3 s / 10 s); each step completes
or the go test timeout reports the hang. The guard's own RPC timeout stays.
- core/authority TestWorkspaceLeaseConcurrentRenewalsWritersExtendersClose:
wait for the held extension write and for renewals under it by progress
(were 5 s / 2 s bounds); joins after release unchanged.
- waitExtenders joins the finite extenders without a 10 s bound.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A deferred chunk attach was silent from the end of local recovery until
it served or failed. Log:
- entering the authority wait, with the projection fields that fail;
- the first attach attempt, once the projection carries authority;
- an attach that found authority gone again;
- the HEAD claim start (observed HEAD gen/epoch/holder/state/remote LSN
and the target epoch/holder) and its end with the duration;
- how the wait ended (attached after N attempts, fenced, closed,
superseded, or assignment unavailable with the fields still missing);
- the v3 seed's lock wait, data fsync and checkpoint publish durations.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The flag help and the ChunkDirtyThreshold comment still described the
cut as it was before copy-before-write: "bound on one cut's barrier
copy" and "0 = unbounded".
Since the chunk copy moved out of the barrier, the value is the number
of candidate chunks above which a cut pre-copies (stages) chunks before
its barrier, in rounds of that size, and 0 disables pre-copy
(chunk_layer.go, stage: a bound <= 0 returns without staging).
Text only. No behaviour change.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The no-host-validity refusal in RenewWorkspaceLease formatted its error
from lv.d.horizon after releasing leaseMu, while the extender
(refreshLeaseViewLocked) rewrites the view under leaseMu: a data race.
The horizon is now read before the unlock.
Test: TestWorkspaceLeaseRefusalReadsTheViewUnderTheLock drives the
refusal while the view is republished concurrently; under -race it fails
on main (workspace_lease_view.go:174) and passes here.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review fold (P2 cleanup, test only): an idempotent release and bounded
joins of the started workers are registered with t.Cleanup before any
worker starts, so a Fatal while the replay is parked cannot leave it
running past teardown. A join timeout is reported as an error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review fold (P2, tests only): the positive RF1@3 steps now write and read
back through a backend at the epoch-3 identity (exact n, nil error); the
stale-RF2 test requires a successful write. New two-worker test: the replay
worker's RF1@2 parks in the peer-set update, the stream worker's RF2@3 is
refused meanwhile, then the replay resumes; bounded by timeouts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review fold (P1): the refused epoch and reason were separate atomics, so an
allowed RF1@2 replay could pass the stale check, a stream RF2@3 latch the
refusal, and the replay then clear that newer refusal. The epoch, reason
and the highest admitted RF1 epoch are now one unit under rf1Mu (field
access only). admitRF1 clears and adopts only if no newer refusal was
latched; otherwise the fact is not adopted. P2: a refusal below an
admitted RF1 epoch is stale and does not re-latch. Deterministic test with
a hook between the stale check and the admit; stale RF2 test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review fold (P1): the refusal had no epoch, so RF1@2 -> RF2@3 refused ->
a stale RF1@2 replay cleared it and reopened the old healthy view. The
host now records the highest refused epoch; an RF1 fact below it is stale
(not adopted, refusal kept), and the refusal is cleared only after the
role fence of a current-or-newer RF1 fact succeeds, never by a failed
attempt. Test with a real backend write schedule; ingress rows for legacy
and dual-lane, and no listener after the RF1 primary role.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Test-only hooks: DetachVolume's StopIO can be replaced (the repeat and
retry tests now force and observe the failed-drain branch instead of
racing a cancelled context against a finished drain); the detach's cut
and settlement deadlines are traced (the budget test checks 3/4 of the
freeze, then the bound); the backend signals an I/O passing its
readiness check right before the I/O lock (the drain test's arrival
handshake replaces a 100 ms non-completion window, with bounded
receives).
- The delayed detach CAS worker is joined, bounded, also on failure.
- chunkErrorCode: the detach sentinels decide before a catalog-error
cause; the table rows now discriminate that order (no storage CAS
sentinel behind them).
- Invariants: INV-WS-DETACH-ABORT-001 and INV-WS-DETACH-FREEZE-001, and
the M4 transition Holder (detaching) -> Holder.
- Mutants (declared, 10/10): plus a catalog cause deciding before the
sentinels; the whole-budget cut is now caught by the deadline check too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- P1: every failed detach is settled before anything resumes, a failed
drain included. A repeated detach after a successful one (or with a
cancelled context) returns the first result and stays stopped, and a
retry over an unresolved detach CAS stays stopped while the outcome is
unknown. The StopIO failure path used to resume unconditionally.
- P1: one freeze budget covers the drain, the final cut and the
settlement (the cut gets three quarters, the settlement the rest); the
settlement no longer adds 10 s of its own. The bound is cooperative
(contexts), as documented.
- P2: the resume does not restart the periodic cuts after a concurrent
Close (or a replaced layer); ErrDetachOutcomeUnknown maps to
outcome_unknown explicitly, before its cause.
- Tests: the two P1 cases and the budget case (red on 26426dd5: resumed a
detached volume, resumed over an unknown CAS, 10.4 s for a 400 ms bound);
a detach CAS genuinely delayed until after the cancel then fails its
precondition; the drain test now checks that the resumed write queues
behind the admitted one and that recovery succeeds.
- Mutants (declared, 9/9): plus a failed StopIO resuming without the
settle, the settlement with time of its own, the cut taking the whole
budget.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review fold (P2): SetReplicationVolume replays a retained RF2 fact before
SetSelfFence installs the ingress gate; with no self fence the host could
install the peer set, adopt and emit readiness. The rule now lives in the
host config (RF1Only, from hostConfig at construction): every fact with
replica slots, primary with peers or supporting replica, is refused before
UpdateReplicaSet, adoption or the ready marker, and latched as a role
admission failure; an RF1 fact clears it. The ingress gate stays as the
second layer. Tests: the start schedule (blocked readiness, stored RF2 fact,
replay with no self fence), supporting refusal, RF1 recovery, unset control;
ingress refusal with dual-lane on both ports, classified by
ingressPortReleased; hostConfig wiring.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>