Commit Graph
698 Commits
Author SHA1 Message Date
pingqiuandClaude Opus 5.5 cb542b3c21 host, durable: the authority pause ends at the grant and latches silence before it
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>
2026-12-02 03:05:09 -08:00
pingqiuandClaude Opus 5.5 6bf0445fcd host: recovery_stalled counts every synced startup slice and pauses for the master's authority wait
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>
2026-12-02 02:23:33 -08:00
pingqiuandClaude Opus 5.5 1e40d947da Merge main into the declare-format branch: the HEAD guard with the stamp
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>
2026-12-02 00:34:27 -08:00
pingqiuandClaude Opus 5.5 4184e30af4 storage, layout: the attach level comes from the assignment; one HEAD write guard
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>
2026-12-01 23:32:23 -08:00
Ping Qiu 0cf187152d Merge branch 'main' into feat/b1-candidate-bitmap 2026-12-01 23:11:54 -08:00
Ping Qiu 7f8367c495 Merge pull request #913 from seaweedfs/feat/format-gate-master
master: cluster format level (FORMAT-GATE): finalize-format, level-0 v1.0 semantics, retire-host
2026-12-01 22:28:14 -08:00
Ping Qiu 9f5b8ad37e Merge branch 'main' into feat/b1-candidate-bitmap 2026-12-01 21:32:01 -08:00
pingqiuandClaude Opus 5.5 49f7d3fe29 format gate tests: comments say what each test does
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 21:11:01 -08:00
pingqiuandClaude Opus 5.5 6d24db415c format gate test: the held publication admission is released and joined on cleanup
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>
2026-12-01 20:43:30 -08:00
pingqiuandClaude Opus 5.5 4192cc58f7 format gate: every reported volume keeps its level; a held ask is judged at its release
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>
2026-12-01 20:38:03 -08:00
pingqiuandClaude Opus 5.5 7cb93af9ec format gate: a silent process keeps its level while its volume is served
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>
2026-12-01 20:19:53 -08:00
pingqiuandClaude Opus 5.5 fadc4f0345 format gate: per-process read levels, the publication boundary checks them, the clamped grant stays monotonic
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>
2026-12-01 20:01:10 -08:00
pingqiuandClaude Opus 5.5 72e429830c storage: the guest pause does O(1) work; the candidates are judged after it
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>
2026-12-01 19:58:17 -08:00
pingqiu 30bbbbc46d Merge remote-tracking branch 'origin/main' into feat/o1-upgrade-pass 2026-12-01 19:45:13 -08:00
pingqiuandClaude Opus 5.5 306831c07f storage, volume: candidate set review: absent-to-present touch, oracle, telemetry
- 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>
2026-12-01 18:52:10 -08:00
pingqiuandClaude Opus 5.5 647ba06119 master: cluster format level (FORMAT-GATE): reads_level, finalize, level-0 v1.0 semantics, retire
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>
2026-12-01 18:27:53 -08:00
Ping Qiu 4655664cf5 Merge pull request #903 from seaweedfs/fix/cgroup-unresolved-fallback
blockvolume: an underivable cgroup memory limit starts on the default
2026-12-01 17:40:12 -08:00
pingqiuandClaude Opus 5.5 812fcffb35 storage: the attach runs the upgrade compare pass; sealing requests wait
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>
2026-12-01 17:15:16 -08:00
Ping Qiu 616e9a0a2f Merge branch 'main' into feat/v5-incremental-build 2026-12-01 16:23:42 -08:00
Ping Qiu 3798d42bd3 Merge branch 'main' into feat/v5-restart-grace 2026-12-01 15:56:03 -08:00
pingqiuandClaude Opus 5.5 7a70a7a1ca blockvolume: an underivable cgroup memory limit starts on the default
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>
2026-12-01 15:46:02 -08:00
pingqiuandClaude Opus 5.5 aa512ab6d4 blockvolume, volume: red tests, an underivable cgroup limit starts on the default
- 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>
2026-12-01 15:41:31 -08:00
Ping Qiu 2e81e41347 Merge branch 'main' into feat/v5-incremental-build 2026-12-01 15:35:55 -08:00
pingqiuandClaude Opus 5.5 bbeb8d98aa authority: comments name the deadline barrier; gofmt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 15:24:06 -08:00
pingqiuandClaude Opus 5.5 2e9d6e04a7 authority: tests follow the lease deadline barrier; renewals write nothing
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>
2026-12-01 15:12:45 -08:00
pingqiuandClaude Opus 5.5 ddc349abe8 master: refuse a nil decoded volumes map; a null v1.0.x attestation file migrates as {}
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>
2026-12-01 14:25:54 -08:00
pingqiuandClaude Opus 5.5 9f82387047 master: the line-wake test publishes by the product tick it runs itself
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>
2026-12-01 14:23:58 -08:00
pingqiuandClaude Opus 5.5 ac02f34d81 master: the attestation envelope is re-synced at every start; volumes must be an object
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>
2026-12-01 14:21:37 -08:00
pingqiuandClaude Opus 5.5 518e418fe0 master: a v1.0.x master refuses to start on a store this version opened
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>
2026-12-01 14:10:41 -08:00
pingqiuandClaude Opus 5.5 a8d2a6e6c6 authority: renewals write nothing; waits use the master's own deadline; records are version 2
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>
2026-12-01 13:55:23 -08:00
pingqiuandClaude Opus 5.5 d17696d1ea master: the line-wake test waits for the grace's rebuild (build 2) before the heartbeat
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 13:52:35 -08:00
pingqiuandClaude Opus 5.5 db7f6530a3 authority: a counter handshake orders the master's line-wake test
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>
2026-12-01 13:48:58 -08:00
pingqiuandClaude Opus 5.5 2caed63f04 master: the line-wake test waits on a settled observation host, not a sleep
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>
2026-12-01 13:41:47 -08:00
pingqiuandClaude Opus 5.5 1cb5e0e124 master: the line-wake test orders its builds so only the hook can wake the last
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>
2026-12-01 13:36:48 -08:00
pingqiuandClaude Opus 5.5 75bb94c46d authority: the grace's end stays a deadline until consumed; the master's line wake is pinned
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>
2026-12-01 13:31:26 -08:00
pingqiuandClaude Opus 5.5 ad9ee63491 authority: a heartbeat that changes nothing wakes no observation rebuild
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>
2026-12-01 13:15:33 -08:00
pingqiuandClaude Opus 5.5 1febcbcedb authority: a per-volume line index; a call reconciles only its volume's bindings
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>
2026-12-01 12:24:19 -08:00
Ping Qiu e09cdeb2f0 Merge pull request #867 from seaweedfs/fix/volume-directory-collision
fix: recover pending volume creates from id8 directory collisions
2026-12-01 01:27:09 -08:00
pingqiuandClaude Opus 5.5 e4e34c26a6 chunkstore: keep the manifest size through commits; list it per snapshot
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>
2026-11-30 23:30:43 -08:00
pingqiu ffe16608dd fix: redraw pending volume identity after directory collision 2026-11-30 23:06:30 -08:00
Ping Qiu 13d0627043 Merge pull request #864 from seaweedfs/fix/holder-cgroup-memory
blockvolume: derive the default Go soft memory limit from its cgroup
2026-11-30 22:59:12 -08:00
Ping Qiu 5a04fd27c3 Merge pull request #863 from seaweedfs/feat/remote-full
storage: a full chunk store is remote_full, and status names the last failed cut
2026-11-30 22:33:58 -08:00
pingqiuandClaude Opus 5.5 96a3d30003 storage: keep a full store's answer through retries and a batch; record the guarantees
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>
2026-11-30 21:41:36 -08:00
pingqiu 60e482f978 blockvolume: derive the default Go memory limit from its cgroup 2026-11-30 21:40:44 -08:00
pingqiuandClaude Opus 5.5 36bc8f5683 storage: a full chunk store is remote_full, and status names the last failed cut
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>
2026-11-30 21:29:02 -08:00
pingqiuandClaude Opus 5.5 68045d9698 durable: remove the smartwal and parallel-walstore engines
- 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>
2026-11-30 20:38:54 -08:00
pingqiu ffa6608972 Serve lab heap profiles on the existing status listener 2026-11-30 13:08:56 -08:00
pingqiuandClaude Opus 5.5 cdf18c1988 cut counters: ManifestNs is the commit check's; sends are counted as they complete
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>
2026-11-30 10:36:07 -08:00
pingqiuandClaude Opus 5.5 ba146134e2 storage, chunkstore: a cut reports its manifest work
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>
2026-11-30 10:20:50 -08:00
pingqiu c6528d7740 fix(volume): the layout precondition decides last
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)
2026-11-30 08:06:07 -08:00