Commit Graph
3468 Commits
Author SHA1 Message Date
pingqiu f672be4545 Merge branch 'feat/oss-snap-begin' into feat/oss-snap-abort
# Conflicts:
#	core/frontend/chunkstore/layout/head.go
2026-11-24 12:42:06 -08:00
pingqiu d713c435aa Merge branch 'feat/oss-snap-abort' into feat/oss-snap-commit 2026-11-24 12:42:06 -08:00
pingqiuandClaude Opus 5.5 b3c7ae2b0b layout: one HEAD write path and its guard
Begin now writes through runTransition, the one read-apply-update path
every transition will use. A source-scan guard holds for the whole
series without edits: only runTransition calls UpdateHead and the store
cannot create a HEAD; every Run transition must have its closure and
interrupt tests; only a claim waits for the old lease; and no function
removes a store object until removal brings its own lease re-check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 12:41:40 -08:00
pingqiuandClaude Opus 5.5 f17d6ad8c4 test: enumerate the HEAD writers of the layout package
A source scan fails when UpdateHead is called anywhere but the shared
read-apply-update path, when a transition is added or removed without
being listed, when the HEAD store gains a way to create a HEAD, or when
the old-lease wait moves out of the claim. Every pure transition is
checked to refuse a holder below HEAD's epoch in every activity.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 12:38:53 -08:00
pingqiuandClaude Opus 5.5 9dd23468d4 layout: open and close a cleaning session
BeginClean moves activity idle -> clean(session) and EndClean moves it
back to idle, each by one conditional update for the holder at HEAD's
epoch. A cleaning and a snapshot exclude each other through the one
activity field; a claim voids an open cleaning. Replays of a lost reply
write nothing. Removal of pool names inside the session comes
separately.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 12:37:35 -08:00
pingqiuandClaude Opus 5.5 33416433e4 layout: the Claim transition
Claim lets a holder granted a newer epoch take HEAD: epoch and holder
are set and any open session or cleaning is voided (activity idle); the
image and snapshots are unchanged. The wait for every older holder's
lease to end is an explicit guard, run after HEAD is read and before
the one conditional update, on every claim that changes HEAD. A HEAD
already held by the caller at that epoch is a replay; an older epoch,
or the same epoch held by another server, is refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 12:36:04 -08:00
pingqiuandClaude Opus 5.5 99c6a50749 layout: the Commit transition
Commit ends a snapshot session: for the holder at HEAD's epoch with
snap(session) open, one conditional update sets the current root, the
position and an optional named snapshot and returns activity to idle.
Before it, every object the new root reaches must be written: the
chunks of this volume that are new against HEAD's current root, every
segment, and the root. The previous manifest must rebuild to HEAD's
current root, so what is new is checked, not trusted; unchanged and
foreign chunks are not looked up. A HEAD that already shows the commit
is a replay and nothing is written or looked up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 12:34:28 -08:00
pingqiu aad7a19906 docs: describe public rules in comments 2026-11-24 12:32:05 -08:00
pingqiuandClaude Opus 5.5 d75e385506 layout: the Abort transition
Abort moves activity snap(session) -> idle for the holder at HEAD's
epoch by one conditional update and changes nothing else; it is also
how a holder rolls back the session HEAD names after its own crash.
Abort over idle is a replay of a lost reply and writes nothing; another
open session or a cleaning is refused. Begin and Abort share one
read-apply-update path that refuses an absent HEAD.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 12:31:47 -08:00
pingqiuandClaude Fable 5.1 8083255487 test: KNOWN-ZERO target reserves the handed-off ports before the harness
The harness constructor picks five ports; the target role now reserves
the data and ctrl ports from the handoff before it runs, so none of them
can be picked locally and then refused as a collision
(TestKnownZeroTargetReservesBeforeHarness). Comments name the steps
instead of internal document revisions.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-24 12:30:43 -08:00
pingqiu 8aaf3e4c7d Merge remote-tracking branch 'origin/main' into fix/no-reassign-on-unknown-primary
# Conflicts:
#	docs/design/invariants.md
2026-11-24 12:29:42 -08:00
pingqiuandClaude Opus 5.5 67b5f0184f layout: HEAD record and the Begin transition
HEAD is the volume's one mutable entry: epoch and holder, the open
transaction (activity idle, snap(session) or clean(session)), the current
root and position, and the named snapshots with their dependents (at
most 100). Its encoding is canonical JSON; decoding refuses unknown
fields and any bytes Encode would not write.

