Commit Graph
243 Commits
Author SHA1 Message Date
pingqiu d2a778f849 storage: persist dark v3 chunk LSN maps as owned immutable COW generations 2026-11-17 02:22:32 -08:00
pingqiuandClaude Opus 5.5 40b7614faf storage: v3 store core, W modes C/A, R<W* recovery and the drop fence (format bump row 5)
DESIGN r15 sections 6.1 to 6.6 (f2122d66), PLAN row 5 (b870a569). Dark:
the only constructor is createWALStoreV3ForTest; the v2 path is unchanged.

- recovery_v3.go (pure): scan start max(BaseCursor, retainedTail) (G2),
  floor F, contiguous prefix R and its end E over the row-4 trusted chain,
  the R < W* decision (wal_corrupt when serving; ErrBaseIncomplete, plus
  ErrInstallSuffixDamaged and WALIntegrity when damaged, while installing),
  and the exact fence ranges over [E, floor+WALSize), split at the wrap.
- walstore_v3.go: open selects a slot, scans (row 4), decides, replays the
  records <= R last-writer-wins, fences and fsyncs the exact ranges through
  the leaf, publishes retainedHead = E, restores the writer to E, and only
  then admits. Sync mode C publishes the previous batch's W, so one fsync
  covers WAL and slot; mode A fsyncs the WAL, then publishes W = H.
  refreshW, and SetWMode under the group-commit leader role, publish
  W = Wack. An append pwrite error latches the store-global fault.
- Tests: I1 across reopen in both modes; the C window (newest batch
  truncated in C, wal_corrupt in A; second-newest wal_corrupt in both);
  refresh and SetWMode(A) close it; a torn unsynced tail is never corrupt;
  the G1 resurrection schedule (and its no-fence counterexample); a
  byte-exact fence at an unaligned E; the append write-error latch.
- invariants.md: INV-WAL-V3-W-001 and INV-WAL-V3-FENCE-001 (STUB).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 02:10:55 -08:00
pingqiu f3cccff9cc docs: bind dark v3 writer scan guards and proof scope to invariant ledger 2026-11-17 02:04:15 -08:00
pingqiuandClaude Opus 5.5 f031f03d1b storage: latch a v3 slot write error inside the fsync leaf (row 3 amend 2)
codex01 row 3 round 2 (092784eb, AMEND, one P1): the store fault for a
slot write error was latched after syncFile released fileSyncMu, so an
independent store Sync queued on fileSyncMu could fsync and acknowledge
through the uncertain slot. The write callback now latches before it
returns, inside the leaf. Control: a store Sync queued behind a failing
full or partial slot write is refused without fsync, with the harness
running it right after the unlock and before the publisher resumes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 01:58:38 -08:00
pingqiuandClaude Opus 5.5 092784eb80 storage: v3 publisher latches slot write errors and pins the uncertain candidate (row 3 amend)
codex01 row 3 review (c9790ac4, AMEND):
- P1: a slot pwrite error (full or partial), like an fsync error, now
  latches a publisher failure (ErrDescriptorPublishUncertain) and the store
  fault through descriptorIOV3.latch, retains the uncertain candidate, and
  refuses every further publication, rollover and reuse with no further
  I/O until reopen reads the slots back (DESIGN 5 failure rule). The v2
  syncFile leaf is unchanged.
- P2: publication-side counter checks return ErrCounterExhausted before
  any write; installed -> installing is refused (not an 8.5 edge).
- Tests: full and partial slot write then error (refusals, no further
  writes, no reuse, store fault latched, reopen selects the previous gen
  after a torn write and the new gen after a complete one); counter
  exhaustion for W, checkpoint, head and map generation; the extra edge.
- invariants.md: INV-WAL-V3-PUBLISH-001 statement and tests updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 01:52:02 -08:00
pingqiuandClaude Opus 5.5 c9790ac474 storage: v3 descriptor publisher, lock graph and metadata-only rollover (format bump row 3)
DESIGN r15 sections 4, 5 and 5.1 (f2122d66), PLAN row 3 (b870a569).
Dark: used by no production path yet; the v2 checkpoint path is
unchanged (retired in row 14a). Wiring into the v3 store follows rows 4/5.

