The bitmap is pinned block by block (the file's local block, a single and a
batch log suffix, their non-local neighbours). The crash before the fence is
the injected one at the first slot write, with the pages complete, no
header and the presence file there at that point; a crash after the fence
and before the header completes on reopen; a retry over a complete record
writes no page, no header and no descriptor slot (file identity checked).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A store marked at this epoch is never seeded from the presence file: a
complete record only has the file removed, an incomplete one gets its pages
again from the store's bitmap through the boundary's same-epoch retry, with
a seed that refuses. A store marked at another epoch is refused, typed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two reds: a completed upgrade with a damaged header re-reads the presence
file; an upgrade at another epoch than the store's marker is taken.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After Recover, with extent draining held and before the chunk layer
attaches: seed the store's bitmap from the presence file (present chunks
whole; absent chunks with the file's local blocks and those of log entries
not yet applied), write the record's pages from the prepared coverage with
each chunk classified by the kernel's Rebuilt event, let the store publish
the bitmap and fence both slots, write the header, remove the presence file.
Each step repeats; a complete record only has the presence file removed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two defects that #833 introduced, each shown by a test that fails at
f5926348:
- a format-2 bitmap baseline outlives a discarded WAL suffix
(Recover returns nil with bitmap position 1 while the retained
position is 0);
- the legacy FenceChunkStateUpgrade relabels an initialized format-2
bitmap epoch (7 -> 8).
The fixes exist but are not yet qualified on Linux. Main goes back to
its state before #833; the feature returns as one PR with the fixes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A stable tag moves :alpha only when it is the highest vX.Y.Z tag, so a
later patch on an older line never moves :alpha back. A tag that is not
vX.Y.Z or vX.Y.Z-pre fails the run instead of publishing. The checkout
fetches tags so the comparison sees them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only a stable-line release tag (vX.Y.Z, no pre-release suffix) moves the
public :alpha and sha-* image tags; a release candidate (vX.Y.Z-rc.N)
publishes its version tag alone. The workflow also runs only on version
tags and on a manual run from a version tag, never on a branch push.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
boundedManifest (the attach-fetch HEAD read the cut's settlement uses)
counted no root or segment read: each successful fetch is now counted as
it completes, so a later failed fetch keeps the earlier ones. Controls: a
real GetHead under WithAttachFetch counts 1 root and 3 segments on three
shards, and 1 and 1 when shard 1's fetch fails. The lost-answer test
asserts the disjointness that always holds (ManifestNs + HeadReadbackNs <=
TotalNs; the old sum exceeds it by the re-read's 100 ms) and that the read
counts include the re-read's, instead of a timing bound on the check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each wait is at most 10 s and never past the test's deadline less a reserve;
a cleanup attempts every pending join, then reports the ones that timed out.
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>
A failing path that already took a worker's result no longer leaves the
cleanup waiting on an empty channel; the evict-without-lock mutant now
fails at once instead of timing out in cleanup.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The constructor takes the pages whose content the open changed (chunks
judged changed or rebuilt) and starts them dirty from their on-disk
position, so the header's G does not pass them until they are written again
by their age. The concurrency tests wait with local deadlines, assert that
the second writer waits for the first, and release and join on every path.
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>
A page is dirty only when what it says changes (a chunk's state or hash); a
write that keeps the state, or an ignored event, dirties nothing, since open
derives it again from the store's positions. Each page is due after its own
count of changes or its own age, so page writes follow the changes, not the
volume's size. The header's G is the least of the applied position and the
positions from which still-dirty pages went dirty (a fuzzy checkpoint), so
it moves under steady writes. State codes by a switch, not a map.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pubMu is held across a page's snapshot and write, and across the header, so
no writer lands an older page after a newer one. A transition into a known
hash needs the hash; a commit needs the hash its cut captured to still be
the chunk's, else it is refused as stale; an ignored event keeps the hash; a
refusal changes nothing. The constructor copies its inputs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reds: a parked page writer lands an older snapshot after a newer one; an
ignored fill replaces the hash, a hash event without a hash makes it known,
a stale captured hash commits; the caller's slices alias the state. The
evict control fails instead of skipping, and the refused edge pins effect,
hash and dirty accounting.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every chunk's state in memory, changed only through the kernel. Every event
dirties its page (a write that keeps the state still moves the chunk's store
position); an evict writes its page before Apply returns, so the bytes are
dropped after it. Pages are written on their own schedule (a count of
changed entries or an age), valid through the applied position the shell
raises after each write's Apply; Flush writes the header only when every
page is clean after the page writes. WriteThrough writes the dirty pages
below a chunk, for the upgrade pass. No caller yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A companion of INV-CUT-ERROR-PRECEDENCE-001 (whose statement is at its
length limit): a catalog transition that lost its conditional HEAD write
reports head_conflict, never internal, and decides last. Its tests are the
two delete-race regressions and the typed table.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 77fa10070e)
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)
chunkErrorCode maps layout.ErrPrecondition (a catalog transition lost its
conditional HEAD write to another writer, such as a cleaning's begin) to
head_conflict, 409, retryable, as it maps the engine's HEAD precondition.
It answered internal before. The case sits with the HEAD-precondition one,
after every terminal and uncertain cause, so a joined error keeps its
precedence. The operator guide and the v1.0.1 notes say to retry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 3a5de69079)
The holder's cleaning begins between a snapshot delete's HEAD read and its
conditional write: the delete fails on the HEAD precondition, nothing of it
applies, and a retry completes. Red: the refusal maps to 500 internal, not
retryable; under a persistent conflict every attempt is internal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 031312357b)