Begin moves activity idle -> snap(session) for the holder at HEAD's
epoch, by one conditional update on HEAD's generation. Begin of the
session already open is a replay and writes nothing; another open
session, a cleaning, another epoch or another holder is refused; an
absent HEAD is refused and never created.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 12:27:56 -08:00
Ping Qiu 154e4bc666 Merge pull request #518 from seaweedfs/test/1.0.1-live-holder-delete-red
fix: a volume whose holder never claimed HEAD is deletable
2026-11-24 12:27:41 -08:00
pingqiuandClaude Fable 5.1 eca3110e3b test: KNOWN-ZERO review fold: device witnesses, strict step 1, checked writes, reserved ports
- device mode reads the first block of every written file (FIEMAP via
  filefrag, 4 KiB blocks) through the user-space client and requires it to
  equal what was written: the block witnesses step 4 reads before hydration
- step 1 passes only with 0 candidates in S0 and every chunk known-zero
  (kzStep1Pass; a partial certification or any scan refuses)
- a file write fails on any writer error, also one with output, and on a
  read-back sha256 that differs (kzCheckWrite)
- the target role reserves the handed-off data and ctrl ports before it
  picks its own (kzReserve)

Table tests for all four in known_zero_checks_test.go (no build tags).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-24 12:24:16 -08:00
pingqiuandClaude Opus 5.5 7581ad7781 layout: resolve an image root -> segment -> chunk
Reader opens a root of a volume and resolves a chunk index through the
shard's segment to its ref, then reads the bytes from the pool of the
volume the ref names (a restore's source for a foreign chunk). An index
the root does not name reads as zeros; a root, segment or chunk the root
reaches but the store lacks is ErrMissing, never zeros; bytes that do
not hash to their name, or a segment holding another shard, are
ErrCorrupt; a failed fetch is neither. DecodeRoot now checks the error
of its re-encoding as DecodeSegment does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 12:14:26 -08:00
pingqiuandClaude Fable 5.1 adad5e271b test: run TestKZHoldNeverInReleaseBuild under -short too
CI runs go test -short; the check builds blockvolume twice (a few
seconds) and must run there, not only in a full local run.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-24 12:12:52 -08:00
pingqiuandClaude Fable 5.1 ddb6ff5771 test: KNOWN-ZERO acceptance test on a fresh volume
TestKnownZeroAcceptance (tags subprocess chunkstore_integration, KZ_RUN=1)
runs the five acceptance steps on a fresh volume (KZ_SIZE, default
1T), each printing one "KZ STEP n PASS|FAIL" line with its counters into
KZ_REPORT:

1. the empty first snapshot stages and uploads nothing and HEAD names no
   segment; the fresh attach certified the chunks known-zero;
2. mkfs (ext4 and xfs) or known blocks, sync, snapshot: the cut's work is
   bounded by the chunks touched;
3. restore and fork of that snapshot on another server node: contents
   equal, the first snapshot of each target without a full scan;
4. reads of snapshot-named blocks before hydration return data, never
   zeros, and each read waits for its own fetch (AbsentChunks, Hydration);
5. the first start of a fresh volume killed before its attach commit: after
   the restart nothing is certified known-zero, the first cut scans every
   chunk once, the data reads back exactly.

KZ_ROLE source|target splits steps 3-4 onto a second host through a handoff
file; SWBLOCK_TEST_LISTEN_HOST (default 127.0.0.1) lets the test harness
bind a host address instead of loopback. KZ_DEVICE=1 uses the kernel
NVMe/TCP device, resolved only by the run's own NQN (kzResolve, with table
tests); a path given by name is never formatted.

Step 5 stops the process at the provider's existing boundary before the
fresh marker is retired, through a binary built with -tags kzhold
(HoldBeforeChunkFreshRetireForTest); a normal build contains none of it,
which TestKZHoldNeverInReleaseBuild checks.