- descriptor_v3.go: publish takes WALStore.mu (snapshot only) then descMu,
  releases the store lock before slot I/O, and writes the fallback slot
  with slotGen+1 through the syncFile leaf. It rebases onto the
  authoritative descriptor, max-merges W and the checkpoint, refuses
  identity/geometry/nonce changes, tail regression, map root changes
  without a higher generation and BASE edges outside 8.5, validates the
  whole slot, and rechecks the sticky fault at the success boundary.
  reuseFloor is min of both tails within one nonce (none across nonces);
  rolloverIfPinned republishes unchanged when the fallback pins reuse.
- Tests: alternation and reopen selection, monotonic merge, 40 concurrent
  publishers, a lock-order recorder, sticky fsync and success-boundary
  refusals, full-ring rollover and its failure, mixed nonces, BASE edges.
- invariants.md: INV-WAL-V3-PUBLISH-001 (STUB until activation).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 01:43:52 -08:00
pingqiu 26f4cb77eb storage: add dark impl-3 record codec and byte contract tests 2026-11-17 01:33:31 -08:00
pingqiuandClaude Opus 5.5 1de78938a9 storage: v3 descriptor slot codec, validity and A/B selection (format bump row 1)
DESIGN r15 section 2 (f2122d66), PLAN row 1 (b870a569). Dark: no
production open or create path reaches the v3 codec until activation
(row 12b); v2 superblock.go is unchanged.

- superblock_v3.go: 4096-byte slots A@0/B@4096, WAL at 8192; CRC32C
  (Castagnoli) over [0,4092); reserved bytes, flags, impl acceptance,
  slotGen/nonce, checked geometry, BASE per-state rules (installed may
  have BaseCursor below retainedTail, r15), WMode, MigrationPhase, and the
  slot-local map coverage CheckpointLSN <= C <= W. Selection: the valid
  selectable slot with the higher slotGen; a prepared slot is never
  selected (ErrMigrationIncomplete when it is the only one); equal
  generation with different bytes or identity/geometry mismatch refuse.
  Counters stop at 2^64-2 (ErrCounterExhausted).
- Tests decode 25 vectors from an independent stdlib generator with its
  own CRC32C (testdata/format_v3/slot), re-encode the positives
  byte-exact, and cover selection, exhaustion and the r15 installed rule.
- invariants.md: INV-WAL-V3-DESCRIPTOR-001 (STUB until activation).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 01:28:38 -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
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 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 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
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
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
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 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
pingqiuandClaude Opus 5.5 663ab3b2c3 docs: README v2 with standalone deployment, Kubernetes status and workspace measurements
The README is rewritten to about 230 lines. Detail that used to live in the
README moves to linked documents:

- docs/standalone-deployment.md: running blockmaster and blockvolume
  without Kubernetes, with a read-only first-volume check and a separate
  write test for scratch hosts.
- docs/kubernetes-status.md: the Kubernetes alpha feature status and
  non-claims.
- docs/workspace-measurements.md: the agent workspace measurements.
- deploy/config and deploy/systemd: env files, a topology example and
  systemd units for blockmaster and blockvolume (plus a ublk variant).

docs/quickstart-kubernetes.md and docs/design/block-design.md are updated
to match current main (auto durable-impl default, fuzz targets, the
concurrent filer CAS test, the CI workflow, the TLA+ specs in docs/spec),
and docs/assets/seaweed-block-hero.svg is refreshed.

Docs and example configuration only; no code changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 14:01:51 -08:00
Ping Qiu 1c497b0eb0 Merge pull request #169 from seaweedfs/docs/tla-spec
docs/spec: add TLA+ models of the volume lifecycle, takeover, WAL recovery, cut pipeline and GC timing
2026-11-16 12:48:13 -08:00
pingqiuandClaude Opus 5.5 e573edb0f1 docs(design): walstore is the default engine; smartwal is experimental
Match blockvolume's auto default (new volumes are walstore, an existing
volume opens with its on-disk format): §1.3 lists smartwal's open issues
and says it is not a default; the open-items entry no longer says the
standalone default is smartwal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 12:34:23 -08:00
pingqiuandClaude Opus 5.5 cd16a2a90b docs/spec: add TLA+ models of the volume lifecycle, takeover, WAL recovery, cut pipeline and GC timing
docs/spec/ holds 12 TLA+ models of the block protocols with their TLC
configurations (cfg/, 199 files: designs, RED configs that remove one guard
and must produce a counterexample, and reachability witnesses), run.sh to
check one configuration, and a README: how to run TLC, one row per spec
(invariants, results, the code it maps to), limits, the findings that led
to #152, #156, #158 and #159, and the open model-level items.

