A grant whose attach failed and whose authority was then lost returned to
the wait without a new pause, so the master's resumed wait could read as a
stall. The pause now starts whenever authority is missing and ends at each
grant, before the local attach.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review fixes. The provider ends the stall window's pause when authority is
granted, before the local attach, so a stuck attach is a stall again; the
first authority wait latches silence that already filled the window, so the
pause cannot hide it and its end cannot erase it. The held-sync and
held-attach tests release their holds before Close on every exit, and the
real prezero gets a sync seam with an order and a failed-sync control.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The startup inactivity window renewed only on replay, scan, map and attach
work. A new store's prezero and the WAL fence wrote and synced whole
regions with no report, so on a slow disk the window could end inside one
silent step; and the chunk layer's wait for master authority, a wait the
master bounds, ran out the same window.
- storage: phases RecoveryCreate and RecoveryFence; syncedSlices runs a
sized step 4 MiB at a time and reports a slice only after its sync;
prezeroNewStore uses it, and recovery reports the fence's synced bytes.
- durable: create passes RecoveryProgress; AuthorityWait tells the host
when the authority wait starts and ends; Chunk.AuthorityGap names the
projection fields that withhold authority.
- host: recovery_timeout becomes recovery_stalled; waits are counted, the
window pauses while any runs and restarts when the last ends, a stall
latched before stays latched; /status RecoveryWait=awaiting_authority.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runTransition now runs the format level guard first (it refuses only a
raise of HEAD from version 0 to 1 below level 1; stamping never changes
the version, so a refused write is never stamped), then the write-time
snapshot stamp, then the write check. The stamp tests run a v1.1
holder's cut at level 1; the v1.0 landing control pins v1.0 whatever the
package mode. Both invariant rows are kept.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict in docs/design/invariants.md: main added INV-FE-NVME-CANCEL-001
where this branch adds INV-NVME-RETRY-DELAY-001 and
INV-NVME-HOST-BEHAVIOR-001; all three rows kept.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SetHeadFormat reports whether the remote took the format; the provider's
wrapper answers false over a remote without it, so a v1.1 attach refuses
before anything local is written instead of upgrading behind a v1.0
writer. A provider test over the real layout store proves the assigned
level decides the stored HEAD bytes across a restart.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict in core/frontend/nvme/session.go: main added the rate-limited
write-failure log before the completion status; this branch computes the
status through the session (negotiated retry delay). Both kept: the log,
then s.completionStatus(res).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The host keeps the format level of every assignment no older than the
newest, the frontend projection carries it, and the provider attaches the
chunk layer at it (absent = 0). At level 0 the attach reads HEAD first: a
version-1 HEAD runs v1.1 (reported behind), a v1.1 store under a
version-0 HEAD is refused, anything else stays v1.0. A v1.1 attach over a
remote without the HEAD format is refused. The layout's one HEAD write
path refuses a write that raises HEAD from version 0 to version 1 below
format level 1, whichever writer tries; writers supply their level in
their context. The running format is in the chunk stats.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A chunk layer decides its format once at attach from its config's
FormatLevel and the store's marker: level 1 upgrades a v1.0 store; level
0 keeps it on v1.0; a store already on v1.1 at level 0 is served over a
version-1 HEAD (reported as format_level_behind_volume) and refused over
a version-0 HEAD (format_level_behind_store). The layout remote's HEAD
format follows its layer (SetHeadFormatV11) and reports the version it
read (HeadV11). Every production attach is level 0 until the assignment
carries the master's level, so a release build keeps writing v1.0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The no-flush busy path observes the store only through a bounded
snapshot: the checkpoint at the busy write, the target, the retry log
and the timeout diagnostic, which reports the last observation (or
"unavailable") instead of a fresh read. The busy-path check is a
function the burst test calls, so a control drives it with the store
lock held across the deadline at each observation, and released early.
The wait's control gains an early-release case that must return the
advanced checkpoint, a lower bound for the held case, and joins every
fake read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The passive wait's checkpoint read takes the store's read lock, which a
checkpoint publication holds across its descriptor I/O; a stall there kept
the loop from rechecking the write's retry deadline. The wait is now
passiveCheckpointWait, with every read through boundedRead (a read still
blocked at the deadline ends the wait, reported as blocked), and no read is
started after the deadline.
TestPassiveCheckpointWaitIsBoundedByItsDeadline: a read blocked behind a
held lock, and a checkpoint that never advances, each with the flusher
always in a cycle, end at the 300 ms deadline; with the read unbounded the
first case hangs until the test's timeout.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runTransition stamps each snapshot without a publishing generation with
the write's generation whenever the result is a version-1 HEAD, and a
write check refuses a version-1 HEAD with an unstamped snapshot. Reads
stay tolerant. A v1.1 commit's new snapshot and an upgraded volume's
legacy snapshots can now be deleted by their captured target.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The passive check after the first busy write gave the checkpoint a fixed
10 s. A flusher cycle on a slow or loaded disk can take longer: with a
cycle slowed to 14 s the test fails exactly as on CI (bytes=60424192,
cp=0, busy=1), and at 5 s the checkpoint advances 1.8 s into the wait with
no further write. The 10 s window now counts from the last moment a
flusher cycle was in progress (FlusherInstrumentation), up to the write's
retry deadline; a completed cycle that did not advance the checkpoint
does not extend it. The log and the failure print the flusher's cycle
counts, so a next failure tells a slow cycle from none.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict: core/frontend/durable/provider_chunk.go imports only (main
dropped math/rand/v2; this branch's EachSegment fallback uses math).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HEAD's version followed the manifest size: a v1.1 commit by change over a
HEAD without a recorded size (an upgraded volume's first cut) left it at
version 0, a HEAD a v1.0 binary would read. A v1.1 commit now writes
version 1 whatever it knows of the size (CommitRequest.V11, set by the
layout remote on the v1.1 format), and a version-0 HEAD carrying a v1.1
manifest size is refused like one carrying ext.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A startup that ends on a HEAD written by a newer version exits 78
head_newer_version instead of the restartable 75 (a restart reads the same
HEAD again), and a fatal open of a store written by a newer format exits 78
store_format_newer instead of 1. The provider latches the newer-version
refusal per recovery, beside the identity refusal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- hostlimit: Config.YieldAfter (S, default 5 min). ShouldYield answers yes
only for a Normal hold at least S old while another cut on the host holds
a live ticket this process has not judged stalled (dead tickets are
reaped on the way); the probe runs only once the hold is old enough and
takes no limiter lock.
- storage: a cut attempt asks at each staging batch boundary and ends with
ErrCutYielded, keeping what it staged; CutsYielded counts it, never as a
failed cut.
- durable: a yielded attempt is retried at the next poll with no backoff,
on a ticket at the back (it was admitted), counted in status (CutYields)
and not logged as a failure.
- blockvolume: --host-limit-yield-after. Invariants: INV-HOST-CUT-YIELD-001;
M7 states the rule. v1.1 notes carry it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Seams: Config.YieldAfter (S, default 5 min), Limiter.ShouldYield (never,
for now), storage.ErrCutYielded, storage.BudgetYield, ChunkLayerStats.
CutsYielded and CutScheduleStatus.CutYields.
- TestShouldYieldOnlyAfterSWithALiveWaiter: a Normal hold yields only once
it is S old and another process holds a live ticket; never a lone hold,
never before S, never an urgent hold, not for a ticket judged stalled.
Fails here: no hold ever yields.
- TestCutYieldsAtABatchBoundaryAndKeepsItsStaging: a cut whose budget asks
it to yield ends at the next staging batch boundary with ErrCutYielded,
counted as a yield, not a failure, publishes nothing, and its staged
chunks are kept for the next attempt. Fails here: the cut never yields.
- TestChunkLoop_AYieldIsRetriedAtOnceAndCountedApart: a yielded attempt is
retried at the next poll, never backed off as a failure, and status counts
it apart. Fails here: the retry came 1.1 s later.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the v1.1 format the layer keeps HEAD's identity and its chunks in the
ref table only: the attach reads HEAD one segment at a time from a
segment reader (ChunkSegmentReader; the layout remote is one), every
install fills the table from a HEAD read whole, and the paths that need
the whole image (adoption, owning, the detach cancel, the publication
report) build it from the table. A cut's result reports HEAD's identity
only; no production code reads its chunks (a scan test guards it), and
tests read the remote's installed HEAD. The held heap at 1 TiB's chunk
count is 174 B/chunk (442 before) and is asserted at most 200.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>