Commit Graph
1325 Commits
Author SHA1 Message Date
pingqiuandClaude Opus 5.5 6896463a44 volume: name the cause when the workspace lease guard fences
The guard fenced silently: when renewals kept failing until the lease
expired, it drained the volume through blockvolume's lease-stop path, which
logged nothing, and returned the raw RPC error (issue #205).

- Every fence records its first cause: lease expired without a successful
  renewal, expired after a failed renewal (with the renewal's latency and
  error), an invalid reply, a reply that arrived after the deadline,
  revocation by the master, or shutdown. The guard logs it once as
  "workspace lease: fenced ...", FenceCause() returns it, and the non-ACK
  drain error carries it.
- Every failed renewal is logged with its latency and the lease deadline,
  also when the lease is still valid: a run of them is the warning before
  an expiry fence.
- An expiry after a failed renewal returns "workspace lease expired:
  renewal failed after <d>: <err>", wrapping the RPC error.
- blockvolume logs when it stops because the guard requested the drain.

The fence behaviour itself is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 03:50:08 -08:00
pingqiuandClaude Opus 5.5 dc877aa4b5 volume: RED: a workspace lease fence must name its cause
Issue #205: under sustained write load a volume fenced because its lease
renewals kept failing until the lease expired, and nothing said so. The
shutdown path logged nothing; the only trace was the raw RPC error printed
at closeout. The fence itself is correct.

Two tests fail on main:
- a renewal that times out past the lease deadline fences (as today), but
  the returned error must say the lease expired and keep the RPC error,
  and the fence and its cause must be logged;
- a renewal that fails while the lease is still valid must be logged with
  its latency (it does not fence).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 03:48:38 -08:00
Ping Qiu b33a0d67f6 Merge pull request #202 from seaweedfs/docs/snapshot-sharing-and-freeing
docs(design): how versions share chunks and how an old snapshot's data is freed
2026-11-17 21:18:29 -08:00
Ping Qiu c9c0e1fdbc Merge pull request #201 from seaweedfs/feat/chunk-cut-stats-body
volume: return the cut's statistics in POST /chunk/cut
2026-11-17 20:21:02 -08:00
pingqiuandClaude Opus 5.5 173df33abd docs(design): how versions share chunks and how an old snapshot's data is freed
agent-workspace-design.md:
- section 3: a HEAD, a snapshot and a fork root are each a complete map
  (no backing chain, no per-layer bitmap); a cut uploads only changed
  chunks and rewrites only their segments; the dirty bitmap is local
  holder state, not part of a snapshot; a worked example (100 chunks,
  init, 20 rewritten, snap1: 120 objects, deleting init frees 20).
- section 6: the GC roots line now says what the code does: a deleted
  snapshot's attempt stays a root for one grace period after its delete
  time (Collector.snapshotAttemptHeads), then stops counting.
- section 6: freeing an old snapshot's data in three steps (delete the
  name, GC --apply with two marks a grace apart, SeaweedFS volume vacuum)
  with the timing at the default grace, and why GC uses a reachability
  mark rather than reference counts.

No invariant row changes (INV-GC-REACHABLE-001 already covers attempts).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 20:04:50 -08:00
pingqiuandClaude Opus 5.5 0b8ea2f2e6 volume: return the cut's statistics in POST /chunk/cut
The chunk layer fills chunkCutStats for every cut, but the /chunk/cut body
dropped them (the W2 placeholder said "added when W3 fills them"). The body
now carries a "stats" object that mirrors storage.ChunkCutStats field for
field: barrier pause, sync, copy, candidate/uploaded/zeroed/unchanged chunks,
uploaded bytes, upload and CAS time and result, total time, and the staging
counters. A reflection test keeps the body in step with the layer's struct,
so a new layer statistic cannot be dropped silently.

