Commit Graph
3468 Commits
Author SHA1 Message Date
pingqiu 2931222f0c test(durable): witness resumed queue grant versus deadline expiry 2026-11-20 22:09:58 -08:00
pingqiu 1f8072da0c fix(durable): bound queued commands from their arrival and witness FIFO grants 2026-11-20 22:09:58 -08:00
pingqiu 8175e6fa84 test(durable): bound paused commands from their own arrival 2026-11-20 22:04:45 -08:00
Ping Qiu 9da65c9802 Merge pull request #327 from seaweedfs/train/20261121-6
Train 6: #318 + #320
2026-11-20 22:01:39 -08:00
pingqiuandClaude Fable 5.2 e8f325dedc chunkstore, sw-block: verify: bind rechecks to the lookup identity, confirm absence freshly, bound the start check
- A failed refresh cancels reads in progress before joining them and is
  the error returned.
- A reference to a chunk already read is compared with that content; two
  references to one key that disagree are a finding.
- A snapshot is identified by the name it was looked up by; a document
  naming another snapshot or volume is ROOT_INVALID and excuses no miss.
- The single-filer check of every ops chunk command runs within the
  command's --timeout.
- SWFS.Get reports not found only after a fresh volume lookup whose every
  location answers 404; a warm, correct cache costs no extra lookup.