The volume-size test's cluster and volume start move into shared helpers
(headSzStartCluster, headSzStartVolume) used by both tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-24 12:09:51 -08:00
pingqiu 0aa6dcd24e Merge remote-tracking branch 'origin/main' into fix/1.0.1-live-holder
# Conflicts:
#	docs/design/invariants.md
2026-11-24 12:02:48 -08:00
pingqiuandClaude Opus 5.5 a70893e6f2 docs: ledger row INV-PROMOTE-UNKNOWN-CURRENT-001 with its regression tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 11:58:01 -08:00
Ping Qiu 346fd4bf1c Merge pull request #555 from seaweedfs/feat/oss-layout-pure
layout: content names, shard paths and manifest encodings
2026-11-24 11:58:00 -08:00
pingqiuandClaude Opus 5.5 08266ff2cf docs: NeverStarted r2 results keep the exact configuration names
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 11:57:20 -08:00
pingqiuandClaude Opus 5.5 d74944ae2e docs: the delete and re-run edges in M2; pinned NeverStarted r2 results in the spec index
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 11:57:02 -08:00
Ping Qiu 499663ad42 Merge pull request #554 from seaweedfs/docs/masterwait-single-master-store
docs: require one blockmaster per store
2026-11-24 11:50:40 -08:00
pingqiuandClaude Opus 5.5 75ec20ba7e layout: content names, shard paths and manifest encodings
A pure package for the content-named store layout: a chunk is named by
its index and the SHA-256 of its bytes and lives under
pool/<index/10000>/; a manifest is split into one segment per shard
(seg/<shard>-<sha256>) and a root naming them (root/<sha256>). Encodings
are canonical: decoding refuses any bytes Encode would not write, so an
object has one encoding and one name. Present and MissingOwn look names
up only: an entry that exists is complete, and a failed lookup is an
error, never absent. Nothing uses the package yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 11:48:46 -08:00
pingqiu 043df80794 docs: require one blockmaster per store 2026-11-24 11:43:02 -08:00
Ping Qiu cba3fae34a Merge pull request #535 from seaweedfs/fix/master-wait
fix: a workspace primary waits for an unreachable master instead of exiting
2026-11-24 11:25:13 -08:00
pingqiuandClaude Opus 5.5 9c77bc66f1 test: guard: the node registry is written only by the start-up import
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 11:08:35 -08:00
pingqiuandClaude Opus 5.5 fbcc89a5e6 docs: hosts' clocks stay within the clock-skew bound, or the lease bound does not hold
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 11:07:25 -08:00
Ping Qiu da5accc062 Merge pull request #552 from seaweedfs/test/head-readers
test: enumerate every HEAD reader and pin its absent-HEAD behaviour
2026-11-24 10:53:19 -08:00
Ping Qiu 9f98eb0e3b Merge pull request #550 from seaweedfs/test/interrupt-every-step
test: kill volume delete, fork and restore at every step and re-run
2026-11-24 10:46:06 -08:00
pingqiuandClaude Opus 5.5 6c620a4165 docs: the Kubernetes alpha manual failover names the failback path
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 10:45:02 -08:00
pingqiuandClaude Opus 5.5 5d0c9d8cec test: enumerate every HEAD reader and pin its absent-HEAD behaviour
A source scan lists every non-test function in core/ and cmd/ that reads
a volume's HEAD (ReadHead, GetHead, GetHeadRoot, getHeadRoot, headExists,
or a LookupEntry of HEAD) and fails when a reader is added or removed
without classifying it. Each reader names what it does when HEAD is
absent and the probe that pins it; readers that take an absent HEAD for
an empty one are marked GAP, so a change to that behaviour flips their
probes on purpose.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 10:43:19 -08:00
pingqiuandClaude Opus 5.5 3bb1cfb1e9 test, docs: a missing primary pod is unknown: no automatic reassign; Kubernetes alpha failover is manual
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 10:37:36 -08:00
pingqiuandClaude Opus 5.5 aec5d41c54 test: kill volume delete, fork and restore at every step and re-run
A trace-driven matrix: each command is run once through a recording
filer to enumerate its filer writes (its step boundaries); then for every
write it is killed before the write reaches the filer and after it
applied with its reply lost, the catalog restarted, and the command
re-run (twice) with the same request id. The end state and the data are
checked: the volume deleted and refused, or the fork's or restore's
image reading back byte for byte. A killed fork's copy intent may outlive
the replay; the test checks it is that request's and that the copy sweep
past the deadline settles it with the image intact. A step added to a
command is covered without editing the test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 10:37:30 -08:00
pingqiuandClaude Opus 5.5 3aafd4e1f1 fix(master): never reassign on a primary that did not answer its status probe
An unknown fact is not a failed one: the unsupported promotion path now
moves the line only on the current primary's own not-ready report, like
the supported path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 10:28:49 -08:00
pingqiuandClaude Opus 5.5 af8473c561 test: red: the unsupported path reassigns when the current primary does not answer its status probe
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 10:28:00 -08:00
pingqiuandClaude Opus 5.5 0d51336a28 docs: the availability window of an interrupted never-started delete
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 10:20:48 -08:00
pingqiuandClaude Opus 5.5 aa53f203b3 test: a new delete token meeting a deleting HEAD is admitted by the verdict
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 10:19:52 -08:00
pingqiuandClaude Opus 5.5 39ebfe2a81 docs: the live-holder delete row cites the exhaustive r2 model and what it leaves out
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 10:16:21 -08:00
pingqiuandClaude Opus 5.5 9ec7ed8214 docs: the caller identity term is on #548
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 09:29:45 -08:00
pingqiuandClaude Opus 5.5 1962369a92 docs: caller identity term, control API authorization row, operator guide authentication section
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 09:28:45 -08:00
Ping Qiu c7b8c0f78c Merge pull request #546 from seaweedfs/test/537-slow-precopy-budget-outcome
test(durable): accept bounded slow precopy readiness outcomes
2026-11-24 09:20:14 -08:00
pingqiuandClaude Opus 5.5 0f0da4a7f0 blockcsi: --master-tls-cert/--master-tls-key/--master-ca; tests for tool TLS identity
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 09:20:02 -08:00
Ping Qiu 7e3c720768 Merge pull request #545 from seaweedfs/test/537-takeover-attach-budget
test(durable): accept bounded takeover readiness refusal
2026-11-24 09:19:36 -08:00
pingqiuandClaude Opus 5.5 70f5fa2acf docs: a new token on a committed reservation also skips the verdict
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 09:18:49 -08:00
pingqiuandClaude Opus 5.5 979b859ae5 auth: DevCall marks in-process handler calls in tests as development mode
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 09:13:56 -08:00
Ping Qiu 06dabf547d Merge pull request #544 from seaweedfs/test/537-cold-precopy-loaded-context
test(durable): quarantine unresolved cold precopy accounting
2026-11-24 09:13:15 -08:00
pingqiuandClaude Opus 5.5 dc359e16c8 sw-block: mutual TLS to blockmaster from SW_BLOCK_TLS_CERT/_KEY/_CA
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 09:12:42 -08:00
pingqiuandClaude Opus 5.5 7b96570505 feat(auth): the append-only audit log
Phase 0, S6: AuditLog writes one JSON line per event: every operator and
admin call (accepted or refused, including a handler's RequireRole
refusal), refused node calls at most once a minute per (fingerprint,
result, method), and every role-file reload with its outcome; accepted
node calls are not recorded. blockmaster --audit-log turns it on (with
authentication only).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 09:07:36 -08:00
pingqiuandClaude Opus 5.5 ec049adacb feat(master): node calls only for their own server id; forced move needs admin
Phase 0, S5: heartbeat, assignment stream (every volume), renewal and ACK
require the caller's certificate id to be the request's server id
(auth.RequireNode); the registered-host address checks stay beside it.
QueryVolumeStatus admits a node only for a volume whose line it
holds. A forced MoveWorkspace needs an admin. Development mode admits as
before. T2 starts its master.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 09:05:58 -08:00