TestTheFirstCutAfterWritesDoesNoPerCandidateWorkInThePause: the first cut
after writes to many chunks must do no per-candidate operation between the
barrier's lock and its release, at 32 blocks and at the 1 TiB shape with
256 changed chunks (fails: 73 and 1,600 operations; the candidate step,
the known-equal filter, versions, the base refs and the copy-order hint
all run in the pause).
Seam: chunkCutStats.PauseCandidateOps, counted while a pause flag is up.
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>
The window no longer sorts the candidates and makes one entry (with its
channel) per candidate inside the guest pause. It keeps the candidate set
and the staged marks (immutable once installed) and makes a chunk's entry
on its first touch: a guest write's save or the copier. Side-file slots
are handed out in touch order. After the pause, the copier lists the
covered chunks that a pre-copy does not hold and no touch has finished.
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>
- A fill's install (absent to present) touches its chunk: a fetch that
outlived a same-open recovery installs HEAD's bytes with no clean mark,
and the full scan made that chunk a candidate; now the touched set does
too (TestAFillThatOutlivesARecoveryMakesItsChunkACandidate, which fails
without the touch).
- Under this package's tests every barrier runs the full scan as an oracle
(candidateOracle, nil in production) against the barrier's candidates
with l.dirty and allDirty; a chunk it finds that the set missed is a
finding. The whole package runs with 0 oracle findings.
- chunk_layer.go carries the table of each predicate input that moves and
what touches the chunk, including the clears that need none.
- The cut body (/chunk/cut) and the status schema carry CandidateVisits and
PreSyncNs.
- The unknown-outcome guard compares the remote's full images (any store
format) and asserts the injected cut's outcome is unknown.
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>
INV-WAL-V3-CAPTURE-CANDIDATES-TOUCHED-001 states the touched set and the
pre-barrier sync; the v1.1 notes carry them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The barrier's candidate step no longer walks the chunk map, nor the
absent and clean-fill maps. It judges the members of a touched set, a
chunk bitmap with a per-word summary (1 bit a chunk), with the same
predicate the map scan used: (UNKNOWN and not known equal to HEAD) or
above remoteLSN, minus absent chunks with no local write. The barrier
takes the set by a pointer swap; readers (status, precopy, the record
shadow) list a copy.
- The set is a superset of the chunks whose answer may have changed: every
map entry change (OnMapEntryChange: a write's LSN, UNKNOWN by a direct or
BASE mutation or a reused LSN), every version move, a HEAD install's
changed refs (a whole install: the clean fills whose ref changed; a
commit: its changed chunks), a recovery (every clean fill), and a
once-per-layer seed on first use, outside the pause: every entry UNKNOWN
or above remoteLSN, minus absent chunks with no local write.
- The cut syncs the store once right before its barrier, outside the
pause (PreSyncNs, apart from BarrierPauseNs), so the pause's own sync has
only what came after it.
- A test fixture that forgets clean-fill marks as a restart now touches
those chunks, as a restarted layer's seed does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- An idle cut's candidate step must visit at most the summary words plus a
constant (counted, not timed) at 4,096 and 262,144 chunks (the 1 TiB SPACE
shape); a one-chunk cut likewise (fails: the step visits every map entry,
4,097 and 262,144).
- The cut must sync the store before its barrier, outside the pause, and
report that time apart (fails: no sync before the barrier). A control
checks the counter sees the pause's own sync.
- Guards, passing today and kept: an unknown commit outcome that did not
land loses no chunk (its chunks and a later write are published by the
next cut, nothing else changes); the candidate set's OR-back keeps the
summary and each lists exactly the set bits.
- Seams: chunkCutStats.CandidateVisits, counting the candidate step's
current visits, and PreSyncNs.
The candidate set type (a chunk bitmap with a per-word summary: set O(1),
walk O(C + S/4096), OR, clear) and the record runtime's take/return of it
come from an earlier parked branch, rebased onto the one-byte record codes.
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>
After a v1.0 store's upgrade with no clean-stop seed every whole local
chunk is unknown. The v1.1 attach now runs the compare pass (resuming at a
persisted cursor, or starting when the record holds an unknown chunk); it
compares each unknown chunk with HEAD by the cut's own transitions. A stop
never waits for it: the pages and cursor of the work done are persisted
and the next attach resumes. Until it ends, a cut, snapshot, backup or
sealing detach is refused typed (ErrUpgradePassInProgress, HTTP code
in_progress) and the pass runs at full rate. Holder status reports
Stats.UpgradePass {State, Compared, Total, Outcome}.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TestV11UncleanUpgradeLeavesNoUnknownAfterThePass: a v1.0.x store attached on
the v1.1 format with no clean-stop proof (an unclean stop) opens with every
whole local chunk unknown; the attach must then run the compare pass, which
leaves none unknown: chunks equal to HEAD end published with HEAD's hash, a
chunk that differs never with HEAD's hash. Fails on main: after 20 s all 16
chunks are still unknown, because the pass has no production caller.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The payload time sums several intervals (staging, the copy, the upload);
three that each ended below the clock's tick read zero although together
they took up to three ticks, so one floor on the sum overstated the rate.
Each interval now adds at least one tick to an unexported floored sum
that the rate divides by; the reported payload time is unchanged.
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>
samplePrecopy recorded a rate only when the round's payload time was
nonzero, so a round whose upload ended below the clock's resolution gave
no rate, and three such rounds left the estimate "samples_unknown". The
payload time is now floored at the coarsest clock resolution (1 ms): the
rate of a fast round is a lower bound, never missing or infinite.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>