P1: f1WaitAdopted took any log line containing "address already in use"
as a taken port. It now passes the attempt's four drawn addresses to
bindTakenOn, which accepts only Go's listener error ending a line,
"listen tcp <addr>: bind: address already in use", with <addr> one of
them; a different port or host, a dial, a quoted copy, text after it, udp
or the bare words are not a taken port, so the start fails as before.
P2: the retry starts as blockvolume-<key>-attempt2, so the first attempt's
log is not truncated, and startWithBindRetry returns the first attempt's
error, which the test logs (address and log path) before the retry's
answer.
Red: TestBindTakenOnOnlyThisAttemptsListener fails with the previous
substring rule; TestStartWithBindRetry checks attempt numbers and the
kept first error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
handoffAddress drew from [10000, 20000) whatever the host's ephemeral range;
it now cuts the range at the host's ip_local_port_range low end
(handoffRange), as the weed port pairs already do. F1's holder start
(f1Up) answers errBindTaken when the holder exits before adopting with
"address already in use"; startWithBindRetry then draws the holder's four
ports again and starts it once more (v1, whose ports the cluster spec
names, is not retried). Any other failure, or a second taken port, fails
the test as before.
Red first: TestHandoffRangeStaysBelowTheEphemeralRange (a host whose
ephemeral range starts at 15000 must get [10000, 15000)) and
TestStartWithBindRetry (a taken port, then ok: one retry with fresh
ports) fail with the previous behaviour and pass here.
Refs #927.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first write after the holder reports its frontend ready can still be
answered namespace-not-ready for longer than a host retries (measured
18 s with retries on a shared runner). That is a product finding tracked
in #905 and a v1.1 release gate; the test keeps running and reporting on
every job, and the fix removes this marker.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failure before the release no longer strands Publisher.Run: a cleanup,
run before the master's close, releases the hold and joins the admission's
return within 10 s.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A heartbeat may report several volumes: each gets its read level, not
only the first. A test seam on the publication admission holds a real
admitted bind while a downgrade is reported; released, the same ask is
refused by the format check. The layout-ready guard names the admission's
new inner function.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Read levels are kept per (server, volume): a server runs one process per
volume, so a later report for the volume is its process restarted or
replaced. A silent process's entry stays while the server still serves
its volume (a placement, a live line); it leaves only on a retire, when
the volume is no longer served and the process has been silent past the
freshness window, or on a newer report for the same volume. The
publication-boundary test calls the admission directly with a recording
publish.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fail if no hand-off went to a worker's later admission: the skip-window
bound applies only to those, so without one the test would pass checking
nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TestOneStalledTicketCostsOneSkipNotEveryHandoff failed under load with
gaps [581ms 11ms 4ms 8ms 11ms 4ms]: each worker (its own limiter) judges
the stalled ticket on its own clock, which runs only while the slot is
free, so a worker whose clock started late pays its one skip on its first
turn. The skip-window bound now applies to a worker's later admissions
only (paying the skip again); the failure prints each gap with its worker.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A server's per-volume processes may run different binaries: the read
level is kept per process (its heartbeat slot's incarnation) and a server
reads the lowest any of its processes reported within the freshness
window. A heartbeat is judged on its own process's level.
The final publication boundary and the promotion gate check the target
server's current level, so an ask decided before an old process reported
is not published.
A level-0 grant clamped to the horizon is now + the time left to it, so
the deadline (read by the level-1 barrier after a finalize) keeps the
monotonic reading.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An unseeded upgrade writes the pass's first cursor before the store's
marker, so a crash before the pass's first persist still resumes it. The
attach prepares the pass (and makes a rebuilt page's rewind durable)
before the layer's hooks and the record's due loop start, so a rebuilt
page cannot be republished as valid under the old cursor. The barrier
hook also yields to a stop; the rewind test checks the cursor on disk
while the pass runs; the superseded test checks the published bytes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- TestStalledEarlierTicketIsSkipped: instead of passing within 700 ms of
the start, no attempt passes before the skip time and the first attempt
begun after it passes (a 50 ms allowance for the skip judge's clock);
the attempts' start times are printed. A loaded host's late polls no
longer fail it (1.155 s seen on CI).
- TestUrgentProceedsPastAStalledProbe: the admission runs with an outer
bound of ten hold waits (a block behind the probe would never return)
and must take at least its hold wait, instead of at most hold wait +
300 ms (1.153 s seen on CI).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After start the registry only loses entries: the operator's retire
removes a host that holds no volume, and a retired id is then
unregistered, so the identity checks only get stricter. Adders stay
start-up only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The harness already copies each failed test's full daemon logs to
SWBLOCK_TEST_LOG_DIR (keepFullLog), but the workflow never set it and
uploaded nothing, so a failure's evidence was lost with the runner's
temp directory. Set the directory and upload it, with every shard's
JSON, log and status, as an artifact on failure (14 days).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The open records the first chunk of the earliest page it rebuilt (the
kernel's cursor_back); the pass rewinds there, durably, before any request
is admitted. With no cursor a pass starts only after an unseeded upgrade
by this attach or a rebuilt page: chunks unknown only because they were
written after their page are dirty, and cuts take them, as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hosts report the format they read (heartbeat reads_level). The cluster's
format level is the master's attestation file's form: v1.0's bare map is
level 0, the envelope (format 2, format_level 1) level 1.
At level 0 the master keeps v1.0's semantics, so a v1.0.x master started
on the store stays safe: renewals clamp to the persisted horizon and an
extender keeps it current; forced moves and re-grants wait for the later
of horizon and deadline plus skew; records are envelope version 1.
sw-block cluster finalize-format raises the level in one durable step
(the envelope write), refused while a registered host has not reported
that it reads level 1; then the publisher switches under both its locks.
At any level no new work goes to a host that reads below it; its
heartbeat is refused binary_too_old; every assignment carries the level.
sw-block cluster retire-host removes a host that holds no volume.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TestOneStalledTicketCostsOneSkipNotEveryHandoff bounded each hand-off's
idle gap at a fixed 200 ms, which a loaded runner exceeded (295 ms). A
hand-off that paid the stalled ticket's skip idles at least the skip
window, so that is the bound now; the failure prints every gap.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A page rebuilt at open leaves its chunks unknown again behind the pass's
cursor (completed or partial): the attach now rewinds the cursor, durably
and before the layer admits any request, to the first unknown chunk. A
chunk written between the pass's read and its hash is superseded by the
write: not hashed, not counted as compared, reported (Superseded); it is
dirty and the next cut takes it, also after a restart. A failed attach
joins the record writer it started. The pass tests hold the pass at a
barrier inside a compare instead of racing a timed walk.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tick-floored payload sum was an unexported field of ChunkCutStats, so
the layer statistics grew a field the cut body does not mirror (the
mirror test counts every field). The cut now keeps the sum locally and
hands it to samplePrecopy; ChunkCutStats is unchanged from main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tests that assert the record state an upgrade leaves (unknown chunks, a
seed, a crash at each step, a stale page) and the heap measurements now
attach with no compare pass (withoutUpgradePass): the pass would move the
state they read, or only slow a measurement of a large sparse volume.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The status schema's generated block comes from the code: the hand-written
rows are replaced by the generated ones, with the field comments on
UpgradePassStatus.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An attach after an unclean v1.0 upgrade runs the compare pass and refuses
cuts until it ends, so the attach helper now waits for it as it waits for
reconciliation (its own bound: a 262,144-chunk test volume takes seconds).
Tests that act while the pass runs opt out (withoutPassWait).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>