This lets a caller (the CLI, a test harness) see what one cut cost without
reading logs: the barrier pause against the chunks it copied, and the bytes
each cut uploaded to the store.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 17:42:30 -08:00
pingqiuandClaude Opus 5.5 0e70bd2d2e volume: RED: POST /chunk/cut must return the cut's statistics
The chunk layer now measures every cut (barrier pause, chunks and bytes
uploaded, unchanged chunks, staging), but the /chunk/cut body still
omits them, so a caller cannot see what one cut cost. Both tests fail on
main: the body has no "stats" field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 17:41:37 -08:00
Ping Qiu a8e9b588bc Merge pull request #200 from seaweedfs/ci/tp04-self-hosted
ci: run same-repo tests on the team's tp04 runner
2026-11-17 02:42:18 -08:00
Ping Qiu 8482c60353 Merge pull request #199 from seaweedfs/fix/nvme-h2c-range-overflow-198
fix(nvme): check H2C data ranges without integer overflow
2026-11-17 02:12:09 -08:00
pingqiu cd03b059c8 fix: validate H2C data ranges without integer overflow 2026-11-17 01:58:25 -08:00
pingqiuandClaude Opus 5.5 bd2bc5d5ea ci: run same-repo tests on the team's tp04 runner
Pushes to main and PRs from branches in this repository now run the
test job on the self-hosted tp04 runner (label tp04-seaweed-block).
PRs from forks keep running on ubuntu-latest, so code from outside the
repository never executes on our machine. The job name stays
"go test (linux)", so the required check is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 01:55:46 -08:00
Ping Qiu d4acf0a24f Merge pull request #196 from seaweedfs/docs/inv-promote-frontier-rule-b
docs: INV-PROMOTE-FRONTIER-001 states the merged RF3 frontier rule
2026-11-16 22:26:32 -08:00
pingqiuandClaude Opus 5.5 33945cf7de docs: INV-PROMOTE-FRONTIER-001 states the merged RF3 frontier rule
Known frontier: durable >= required. Unknown frontier under a quorum
profile: promote only with P-K+1 fresh ready peers in the same tick.
Limits: no frontier source (#192) and no primary lease (#195).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 22:16:46 -08:00
Ping Qiu 3ec9c27c4a Merge pull request #194 from seaweedfs/fix/publisher-genesis-bind-per-volume
fix(authority): Bind is genesis for the volume, not only the slot (#183)
2026-11-16 22:15:25 -08:00
Ping Qiu 28dde15335 Merge pull request #193 from seaweedfs/fix/replica-invalidate-terminal-state
fix(replication): Invalidate preserves the NeedsRebuild terminal state (#182)
2026-11-16 22:15:18 -08:00
Ping Qiu 8979afcd8b Merge pull request #191 from seaweedfs/fix/rf3-promotion-required-frontier
fix(master): prove frontier coverage before an RF3 promotion (#181)
2026-11-16 22:15:10 -08:00
pingqiuandClaude Opus 5.5 4be82a4dee docs: invariants reflect per-volume genesis Bind (#183)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 21:45:37 -08:00
pingqiuandClaude Opus 5.5 510c5af075 docs: invariants reflect Invalidate obeying the peer transition gate (#182)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 21:34:33 -08:00
pingqiuandClaude Opus 5.5 663eaa2845 docs: qualify the RF3 survivor rule by the missing primary lease (#195)
The same-tick probes are snapshots, not a fence: the rule covers the
acknowledgements their sampled frontiers represent, not one the old
primary gives after the sample.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 21:32:03 -08:00
pingqiuandClaude Opus 5.5 bdcc60d7a4 fix(authority): Bind is genesis for the volume, not only the slot
The Publisher checked IntentBind against the (volume, replica) key only,
so Bind(v,r1) then Bind(v,r2) published two epoch-1 lines for one
volume. After a restart the file store reloads only the current slot,
so a Bind for an earlier slot was accepted the same way.

A Bind is now refused with ErrBindAlreadyBound when any slot of the
volume already holds an authority line. Moving to another slot stays
IntentReassign. Same-key double Bind and Bind of a fresh volume are
unchanged.

Fixes #183.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 21:26:33 -08:00
pingqiuandClaude Opus 5.5 ca92a063e4 test(authority): a second slot's genesis Bind must be rejected
Reproducer for #183, unchanged from #184.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 21:26:32 -08:00
pingqiuandClaude Opus 5.5 eb1a244db1 test(replication): drop the unreachable Unknown invalidation case
A new peer starts Healthy and Unknown is only set by Close, after which
Invalidate returns early.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 21:23:20 -08:00
pingqiuandClaude Opus 5.5 dc8449aef0 fix(replication): Invalidate obeys the peer state transition gate
Invalidate stored Degraded directly, so a NeedsRebuild peer could be
invalidated to Degraded and then set Healthy, escaping the terminal
state. Invalidate now checks replicaStateTransitionAllowed like
SetState: from NeedsRebuild the state is kept and the reason is still
logged; every other state still moves to Degraded.

Fixes #182.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 21:19:50 -08:00
pingqiuandClaude Opus 5.5 76c41c6c56 test(replication): Invalidate must preserve the NeedsRebuild terminal state
Reproducer for #182, unchanged from #184.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 21:19:50 -08:00
pingqiuandClaude Opus 5.5 a4c03f78ac docs: link the missing acknowledged-frontier source to #192
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 21:17:43 -08:00
pingqiuandClaude Opus 5.5 9a226af141 test(master): a survivor seen last tick but missing now does not count
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 19:51:47 -08:00
pingqiuandClaude Opus 5.5 86d4eb6c94 fix(master): prove frontier coverage before an RF3 promotion (docs, gofmt)
State the survivor rule for an unknown required frontier in the design
doc and keep the missing acknowledged-frontier source as a known gap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 19:49:08 -08:00
pingqiuandClaude Opus 5.5 7953c3af33 test(master): cover the RF3 frontier coverage rule
Known frontier covered/behind, known zero, unknown with all, some or
stale survivors, sync_all, best_effort, provider knownness, observation
freshness, and RF2 not consulting the gate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 19:47:26 -08:00
pingqiuandClaude Opus 5.5 7b3b0fb54d test(master): give single-survivor boot-grace fixtures a covered frontier
The boot-grace and recovery-watchdog tests fail over to r2 while r3 is
silent. With an unknown frontier that promotion is no longer provable
(#181), so their fixtures now state a known required frontier that r2
covers. Their assertions are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 19:47:26 -08:00
pingqiuandClaude Opus 5.5 870d920871 fix(master): prove frontier coverage before an RF3 promotion
An unknown required acknowledgement frontier was read as zero, so the
highest durable ready candidate was promoted even when only some peers
were seen; an acknowledged write could live only on an unseen peer.

The probe result now says whether the required frontier is known. With a
known frontier the candidate must cover it, as before. With an unknown
frontier under a quorum ack profile, the highest durable candidate is
promoted only when enough peers are probed ready and fresh to intersect
every acknowledgement quorum (peerCount-K+1, K from waitForSyncAcks):
RF3 sync_quorum needs both peers, sync_all needs one. Otherwise nothing
is promoted. best_effort is unchanged.

Fixes #181.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 19:42:57 -08:00
pingqiuandClaude Opus 5.5 b331ffc57a test(master): RF3 promotion with a missing required frontier must be refused
Reproducer for #181, unchanged from #184.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 19:42:57 -08:00
Ping Qiu c5a7f062a0 Merge pull request #185 from seaweedfs/docs/m5-fsync-numbers
docs: report guest fsync after the group-commit fix (#173)
2026-11-16 19:36:44 -08:00
Ping Qiu f54d50be4e Merge pull request #180 from seaweedfs/docs/invariants
docs: add the protocol contract (state machines and invariant ledger)
2026-11-16 19:36:37 -08:00
pingqiuandClaude Opus 5.5 c380bf0983 docs(design): update the fsync figures after the group-commit fix (#173)
agent-workspace-design.md (measured results) adds the post-#173 guest fsync
medians; block-design.md's known-issues entry says #173 removed the idle
group-commit wait (about 5.5 ms to 3.23 ms against 2.74 ms local) and keeps
the remaining lead (the checkpoint superblock fsync under the store lock).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 19:15:17 -08:00
pingqiuandClaude Opus 5.5 806045889b docs(measurements): say the backend Sync figure is a mean and which setups were gated
The backend Sync figure is the mean over the gate window, and the gate that
every guest fsync reaches the backend sync ran on the four Seaweed Block
setups (not on the local disk).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 17:17:03 -08:00
pingqiuandClaude Opus 5.5 4d9f00fe9f docs(invariants): narrow four statements to what the code and tests assert
Review follow-up:
- INV-WAL-SYNC-FRONTIER-001: Sync never reports an uncovered write durable;
  it returns the global synced frontier, at or above the caller's own write,
  covered by a completed fsync (TestWALGenerationFirstCallerReturnOrdering).
- INV-AUTH-PERSIST-BEFORE-PUBLISH-001 and the M2 row: store-backed only; a
  failed write publishes nothing but its outcome may be unknown, and the
  workspace path latches that uncertainty.
- INV-FE-LINEAGE-GATE-001: the volume-ID facet is marked as code reading.
- INV-CUT-READMISS-001, the M4 row and agent-workspace-design.md: a HEAD
  fill never overwrites a newer local extent version; a WAL-only write wins
  on reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 17:15:52 -08:00
pingqiuandClaude Opus 5.5 cfc48472c6 docs: mark the three confirmed invariant gaps as open issues (#181, #182, #183)
Each gap noted in docs/design/invariants.md is now confirmed by a red test
and tracked as an open issue: #181 (RF=3 promotion admitted with required
LSN zero), #182 (Invalidate bypasses the NeedsRebuild terminal state) and
#183 (a genesis Bind for a second slot of a bound volume).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 17:14:06 -08:00
pingqiuandClaude Opus 5.5 7e33a89f8c docs: report guest fsync after the group-commit fix (#173)
The README, the agent-workspace diagram and docs/workspace-measurements.md
still said guest fsync was about 7 ms against 3 ms local. A rerun after #173
(same lab pack and host, the same four setups, fio 4 KiB random write one at
a time with fsync after every write, median of 3 boots) measured a median of
3.23 ms (ublk, walstore-chunk) against 2.74 ms local. The original runs stay
as history in docs/workspace-measurements.md.

Documentation only; no code changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 17:05:23 -08:00
pingqiuandClaude Opus 5.5 458fb83a93 docs: add the protocol contract (state machines and invariant ledger)
docs/design/invariants.md lists the six state machines Seaweed Block
implements (walstore, authority, replica role and peer, workspace HEAD
holder and takeover, the cut pipeline, the chunk lifecycle) with each
transition's guard and enforcing function, and a 71-row invariant ledger
(69 ACTIVE, 2 STUB): statement, machine and transition, enforcement, tests,
TLA+ property and status. AGENTS.md gets a 'Protocol contract' section, and
the three design docs and the README link the new doc.

Documentation only; no code changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 17:01:38 -08:00
Ping Qiu d662140b45 Merge pull request #178 from seaweedfs/chore/charts-example-values
charts: move the blockNodes example to examples/values-3node.yaml with documentation addresses
2026-11-16 17:00:03 -08:00
pingqiuandClaude Opus 5.5 d96056b4c3 charts: the README's NVMe/RDMA snippet uses the values.yaml structure
blockNodes is a top-level list and frontendNetworkClass is a per-node
field; the snippet nested blockNodes under network and put
frontendNetworkClass beside it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 16:37:27 -08:00
pingqiuandClaude Opus 5.5 e585d80f8e docs(releases): replace lab addresses with RFC 5737 documentation addresses
nvme-rdma-capability-boundary.md and nvme-tcp-supported-lab.md recorded the
lab's private addresses. Replace them with documentation addresses
(192.0.2.12 internal, 198.51.100.11/12 frontend, matching the chart's
example nodes) and say so at the top of each record. Host names stay
anonymized as 'lab host A/B'; meaning is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 16:37:26 -08:00
pingqiuandClaude Opus 5.5 f5e610cabe charts: move the blockNodes example to examples/values-3node.yaml with documentation addresses
The chart README carried a full values example with lab node names and
addresses, and values.yaml defaulted blockNodes to a lab host name.

- charts/seaweed-block/examples/values-3node.yaml: the README's values
  example as a file, with nodes node-a/node-b/node-c and RFC 5737
  documentation addresses (192.0.2.x internal, 198.51.100.x frontend).
- README: links the example instead of inlining it; the NVMe/RDMA snippet
  uses the same placeholder node and addresses.
- values.yaml: the default block node is the placeholder block-node-1
  (internalIP stays 127.0.0.1) with a pointer to the example.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 16:36:51 -08:00
Ping Qiu 84aa2146a3 Merge pull request #179 from seaweedfs/docs/cleanup-and-design
docs: delete outdated docs, simplify the rest, and split the design reference with diagrams
2026-11-16 16:35:28 -08:00
Ping Qiu 621131afc9 Merge pull request #177 from seaweedfs/test/replication-repeat-safe
test: make replication recovery session fixtures repeat-safe
2026-11-16 16:35:22 -08:00
pingqiuandClaude Opus 5.5 63dcb49a54 docs: delete outdated docs, simplify the rest, and split the design reference with diagrams
- Delete the stale roadmap and eight wiki planning pages (git history keeps
  them); move the only unique content (Phase 166-170 write-path experiment
  results) into docs/releases/nvme-tcp-supported-lab.md.
- Simplify the remaining user docs; duplicated non-claim lists link to
  docs/kubernetes-status.md; lab host names and local paths are removed.
- Split docs/design/block-design.md into core, agent-workspace-design.md and
  kubernetes-block-design.md; add four SVG diagrams of the on-disk and remote
  structures and new mermaid diagrams.
- mkdocs.yml nav and README links follow the new layout; the two gate
  scripts drop the one check each that read a deleted file.

Docs only; no product code changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 16:16:02 -08:00
pingqiu 4d5e5f556f test: derive recovery session markers from current live sessions 2026-11-16 16:10:11 -08:00
Ping Qiu 86530111dc Merge pull request #173 from seaweedfs/fix/group-commit-singleton-latency
perf(storage): avoid collection delay for singleton syncs
2026-11-16 16:08:11 -08:00
pingqiu f6c1f52c1d test: write the later block only after the first physical fsync completed 2026-11-16 15:52:48 -08:00
pingqiu ddcc379470 test: assert durable global Sync frontier and retain replay fixture WAL 2026-11-16 15:50:40 -08:00