- The verify rows move to Part B of the invariant document.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 21:59:34 -08:00
pingqiu 432b057856 fix(durable): release all admission waiters when precopy resumes 2026-11-20 21:58:51 -08:00
pingqiuandClaude Opus 5.5 3065a81238 ci: spec-trace check refuses a trace line declared twice
A second Machine/INV line (plain, list or bold form) could carry a second
kind past the check; every trace key must now be declared once. Three
self-test cases added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 21:56:31 -08:00
pingqiu f8d5a96905 test(durable): witness serving admission after precopy resume 2026-11-20 21:56:28 -08:00
pingqiuandClaude Opus 5.5 3073d4e134 storage, chunkstore: #324 fold: periodic cut reports through unlockCap; failure-safe joins and a causal Close witness; Begin and Finish refusal controls; ledger rows, wait-site row and hook contract docs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 21:56:02 -08:00
pingqiuandClaude Opus 5.5 8dd3669b1d ci: spec-trace check refuses mixed kinds, placeholders and cut-off change lists
Review fold: Machine/INV must carry exactly one kind token that ends at a
space, comma, slash or the line end; trace keys count only at the start of
a line; a value still holding the template placeholder fails; deleting
non-test Go under core/ or cmd/ also needs Simplest; an unknown status or a
record cut off before its NUL is a malformed change list (exit 2). The
self-test grows to 31 cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 21:53:15 -08:00
pingqiu 3a0d8067d2 Merge remote-tracking branch 'origin/main' into feat/publish-settled-hook
# Conflicts:
#	core/frontend/durable/provider_chunk_sched_test.go
#	core/storage/chunk_precopy.go
2026-11-20 21:46:54 -08:00
pingqiuandClaude Opus 5.5 e82d04f5ac ci: spec-trace check on every PR description
The PR template now carries the five trace lines (Feature, Machine/INV,
Model, Red-first, Simplest). A pull_request_target workflow checks the
description from the base branch's script: the four trace lines are
present, NONE carries a reason, Machine/INV starts with the PR kind
(IMPL <machine>.<transition>, FIX <INV-ID> or CHANGE <machine>), and
Simplest is present when non-test Go under core/ or cmd/ changes.
The self-test runs before the check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 21:46:13 -08:00
pingqiuandClaude Opus 5.5 24bc9ecfde chunkstore: dropIntent test asserts a live, self-bounded delete context
The test now checks that the context the filer receives is live on entry (it
does not inherit the caller's cancellation) and ends with its own deadline
(context.DeadlineExceeded), not Canceled. Release and bounded join at cleanup
are kept. Mutants: inheriting the cancelled parent fails on entry; no deadline
fails on the deadline check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 20:59:05 -08:00
pingqiuandClaude Fable 5.2 a0cbeaaafd docs(invariants): name the renamed BASE install refusal test
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 20:54:44 -08:00
pingqiu 461c471edf fix: restore final invalid_freeze_budget wire name 2026-11-20 20:52:22 -08:00
pingqiuandClaude Fable 5.2 176bebc14a test(invcheck): check the invariant document against the code
Fail when a row names a test that does not exist, an ACTIVE row names no
test, an ID repeats, or the stated row count differs from the tables.
Three ACTIVE rows named removed tests; drop those names (each row keeps
its other tests).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 20:52:20 -08:00
pingqiuandClaude Fable 5.2 4ae53120aa docs(invariants): count the INV rows as the tables have them
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 20:51:05 -08:00
pingqiuandClaude Opus 5.5 dff8c712b3 restore: bound the synchronous walker tests, join the dropIntent worker, ledger rows
- Walker tests that call HydrateAll synchronously run under a ctLocalBound
  timeout, so a walker that never finishes fails instead of hanging.
- The dropIntent test releases and joins its worker at cleanup (an unbounded
  delete, the failing case, no longer leaks a goroutine).
- invariants.md: INV-RESTORE-PARENT-HOLD-001 is Go only (the model does not
  cover retention of an aborted target); new INV-CAT-INTENT-DROP-BOUNDED-001
  row and M6 transition for the bounded catalog intent delete.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 20:49:42 -08:00
pingqiu 7a118ff151 fix: use invalid_freeze_request and trace typed refusal invariant 2026-11-20 20:47:27 -08:00
pingqiu 8bd05b6cda test: require canonical invalid_freeze_request wire code 2026-11-20 20:46:44 -08:00
pingqiu c190ec15d0 fix: distinguish pre-mutation frozen detach validation refusals 2026-11-20 20:43:05 -08:00
pingqiu 125ed96eb0 test: require distinct pre-mutation frozen validation refusal 2026-11-20 20:42:39 -08:00
pingqiuandClaude Opus 5.5 f679f2a5fe docs: drop internal names and paths from comments and notes
Public text states what the code guarantees, not who asked for it or
where an internal note lives. Comments and docs only; no code change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 20:37:43 -08:00
pingqiuandClaude Opus 5.5 6d42d08b0f restore: public comments state guarantees only; walker test allows a deferral
Comments in the restore code, tests and spec header now say what the code
guarantees, without review or design-note references. The real-limiter walker
test no longer asserts zero deferrals: a permit is released asynchronously
(when its flight settles, then closed by the limiter), so the next admission
can find every fill slot still closing; it now requires the limiter's skips to
equal the walker's deferrals (flaked 4 of 90 runs on Linux before).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 20:36:33 -08:00
pingqiuandClaude Fable 5.2 d563741b68 docs(invariants): rows for rules the code already keeps
Add rows, each with its enforcing function and test checked against the code,
for: the bounded guest wait and the logical read path during a cut; the named
snapshot's point and durability; fork from a published snapshot; GC deleting
the exact recorded fid; the grace restart; strict journal isolation on move
and placement targets. The WAL flusher sync row is a STUB (no test yet).
Clauses enforced only by reading are listed in the notes. Also: M7 in the
contents, the row count recounted from the tables, Part A protects columns.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 20:35:21 -08:00
pingqiu b9c11477b7 fix: isolate permanent GC DELETE refusals without losing coverage 2026-11-20 20:35:19 -08:00
pingqiu a3a3bc0a23 test: expose permanent DELETE starving later GC bindings 2026-11-20 20:32:04 -08:00
pingqiu c2cac1159d docs: clarify GC pairwise clock assumption 2026-11-20 20:29:23 -08:00
pingqiu d075dc6011 fix: preserve GC grace across bounded clock skew 2026-11-20 20:27:22 -08:00
pingqiuandClaude Opus 5.5 a802e6db68 Merge #320 (forced-move CLI + lost-range readout) into train 6
The only conflict is the ledger summary line in docs/design/invariants.md,
which #318 and #320 both recounted. Recounted from the merged Part B tables:
126 rows (107 ACTIVE, 17 STUB, 2 ARCHIVED; 15 kept, 111 new).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 20:25:15 -08:00
pingqiu 6692d5a4e4 Merge #318 (periodic cut + per-volume maintenance) into train 6 2026-11-20 20:25:14 -08:00
pingqiu e11b72d8db test: expose GC clock skew shortening grace 2026-11-20 20:24:27 -08:00
pingqiuandClaude Opus 5.5 88aea4c7ed restore: fold review of part A (fill permit, permit ownership, stale snapshot image, docs)
- HydrateAll admits each fill as a background fill permit with no cut payload
  (the real limiter refuses a payload for BackgroundFill, so no fill ever ran),
  and the permit now belongs to the flight: the walker queues the shared flight
  without becoming a waiter and a layer-owned goroutine releases the permit
  when the flight's I/O is over (new settled signal, closed by the worker after
  fillOnce or when an unrun flight is removed), also after an early return on
  cancel, revocation or close. The limiter's abort callback stops the walker.
  The flight lookup is factored into hydrationFlightLocked (shared with
  OnReadMissContext, no behaviour change there).
