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>
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 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>
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>
In the pause, a cut now syncs (H), takes the touched set and the dirty set
by pointer swaps, and opens the copy window over what they name (a
superset of the candidates, a lookup per chunk). Everything per candidate
runs after the pause, under the window: the judgement (WAL entries up to
H), the known-equal filter, each candidate's version, staged reuse, the
record shadow check, the base refs, the copy-order hint and the
HEAD-behind refusal. The window then narrows to the candidates.
- A candidate's version at the barrier is read atomically with the write
path: the version a guest write's save recorded with its bytes, else the
live one under the window lock. The window closes on a chunk only after
its version is read and it is uploaded.
- A refusal before the judgement returns the taken sets (touched again,
the dirty set rejoins l.dirty). After it, the existing requeue does.
- A pre-copy attempt keeps its drained frontend drained through the
judgement and decides its freeze on the judged tail, as before: its guest
pause runs to that release.
- The record shadow check exempts chunks written since the barrier (the
live touched set): the record already counts those writes.
- PauseCandidateOps counts per-candidate operations while the guest is
paused; it is 0 for an ordinary cut. The cut body and the status schema
carry it.
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>
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>
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>
With neither --memory-limit-mib nor GOMEMLIMIT, a cgroup v2 limit that
cannot be derived (a membership outside the cgroup2 mount of the holder's
mount namespace, an unreadable or malformed memory.max) is the no-limit
case: the holder keeps the 256 MiB default and starts, instead of exiting
2. applyMemoryLimit, run once logging is configured, logs one level=WARN
line naming the derivation's error and the two ways to choose a limit, and
status reports the reason in Memory.SoftLimitFallback (empty otherwise).
Only an explicit but invalid limit still refuses.
Docs: the flag's help, the operator guide's memory section, the status
schema and the v1.1 notes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A holder whose cgroup v2 limit cannot be derived (its membership is
outside the cgroup2 mount of its mount namespace, or memory.max is
unreadable), with neither --memory-limit-mib nor GOMEMLIMIT, must start
on the 256 MiB default and record why (fails: exit 2 on the derivation
error). An explicit but invalid flag still refuses.
- Applying that limit must log exactly one WARN naming the reason and the
two ways to choose a limit, and status must report the reason; a derived
limit logs nothing (fails: no WARN, status empty).
- Seams: flags.memoryLimitFallback, applyMemoryLimit (now called after
logging is configured), ProcessMemoryStatus.SoftLimitFallback,
volume.SetSoftLimitFallback / SoftLimitFallback.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tests that pinned the removed horizon (barrier at the persisted
issue+1.5*TTL, extension writes and their status counters) now use this
process's deadline (or restart floor) plus skew. The golden wm lost range
is the same file: the master restarts half a lease after the issue, so
both versions' barriers are the same instant.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The envelope's volumes are checked on the decoded map (a later key of
another case can null it after a key probe), and a v1.0.x file that is
null is read as no attestations, as v1.0.x read it, so its envelope says {}
and the next start reads it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The controller never bound a once-reported static volume on Linux, so the
test now creates and places a volume through the lifecycle, ingests its
holder's heartbeat, settles the observation host (started == done, no
buffered wake, no timer due), runs the product tick (the master runs none
by itself), which binds the volume, and requires a build after that point:
only the line-change hook can take it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An envelope already on disk is fsynced (file and directory) at every start
before the master serves: an earlier start may have renamed it in and
failed its directory fsync. master.New releases the store lock when the
envelope cannot be made durable or the attestations cannot be read. A
format-2 file without an explicit volumes object (missing, null, wrong
type) is refused rather than read as no attestations; v1.0.x files with
volumes named format or volumes are still read as bare maps.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Before it serves, under the authority store's lock, the master writes
store-attestations.json as {"format":2,"volumes":{...}}. A v1.0.x master
decodes that file as a bare map of volume records and returns the error
from New before it listens or publishes. This master reads the envelope
and v1.0.x's bare map (rewritten as the envelope at start) and refuses a
later format. The authority record's version 2 alone does not stop a
v1.0.x master (its loader skips such a record); the test is renamed to say
it fails the v1.0.x decoder.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A renewal grants now+TTL from memory and writes nothing: the persisted
horizon, its clamp, its background extension and its counters are gone.
A forced move, an expired re-grant and a delete's no-live-lease proof wait
for this process's deadline plus skew (its latest grant, or after a
restart the restart floor it already set at load); no lease value an
earlier process wrote is read. An authority record's envelope is now
version 2, which a v1.0.x master refuses (it would trust the record's
stale lease expiry); this master reads versions 1 and 2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The observation host counts the rebuilds it takes (in the step that takes
the wake) and the rebuilds it finishes, and records when its armed deadline
timer fires, all under its lock; BuildsForTest returns them with whether a
wake is buffered. The master test settles on started == done with no
buffered wake and no timer due, records N, ingests one heartbeat (build
N+1, v1 supported and unbound), and after the controller's publication
requires build N+2 to carry the line: only the hook can take it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ObservationHost.BuildsForTest reports the builds completed and whether a
wake is buffered or a build is running. The test settles the host before
the heartbeat, requires the heartbeat's build to be a new one, settles
again after the controller's publication, and then requires the line in a
build after that point (or in the settled last build, which can only have
come after the publication).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test now drains the initial build and the grace's rebuild before the
one heartbeat, whose single wake is consumed by the build showing v1
supported; the controller binds after it, and with no heartbeat, expiry or
GC tick left, the build carrying the line can only come from the hook.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NextDeadline keeps the pending grace's end until ExpireDue reports it,
even once past, so a build taken just before it and submitted just after
it is rebuilt with no heartbeat. The property test now fires the host's
timer only at NextDeadline, so a dropped deadline shows. A master test pins
the line-change wiring: a volume reported once is bound by the controller
and the next build carries the line. Comments that promised a wake on
every ingest now say what wakes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The observation store wakes a rebuild only when an ingest changes what a
snapshot build reads: a new server, a server's facts or freshness, a slot
added, removed or changed but for its timestamps, a slot's expiry state, a
volume two servers report, or a passed deadline. What changes with time is
a deadline: each server's next expiry in a heap, the pending grace's end;
the host wakes at the earliest. A published line wakes the build through
the publisher's line-change hook.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The publisher indexes its lines by volume, kept by the one writer of its
state, so every per-volume read (the workspace line, the authority line,
the bound replica, the published epoch, the promotion basis) costs the
volume's replicas, not every line. A register, ACK or move reconciles the
bindings of its own volume and of any volume whose reconcile failed before;
the start still reconciles every volume.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the v1.1 format a full commit writes the sum of its root and segments
as HEAD's current_bytes and the named snapshot's manifest_bytes. A commit
by change subtracts the base root and the replaced segments and adds the
new ones, with no lookups; an unknown size stays unknown. Snapshot
listings report manifestBytes, null when unknown. The format doc states
the ext contract; a test bounds the fullest HEAD under the inline limit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SeaweedFS names a full store only to the assign that tries to grow a
volume, so one object's retries and a cut's upload batch keep that answer
over plainer failures. A real-weed integration test fills a tiny store and
checks every round of concurrent uploads answers remote_full. The ledger
gains the remote_full and LastCutFailure rows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SeaweedFS's assign answer for a store with no writable volume and no free
volume slot is classified as ErrChunkRemoteFull on both assign paths; the
routes answer it as remote_full (503, retryable after capacity is added),
apart from remote_unavailable. Every failed cut, requested or scheduled,
sets the layer's LastCutFailure (code, cause, time, repeats), cleared by a
success; the holder logs one WARN per change of code, not one per retry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The provider refuses the removed names and, under every selector and
before any selector comparison, a volume carrying their magic (SWAW;
SWPW in either header slot), reading the file read-only and never
modifying it. blockvolume --durable-impl and the launcher refuse the
names with the same advice; the chart schema allows walstore only.
- core/storage/smartwal, core/storage/parallelwal and
cmd/sw-block-testutil (whose one command corrupted smartwal records)
are deleted, with the helm smartwal-corruption scenario and the
parallel-walstore gate script.
- The replication harness runs on walstore; tests that ran on a removed
engine only because a stub needed some store move to walstore, and the
state_convergence label test moves to the in-memory BlockStore.
- sw-block cluster.check drops the removed engines' cases.
- Ledger: INV-OPEN-REMOVED-ENGINE-REFUSED-001 and
INV-OPEN-REMOVED-ENGINE-NAME-REFUSED-001, an OpenRefused edge in M1, and
the rows citing the removed tests updated. Docs: block-design 1.3 now
describes the removal, the smartwal deep-dive and figure are gone, the
scripts default to walstore, and the v1.1 notes carry the removal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review: ManifestNs summed every manifest span of the attempt, so a HEAD
re-read after a lost answer (inside HeadReadbackNs) was counted twice. It
is now the manifest work measured across the commit check only. The
write counts were whole successful ensures: a store wrapper now counts
each acknowledged create of a root or segment, with its bytes, as it
completes; an object already present sends and counts nothing, and a
failed commit keeps what it sent. Tests: a lost-answer cut keeps the slow
re-read out of ManifestNs (with the old sum it reads 60 ms in both);
three-shard full and by-change commits match byte totals computed from
the layout; a failed root send keeps the segment, and the retry sends only
the root.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ManifestNs was never set (always 0): it is now the time of the manifest
read and the segment writes, which run inside the commit check outside
every other measured part, so the pre-copy fixed parts gain it from their
remainder without counting it twice. Typed counts join it: HEAD's roots
and segments read, the roots and segments written, and their bytes,
counted by the layout remote (CountCutWork) on both the full commit and the
commit by change. They are in the cut stats, the /chunk/cut body (and the
status schema) and the cut log line.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The layout.ErrPrecondition case moves to the last position before default,
so every other cause an error carries decides first, the non-retryable
ones (closed, detached, frozen detach unsupported, an invalid freeze
budget, not a chunk volume) included. Controls: each joined with the
precondition reports its own code; with the case moved back to its
earlier place the closed, detached and frozen-detach rows fail.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 64eddb3484)