TestWALStoreV3SlowExtentKeepsReclaimMoving flaked on a busy Windows
host: a single slow fsync pushed one bounded cycle past its 500 ms
admission budget (attempts of 500-577 ms, against cycles whose writes
take about 77 ms). The slow disk is now 5 ms per extent write and the
budget half a whole-map cycle from the measured sleep (about 1.2 s): a
bounded cycle (about 160 ms of writes) leaves room for a slow fsync,
and a whole-map cycle (about 2.4 s) still outlasts the budget.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
createWALStoreV3Configured recovered the new store with a background
context, so the fence of that recovery reported no progress although the
provider passes RecoveryProgress on create; on a slow disk the startup
window could end inside it. It now recovers with the options' observer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TestLeaseRefusalKinds measures v1.0's barrier (65 s after the grant) and
assumed a fresh master is at format level 0; a new cluster now starts at
level 1, whose barrier is the lease deadline plus the skew (50 s). The
test runs on an existing (upgraded, not finalized) cluster's store and
asserts level 0 before the BARRIER case; the level-1 barrier stays
covered by TestTheForcedBarrierFollowsTheFormatLevel.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps both sides: #939's finalize-format exit codes and JSON answer
beside the format-level read in sw-block cluster_format.go, and #939's
typed move refusal (text plus reason) with the move target refused only
on a known-old report (placementTooOld), whose reason is binary_too_old.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The restart test pins the durable completed compare record before the
reopen and counts zero compares across the restart and its first cut.
A publication control with two servers reporting the same slot at
different endpoints shows the ownerless grant judges the server at the
ask's endpoints: level 1 granted, level 0 refused, unreported not granted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A store created at format level 1 writes its upgrade-pass record as
done at creation, so it never runs the compare pass, also when it
restarts before its first cut. A publication whose line has no recorded
owner is judged on the server whose live observation reports the ask's
slot at its endpoints, not on an empty server id. The format-eligibility
invariant row names the heartbeat-recording test and states the
placement/grant split; the RDMA failover test's hosts report their
reads level before any grant.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A cut that took a recovery's clean-fill request and aborts (its copy
window cannot install) reissues the request under a fresh generation:
a new red checks the next cut still covers the fills. The ordering row
takes the approved wording: a reader clears by a CAS on its own
generation, a barrier takes the request before the set, and an aborted
cut reissues it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A new volume's store (an empty HEAD, every chunk local and zero) is
unknown only because its upgrade had no seed; the first cut takes its
chunks as candidates. The procedures' first snapshots were refused
in_progress by that pass. A restart before the first cut runs it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Waiting for the held slice and for the recovery's return is bounded, and on
every exit the test releases the hold, joins its recovery worker (bounded)
and only then closes the store, so a regression fails the test instead of
hanging it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
A flag bound to the same variable let a partial parse overwrite the mode:
--json --bogus --json=false answered in JSON and the reverse did not. The
flag is now declared for parsing and help only; the mode is the arguments'
last --json, read before parsing. Both orders are pinned, with no RPC.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A newer recovery request published while an older reader is between
listing and clearing must stay pending: a new red pins the reader's
compare-and-swap on its own generation. The paused reader is released
and joined by a cleanup that runs before the hook and oracle resets on
every exit, and both reader tests run in a bounded child process.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A v1.1 store with no unknown chunk and no rebuilt page starts no upgrade
compare pass and holds no cut, cursor or not: a fresh volume's chunks are
absent, so a new cluster's first snapshot runs at once (the process-level
procedures were refused in_progress). A heartbeat is accepted and its read
level recorded whatever it reads; an old binary is refused at the grant.
Test fakes that stand for v1.1 hosts in other packages report reads_level 1.
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>
publishCheckpointV3 already sets the checkpoint and retires every dirty
entry at or below it under the store lock; its owned-map caller walked
the dirty map a second time for nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The publication boundary checks the (server, volume) entry of the
process that will serve the volume, never the server's lowest level
over its other processes: a sibling's report says nothing about this
process's binary.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The JSON mode is read before flag parsing, so finalize-format and
ops workspace move answer in JSON (and send nothing) when a malformed or
unknown option comes before --json. force-move --json gets its own controls:
the typed reason from the refusal's detail, and none for a refusal whose
message only contains the reason's text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Placement (create, move, restore target, a failover candidate) refuses
only a host known to read a lower level, typed BINARY_TOO_OLD: with one
process per volume and create-then-start a placement target cannot have
reported yet. The grant (an authority line published to its holder)
needs the holder's own report at the cluster level; no report, no grant.
awaiting_first_report stays only as a status state; its refusal reason
is gone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Recovery replaced any fenceSliceHook for the fence and then cleared it,
so a hook set by its caller saw nothing. It now calls that hook first and
restores it afterwards.
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>
A recovery asks the next touched-set user to touch every clean fill. A
reader cleared that request before its touches reached the set, so a
cut in between saw neither and judged without the fills. The request is
now a generation: a reader clears it (compare-and-swap) only after its
touches are in the set, and the barrier takes the request before the
set, so a cut sees the request or the touches. A reader's listing of the
touched set copies the non-empty words under the set's lock and lists
their chunks after releasing it, so a barrier's take waits only for the
copy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lifecycle stores (volumes, nodes, placements, deletions) open before
the format decision and count: an empty authority store over an existing
inventory is not a new cluster and starts at level 0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LifecycleService.FormatLevel answers the cluster's format level (a
viewer's read; sw-block cluster format-level). A master that finds no
prior authority state writes the level-1 envelope before it serves;
existing state keeps its level, so only a cluster holding v1.0 data
needs the finalize. Above level 0 a node that has not reported its read
level is refused new work typed and retryable (AWAITING_FIRST_REPORT),
and the cluster status shows it awaiting report. The master tests' fake
hosts report reads_level 1 as a v1.1 host does; the FormatGate upgrade
tests start from a store in v1.0.x's form.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The held-checkpoint control now also drives the production flushOnce, in
a bounded child process of the test binary: a drain that repeats its
batch is killed and reported at the bound. The leader-wait control moves
to its own bounded child, so its worker is always received before the
store's cleanup and a stuck one dies with the child. An injected fence
write error takes the real WriteAt error's path (one wrap and latch).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The held-drain controls run the drain loop on the test goroutine with a
cycle bound, and the leader-wait control joins its worker before the
store's cleanup on every path. The fence's slices are checked at their
fsync (the counter holds only the completed slices there), and a second
slice's zero write or fsync fails through test seams: no credit for the
failing slice, no completed fence recorded, the store latched.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A script must not parse message text. finalize-format now exits 0 for
finalized or already finalized, 2 for a refusal, 75 when the master cannot
be reached, and 1 for any other failure (a failed write of the format
record included); --json prints result, reason, hosts, format_level and
message for every outcome. The master's refusal carries each refused host
in its ErrorInfo metadata, and a failed attestation write is Internal, not
Unavailable.
A move onto a host whose binary reported a read level below the cluster's
carries the typed reason BINARY_TOO_OLD; ops workspace move and force-move
show it in --json.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The status schema's generated block takes its descriptions from the
fields' comments: the checkpoint step fields now carry them, and the
block is regenerated (STATUS_SCHEMA_UPDATE=1) instead of hand-edited.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fence stays a zero fill (a punched WAL would make the next lap's
appends allocating writes, each fsync committing metadata); the hole
punch is removed. The fill now runs in 4 MiB slices, each written,
fsynced, and only then counted (FenceZeroed) and reported to
fenceSliceHook, the per-slice recovery-progress hook: a recovery over a
slow disk shows progress every slice and the journal never takes the
whole WAL as one burst. The repeat skip stays: a new volume's second
recovery does not fill again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dead-recorder twins wrote a large stdout but one short stderr line,
so removing only the stderr fallback still passed. A fake Go that writes
10,000 stderr lines now runs with a recorder that dies after 100 bytes,
and with no recorder at all (no such interpreter); each keeps Go's own
exit 0 and 7, and dropping the stderr fallback turns the suite red.
The sampler stop test's wait for its stand-in is bounded (10 s) and
fails at once if the stand-in exits before it is ready.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fenceV3 is also called on a bare store (a test of the restore frontier);
the repeat key needs the descriptor publisher, so without it the fence
runs and records nothing.
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>