- CreateSnapshot on a restore volume also checks the supplied image: a cut
  saved before the marker that still names another volume's chunks is refused.
- dropIntent keeps outliving the caller's cancellation but is bounded by
  dropIntentTimeout (it had no deadline at all).
- Tests: the real hostlimit limiter (fill permits, payload 0, all released),
  permit held while a cancelled walker's Get is held, revocation, a witnessed
  pause for guests, cancel returning while the Get is held, bounded joins;
  stale pre-independence image refused; aborted first HEAD keeps the parent
  as fork_parent until the target is deleted; dropIntent bounded.
- Docs: invariants.md M4/M6 rows and INV-RESTORE-* rows, GC owner rooting
  recorded as load-bearing in INV-GC-REACHABLE-001; restore diagram in the
  workspace design; RestoreIndependence in docs/spec/README.md (simulation).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 20:23:53 -08:00
pingqiuandClaude Opus 5.5 d1c790f39e Merge origin/main into feat/forced-move-cli
Keep both sides' ledger rows; recount the summary (123 rows: 103 ACTIVE, 18 STUB, 2 ARCHIVED).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 20:16:20 -08:00
pingqiuandClaude Opus 5.5 3b58335be5 spec: RestoreIndependence model for independent restore (O-REC-2)
TLA+ model of the restore: claim, two-step fork, hydrate, bounded batch cuts
(upload own fids under an intent, one HEAD CAS per batch), marker after the last
foreign ref, claim drop; GC, source delete, snapshot retention and crashes with a
resume from remote facts at any point. Invariants NoGap, Independent,
NoForeignList, ClaimUntilHead_Inv (option 1: today's fork claim semantics),
LifecycleFree, StateRemote. cfgs: option-1 safe at three sizes, the stricter
claim-until-independent variant, two witnesses, and one red cfg per mutant
(each red at its expected invariant in simulation). Simulation only so far:
no violation in about 0.81M states per safe cfg (3 seeds x 60000 traces, depth
40); not exhausted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 20:11:14 -08:00
pingqiuandClaude Fable 5.2 f3c84c4d81 docs(invariants): rows for verify and the ops chunk single-filer check
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 20:09:16 -08:00
pingqiu 72f46d511c Merge remote-tracking branch 'origin/main' into feat/chunk-verify 2026-11-20 20:08:28 -08:00
pingqiuandClaude Fable 5.2 591a5a3b1c chunkstore, sw-block: verify the remote image against HEAD and snapshots
Add Catalog.Verify and 'sw-block ops chunk verify': a read-only check of a
volume's remote image at three depths (meta, bindings, data). GC's mark does
not look up the bindings of the keys it roots and never reads chunk data, so
a missing binding or a damaged needle was found only by a guest read.

A miss is reported only if its root still names the chunk: verify re-reads
HEAD (superseded during verify) or the snapshot attempt (root deleted during
verify) before reporting, since a pass can outlive GC's grace. A needle is
NEEDLE_MISSING only when the store answers not found; any other read failure
is retried and then reported as READ_ERROR (not verified). Exit code 3 means
the pass completed with findings.

The single-filer start check now also runs in the shared dial path of the
'ops chunk' commands and in gc.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 20:08:27 -08:00
pingqiuandClaude Opus 5.5 86dafc1d1e Merge origin/main a7d0b851 into feat/oss-independent-restore
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 20:05:14 -08:00
pingqiu 899ef867b0 test: require complete final image and bounded maintenance cleanup 2026-11-20 20:01:53 -08:00
pingqiu 8e5a2cce7d Merge Train 5 preserving periodic cut guard and whole-cut deadline 2026-11-20 20:01:53 -08:00
pingqiuandClaude Opus 5.5 796ef439e7 chunkstore: refuse snapshots of a restore until it is independent
A snapshot taken while a restore still names its source's chunks would keep that
lineage for its whole retention. CreateSnapshot on an Origin restore volume is
refused (restore_incomplete) until RESTORE-INDEPENDENT exists; a refused request
leaves no name or attempt. Test covers before, after own chunks without the
marker, and after the marker (the snapshot then names no foreign ref).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 19:58:03 -08:00
Ping Qiu a7d0b851bd Merge pull request #325 from seaweedfs/train/20261121-5
Train 5: #323 + #317 + #322
2026-11-20 19:56:45 -08:00
pingqiuandClaude Opus 5.5 566471971a storage: background hydrate walker (HydrateAll) for independent restore
HydrateAll makes every HEAD-named chunk local, lowest index first, through the
same shared fill flights as guest read misses (one fetch per chunk; queue bound
and read-miss timeout apply). It yields while any flight has guest waiters and
admits each fill through the host limiter (cfg.Budget) with the caller's ctx, so
the restore driver sets hostlimit.BackgroundFill on it. A refused admission or a
pending fill backs off and retries; ctx cancel returns the remaining count.
ChunkLayerStats.AbsentChunks reports what is still to fetch (0 = fully local).

Tests: every chunk fetched exactly once and the HEAD image reads back, a second
walk does nothing; local writes (full and partial chunk) are never overwritten;
the walker issues no fetch while a guest waits and never fetches twice; each fill
is admitted once and released, refusals are deferred, the caller's class reaches
Admit; cancel reports the remaining count; AbsentChunks before/after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 19:52:47 -08:00
pingqiu 947a186970 fix: bind maintenance to attached lineage and close review controls 2026-11-20 19:48:40 -08:00
pingqiuandClaude Opus 5.5 a4de2484f9 chunkstore: independent restore, catalog part (Restore, OriginRestore, independence marker)
Restore is Fork recorded with Origin restore (same claim semantics: live until the
target has a HEAD). Every reader of the fork record accepts OriginRestore; a replay
onto a volume of the other origin is refused. MarkIndependent writes the write-once
RESTORE-INDEPENDENT entry only when the resolved HEAD holds no ref to another
volume (ForeignRefs: owner-qualified keys whose owner is not the volume).

Tests: restore records origin/fork record and attaches; replay and origin mismatch;
marker refused while foreign refs remain, write-once replay; source snapshot and
source volume deleted mid-restore (attach, replay and finish stay normal); GC keeps
every chunk the restored HEAD names with the snapshot and the source gone; a restore
without a live HEAD never attaches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 19:47:42 -08:00
pingqiu 8c91fa1d4f Merge main preserving both maintenance and admission model receipts 2026-11-20 19:43:44 -08:00
pingqiuandClaude Opus 5.5 b657923019 chunkstore: export GC's per-key reclaim step as ChunkRemote.ReclaimKey
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 19:35:08 -08:00
pingqiuandClaude Opus 5.5 29dab5e1d7 chunkstore: ShareGuard seam for snapshot and fork (no-op by default)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 19:35:08 -08:00
pingqiuandClaude Opus 5.5 4d7cea7d86 storage: deliver publication reports serialized and in order; Close drops the rest
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 19:35:07 -08:00