Commit Graph
7 Commits
Author SHA1 Message Date
Ping QiuandClaude Opus 5.5 a5686e7fa7 Sync seaweed-block v1.1.1 into seaweed-block/ (#13411)
Brings seaweed-block main (v1.1.1 plus the docs and a test fix after it)
into seaweed-block/ as one commit. Only files under seaweed-block/ change,
and the subtree equals seaweed-block main exactly. The module's full
history stays in the seaweed-block repository.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 19:04:53 -08:00
pingqiuandClaude Opus 5.5 f235813d48 cmd/sw-block: name the request loop in its comments, not by a design label
Comment-only: three comments named the loop by an internal label; they now
say what it is. No code change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 13:06:12 -08:00
pingqiuandClaude Opus 5.5 073bb08ddf fix(sw-block): clamp each request's client wait to the loop's deadline
The client's wait for an answer was sent + per + cushion, with per computed
before sent was sampled: a pause between the two moved the wait past the
loop's deadline. It is now min(deadline, sent + per + cushion), so it never
reaches past --timeout (INV-CLI-CHUNK-LOOP-003).

Test isolation: when runChunkWithin's bound fails a test, it now joins the
command (bounded) before the earlier cleanups restore the package globals.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 04:26:00 -08:00
pingqiuandClaude Opus 5.5 d20b61c299 fix(sw-block): repeat an outcome_unknown answer, refuse a non-positive --timeout; ledger rows
INV-CLI-CHUNK-LOOP-001..004, one property per row in B.5,
each citing its tests:

- 001: the same request is repeated only after a retryable or
  outcome_unknown answer. An outcome_unknown answer not marked retryable is
  now repeated too.
- 002: the loop stops at the first definite answer.
- 003: no request starts once --timeout has passed, and a non-positive
  --timeout is refused before any request (snapshot, cut and detach; before,
  a zero --timeout was sent as timeoutMs 0, which the server reads as its
  own default bound).
- 004: a request that ended early is repeated only after a backoff.

Tests: TestChunkLoopRepeatsAnOutcomeUnknownNotMarkedRetryable and
TestChunkNonPositiveTimeoutIsRefused; a mutant that drops either change
fails its test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 04:19:01 -08:00
pingqiuandClaude Opus 5.5 d39e321f81 fix(sw-block): one deadline bounds the request loop; a stopped detach says so
Review of the request loop:

- One deadline, now + --timeout, bounds the whole loop. Each request's own
  bound and the client's wait for its answer end inside it; the progress read
  (at most 2 s) and the pause are cut at it. A request is sent only while at
  least a minimum request is left, so none starts after --timeout and none
  carries a zero or negative bound. The first request is checked the same
  way.
- After a detach answers outcome_unknown the holder has stopped guest I/O
  until it settles the detach in the background. The progress line says so;
  a detach still unknown at --timeout says the volume stays stopped and how
  to read the settled answer. Snapshot and cut unknowns are not described as
  a guest stop. The detach's --timeout help says a long bound can mean a long
  guest stop.
- The progress line reports the chunks the holder staged since the first
  request (its counter runs from process start) and carries the answer's
  message; the requests and the progress read share one HTTP client.
- The pause's start and cap are package variables, so a test can tell a
  doubling pause from a constant one.

Tests: a held progress read and slow answers send no request after
--timeout and return by it; the pause doubles to its cap; a successful
progress read is reported as a change, read for the right volume; the
generated request id is exactly the printed one in every request; a detach's
outcome_unknown settles to sealed, to aborted then sealed, and to fenced
(non-retryable), with and without --plain. The timing tests fail at once,
not at the binary's timeout, when the loop misses its --timeout. Mutants
caught: no dispatch check, the client waiting the old 5 s cushion, an
unbounded progress read, a constant pause, the stopped-I/O line on every
unknown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 04:10:45 -08:00
pingqiuandClaude Opus 5.5 d231068f6e feat(sw-block): snapshot, cut and detach repeat 5-minute requests up to --timeout
The cut budget's request loop (v1.0.1). With --timeout above the
server's bound on one request (5 minutes), the command sends requests of at
most that bound with the same body (a snapshot keeps its name and request
id) until one answers, a non-retryable refusal ends them, or --timeout has
passed. A commit that landed during a timed-out request is found by the next
one, not repeated, and the holder keeps an unfinished cut's uploads between
requests, so each request sends only what is missing.

Between requests the command prints the request's end, the time left and,
when the holder answers GET /status/durable, its staged and dirty chunk
counts. A request that ends before its bound (the store refused at once) is
followed by a pause doubling to 30 s, so a store that is down is not asked in
a busy loop. A --timeout within the bound sends one request, as before; only
the answer the loop ends on is printed on stdout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 03:46:14 -08:00
pingqiuandClaude Opus 5.5 79ca61935a test(sw-block): red: snapshot, cut and detach finish across 5-minute requests
The cut budget's request loop (v1.0.1): with --timeout above the server's 5-minute
bound on one request, the command must send requests with the same name and
request id until one answers, a non-retryable refusal ends it, or --timeout
passes. These tests fail on main: one request is sent and its timed-out
answer is final. The two controls (a non-retryable refusal; a --timeout
within the bound sends one request) pass as before.

chunkRequestBound names the server's per-request bound so the tests can
shorten it; nothing reads it yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 03:42:44 -08:00