Docs only; nothing runs in CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 11:55:16 -08:00
pingqiuandClaude Opus 5.5 bc07589243 docs: add the block design document
docs/design/block-design.md describes the current design of the block
service: the data path and WAL, replication and recovery, the chunk
snapshot/fork/GC control plane, and the frontends. Each claim names the
source file and the test that pins it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 11:46:31 -08:00
pingqiuandClaude Opus 5.5 173b20895b docs: label the snapshot/fork and cut numbers as a host-side proxy
The snapshot, fork and parallel-upload cut numbers come from a host-side
proxy (chunks as local files, a deterministic filer metadata model; no
network, guest fsync or block frontend), not from the Firecracker runs. Say
so in the section intro, the table caption, the cut sentence and the image
footer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 07:58:04 -08:00
pingqiuandClaude Opus 5.5 7b78864588 docs: README leads with agent workspace disks; keep the Kubernetes alpha section
Adds an 'Agent workspace disks' section: a local-speed disk per agent microVM,
incremental chunk snapshots to SeaweedFS, cheap snapshot/fork, host moves with
fenced HEAD takeover, measured workspace workloads and snapshot/fork cost, the
sw-block ops chunk lifecycle commands, correctness work and what is not claimed
yet. Adds the overview image docs/assets/seaweed-block-agent-workspace.svg.

The Kubernetes alpha content is unchanged apart from heading levels and the
status table title.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 07:57:26 -08:00
pingqiu 882f8aed6a Merge main into fsync latency breakdown; retain recovery and timing status 2026-11-16 02:02:38 -08:00
pingqiu f7a0279211 fix: validate ublk writes before lazy timing provider lookup 2026-11-16 00:53:34 -08:00
pingqiu 2b079007bd fix: forward durable timing through production ublk provider 2026-11-16 00:41:47 -08:00
pingqiu d42e123a89 docs: explain durable latency populations and fsync diagnosis 2026-11-16 00:24:25 -08:00
pingqiu 342dc3529a fix: separate workspace lease expiry with a clock skew margin 2026-11-15 23:30:05 -08:00
pingqiu ddae3ac15e test: pin failure joins range reuse and document manifest compatibility 2026-11-15 18:39:35 -08:00
pingqiu a42b54235c fix: make workspace host fencing terminal across guard installation 2026-11-15 13:43:46 -08:00
pingqiu 69e9fbc4fe feat: enforce workspace leases in the blockvolume lifecycle 2026-11-15 13:35:18 -08:00
Ping Qiu 49b726d6dd durable: remove successful write logging without weakening I/O drain (#105) 2026-11-15 10:18:02 -08:00
pingqiu c335e9737f phase169: close rejected segmented WAL milestone 2026-07-30 00:43:38 -07:00
pingqiu c3dd8a8e22 phase168: close rejected native WAL milestone 2026-07-29 23:15:13 -07:00
pingqiu 898ef1c97f phase168: plan Linux native WAL execution 2026-07-29 20:59:31 -07:00
pingqiu 19cce945e5 phase167: plan parallel write engine milestone 2026-07-29 16:11:40 -07:00
pingqiu 0dce26d2b0 phase165: add kubernetes nvme rdma publish attach 2026-07-18 03:03:54 -07:00
pingqiu 18245463c5 phase164: harden standalone nvme rdma lifecycle 2026-07-18 01:53:29 -07:00
pingqiu b0bfb5b3f3 phase163: harden nvme rdma bridge boundaries 2026-07-18 01:14:15 -07:00
pingqiu ab0930c399 phase163: add standalone nvme rdma live path 2026-07-18 01:07:05 -07:00
pingqiu 070f3c9597 phase162: add nvme rdma listener start skeleton 2026-07-17 01:08:31 -07:00