Commit Graph
3242 Commits
Author SHA1 Message Date
pingqiuandClaude Opus 5.5 d32af23cae Merge 7', identity and owned deletes; start: fresh across a crash, deleting refused, cure named
A root counts as fresh from its creation until its restore's base is
durable, across any crash in between, so a restart continues the
restore (tested); a deleting volume does not start at the holder's own
epoch or above (the claim refuses it; tested now that both are on one
branch); a stale-root refusal names its cure: after a clean stop the old
directory holds nothing the published image lacks, clear it and start on
a fresh root (a planned move away and back).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 18:21:33 -08:00
pingqiuandClaude Opus 5.5 4b5e787a93 Merge the removal (7') and identity changes; volume delete deletes only its own objects
Every object entry now carries the id of its volume, stamped by the
store at create, and the store deletes on that condition
(DeleteOfVolume). DeleteVolume deletes its objects that way, so a late
delete of a finished run never removes the object of a volume created
again under the name (content names repeat across volumes). The removal
of the merged 7' change stays mark-gated; the guard keeps DeleteVolume's
order with the conditional delete.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 18:20:02 -08:00
pingqiuandClaude Opus 5.5 f5f25c1639 layout: a HEAD is read only for its own volume; holders name a claim id
DecodeHead now takes the id from the same directory's VOLUME and refuses
a HEAD carrying another volume id (ErrIdentity): a HEAD left by an
interrupted delete, or created late by an old restore, under a name
since given to another volume, is never read as this volume's. HEAD's
check refuses a holder without a claim id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 18:17:04 -08:00
pingqiu 4fe7d04692 Merge branch 'feat/oss-snap-remove' into feat/oss-snap-identity
# Conflicts:
#	core/frontend/chunkstore/layout/commit_test.go
#	core/frontend/chunkstore/layout/remove.go
#	core/frontend/chunkstore/layout/remove_test.go
#	docs/design/invariants.md
2026-11-24 18:15:51 -08:00
pingqiuandClaude Opus 5.5 249afe303a layout: removal by mark and conditional delete (7')
The removal no longer rests on a lease check before an unconditional
delete, which a delete landing after the lease and a successor's commit
defeated. Every object entry carries the session of its last writer and
a mark. RemoveUnreachable plans after BeginClean, then for each
unreachable candidate MARKs it (conditional on the metadata read for
the plan, unmarked) and DELETEs it (conditional on that mark). Writing an
object for a session (EnsureObject) creates it, or reuses an existing
one by a conditional update that sets the session and clears any mark,
so a reuse after the plan or after the mark makes the remover's write
fail its own condition, however late it lands. A commit names only
objects its own session wrote or reused, unmarked.

The source guard now requires DeleteMarked as the remover's only
removal, each immediately after a gate on its mark's error. Tests cover
both reuse windows (after the plan, after the mark), another session's
mark, the commit's session rule and the cleaning killed at each of its
six writes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 18:14:22 -08:00
pingqiuandClaude Opus 5.5 df93d2141d layout: start refuses another lineage at any epoch and old copies
At an epoch above HEAD's a holder now claims only with a fresh root (it
restores from HEAD) or the root whose claim id HEAD holds (the
continuing lineage); any other root holds data older than HEAD's image
and is refused as stale, HEAD unchanged: the directory may be the only
copy of a reported lost range, and discarding it is the operator's act.
A root carrying HEAD's claim id but synced below HEAD's published
position is an old copy and is refused too. A start killed at its claim
restarts with the same marker and continues: the claim id it writes is
the one its local root already carries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 17:37:01 -08:00
pingqiuandClaude Opus 5.5 7e92532357 layout: a holder's start applies the local-root rules
Start is the HEAD side of a holder starting on its granted line with the
claim id its local root's marker carries. At HEAD's epoch and server it
continues only on the root whose claim id HEAD holds (its own restart,
or a claim whose reply was lost); a fresh root with another claim id is
refused as a missing local root, naming the likely cause and the way
back (a forced move, also to the same host); an older root with another
claim id is refused as stale and fenced; neither writes HEAD. At a
higher epoch it claims with its local claim id. The package guard makes
Start the only caller of the claim; the HEAD reader enumeration
classifies its read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 17:31:14 -08:00
pingqiu 78e5a06bca Merge branch 'feat/oss-snap-identity' into feat/oss-snap-delete
# Conflicts:
#	docs/design/invariants.md
2026-11-24 17:27:05 -08:00
pingqiu cab8145e6c Merge branch 'feat/oss-snap-remove' into feat/oss-snap-identity
# Conflicts:
#	docs/design/invariants.md
2026-11-24 17:26:48 -08:00
pingqiuandClaude Opus 5.5 4c23e07de8 docs: one property per snapshot kernel ledger row
The removal and HEAD-write rows exceeded the ledger's 300-character
statement limit; each is now split into rows of one property (the
removal itself, what stops it, its source guard; the HEAD write path and
its source guard).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 17:26:18 -08:00
pingqiu a63a80d329 Merge branch 'feat/oss-snap-identity' into feat/oss-snap-delete
# Conflicts:
#	core/frontend/chunkstore/layout/guard_test.go
2026-11-24 16:37:39 -08:00
pingqiuandClaude Opus 5.5 e34fb5b8a4 Merge the removal guard fixes; removal refuses another claim id
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 16:36:24 -08:00
pingqiuandClaude Opus 5.5 fdf448dd99 test: removal guard needs a fresh gated lease check per removal
In RemoveUnreachable every call of a Delete* or Remove* method must be
immediately preceded by an if on StillHeld's error that returns: an
ignored check, one check reused for a second delete and an unlisted
removal method each fail (controls built from the real remove.go). The
removal refuses an older epoch of the same server and the same epoch of
another server, each alone, and every non-Run function taking a
HolderID must be covered by such a case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 16:36:10 -08:00
pingqiu 577328156d Merge branch 'feat/oss-snap-remove' into feat/oss-snap-identity 2026-11-24 16:36:10 -08:00
pingqiuandClaude Opus 5.5 804bde1832 layout: the operator's remove-dependent checks the target first
The release step alone does not look at the target, so as the
operator's command it could release a live restore target and leave its
foreign references unprotected. It is now used only by the target's own
delete (its HEAD already deleting) and by OperatorReleaseDependent,
which reads the target first and releases only if it exists and is
deleted (HEAD deleting or deleted, or its name holding another volume
id) or no root in its live HEAD names a chunk of the source. A live
target still naming the source, one being created and one never created
(the restore could still create it) are refused, and the source is not
written. The package guard restricts the release's callers and requires
the operator's read of the target; the HEAD reader enumeration
classifies it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 16:22:52 -08:00
pingqiuandClaude Opus 5.5 3001bfe635 layout: volume delete and the release of a dependent
A volume delete runs in its order, each prefix safe and the whole
re-runnable: HEAD deleting (only with no holder, checked immediately
before, no open transaction and no snapshot with dependents), then this
volume released from every source's dependents, then its objects
deleted, then HEAD deleted. HEAD gains a state; from deleting on, every
holder transition, a claim and a removal are refused. A dependent is
released from a source by the target's volume id in one conditional
update, the delete's step and the operator's remove-dependent command.

The package guard allows DeleteVolume as the second remover and
requires its order (controls: the pool before the release, no holder
check); the stale-holder table now covers holder transitions only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 16:16:17 -08:00
pingqiuandClaude Opus 5.5 aa2f91b106 layout: volume, holder and dependent identities
A VOLUME record carries a random volume id, and identities never rest on
a name that can repeat: HEAD carries the volume id; every chunk
reference in a segment carries its owner's volume id, which a read
checks against the owner's VOLUME before fetching (a volume created
again under the name is ErrIdentity) and the remover uses to tell its
own chunks; every dependent records the target's volume id and the
snapshot's root hash; and a holder is its epoch, server and the claim
id its claim writes into HEAD, so every transition refuses the same
server with another claim id. Encodings stay canonical and decoding
refuses anything else; the segment format is version 2. Nothing writes
these shapes to a store yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 16:03:19 -08:00
pingqiuandClaude Opus 5.5 c7900bb57c layout: remove pool names no root reaches, inside the lease
RemoveUnreachable is the cleaning's removal step for one pool shard: for
the holder with its own clean(session) open, it deletes each candidate
chunk that no root in HEAD (current or any snapshot) names in this
volume's pool, and checks its own lease immediately before every delete.
HEAD is read once after BeginClean: no commit can add a root while the
cleaning is open, and a claim that voids it waits for this lease to end,
which the next check sees. An unreadable root or segment stops the pass
before any delete; a lapsed lease stops it before the next one; an open
snapshot refuses it.

The package guard now allows Delete/Remove names only in
RemoveUnreachable and requires a lease check before every delete in the
same block (controls: no check, check after the delete, one check
before the loop). The HEAD reader enumeration classifies its read, and
the ledger gains the removal row and the read path's row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 15:45:51 -08:00
Ping Qiu 4a86e06748 Merge pull request #564 from seaweedfs/test/oss-snap-head-guard
test: every transition refuses a stale holder
2026-11-24 15:42:38 -08:00
Ping Qiu be8ebf1748 Merge pull request #563 from seaweedfs/feat/oss-snap-clean-session
layout: open and close a cleaning session
2026-11-24 15:30:28 -08:00
Ping Qiu 054a1b0cdc Merge pull request #562 from seaweedfs/feat/oss-snap-claim
layout: the Claim transition
2026-11-24 15:24:26 -08:00
Ping Qiu a18bc55b86 Merge pull request #561 from seaweedfs/feat/oss-snap-commit
layout: the Commit transition
2026-11-24 15:18:27 -08:00
Ping Qiu a74416368d Merge pull request #566 from seaweedfs/test/known-zero-sysfs-resolver
test: resolve the KNOWN-ZERO kernel device from sysfs
2026-11-24 15:14:13 -08:00
Ping Qiu cca045eedb Merge pull request #559 from seaweedfs/feat/oss-snap-abort
layout: the Abort transition
2026-11-24 15:08:21 -08:00
Ping Qiu de291e60e4 Merge pull request #556 from seaweedfs/test/known-zero-acceptance
test: KNOWN-ZERO acceptance test on a fresh volume
2026-11-24 15:00:34 -08:00
Ping Qiu 71a58d5f97 Merge pull request #558 from seaweedfs/feat/oss-snap-begin
layout: HEAD record and the Begin transition
2026-11-24 14:53:55 -08:00
Ping Qiu 7abbbef165 Merge pull request #553 from seaweedfs/test/node-loss-gate-no-auto-promotion
testops: node-loss gate checks no automatic promotion, then the same primary serves
2026-11-24 14:20:40 -08:00
pingqiuandClaude Opus 5.5 ed2c56d3f0 test: refuse a partial sysfs inventory in the KNOWN-ZERO resolver
An unreadable directory or file was read as empty, so a partial inventory
could resolve as exactly one device; fs.Glob also dropped directory
errors during discovery. Every read error now refuses (the wait retries),
discovery lists nvme-subsystem and reads each subsysnqn, and the
literal-path fixture holds that path as an NQN so only the prefix guard
refuses it. Adds three partial-inventory controls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 14:11:58 -08:00
pingqiu 6dd9dd99c3 Merge branch 'feat/oss-snap-clean-session' into test/oss-snap-head-guard 2026-11-24 14:01:34 -08:00
pingqiu 009f0dd94d Merge branch 'feat/oss-snap-claim' into feat/oss-snap-clean-session 2026-11-24 14:00:50 -08:00
pingqiu 8a07188cc8 Merge branch 'feat/oss-snap-commit' into feat/oss-snap-claim 2026-11-24 14:00:13 -08:00
pingqiu 8b0b2901b4 Merge branch 'feat/oss-snap-abort' into feat/oss-snap-commit 2026-11-24 13:59:49 -08:00
pingqiu d357fe902e Merge branch 'feat/oss-snap-begin' into feat/oss-snap-abort 2026-11-24 13:59:07 -08:00
pingqiuandClaude Opus 5.5 1506cc5a7a test: classify the layout transitions' HEAD read
The HEAD reader enumeration finds the layout package's one read path,
runTransition. Over an absent HEAD it refuses with ErrHeadAbsent and
writes nothing; a probe pins it with a store whose HEAD is absent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 13:58:26 -08:00
pingqiuandClaude Opus 5.5 fe095efb2e test: resolve the KNOWN-ZERO kernel device from sysfs
nvme list-subsys -o json does not list namespaces on every nvme-cli, so
the device never resolved on a real host although the kernel connected.
kzResolve now reads /sys/class like the CSI node (subsysnqn, controllers,
transport, serial, namespaces under the subsystem or the controller) with
the same refusals, and a timeout reports the last refusal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 13:55:35 -08:00
pingqiuandClaude Opus 5.5 05ebed50c2 test: keep the status endpoint on loopback when the harness listens off loopback
blockvolume refuses a non-loopback status bind; sw-block ops reach it
with --status-addr from the same host, so it uses headSzLoopbackAddr
like the NVMe listener.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 13:49:22 -08:00
pingqiu 71011fd362 Merge branch 'feat/oss-snap-clean-session' into test/oss-snap-head-guard
# Conflicts:
#	docs/design/invariants.md
2026-11-24 13:38:57 -08:00
pingqiu 65a78ec8b8 Merge branch 'feat/oss-snap-claim' into feat/oss-snap-clean-session
# Conflicts:
#	docs/design/invariants.md
2026-11-24 13:38:52 -08:00
pingqiu ca534fe118 Merge branch 'feat/oss-snap-commit' into feat/oss-snap-claim
# Conflicts:
#	docs/design/invariants.md
2026-11-24 13:38:49 -08:00
pingqiu da6bdce568 Merge branch 'feat/oss-snap-abort' into feat/oss-snap-commit
# Conflicts:
#	docs/design/invariants.md
2026-11-24 13:38:46 -08:00
pingqiu 8aef3e04cb Merge branch 'feat/oss-snap-begin' into feat/oss-snap-abort
# Conflicts:
#	docs/design/invariants.md
2026-11-24 13:38:43 -08:00
pingqiu 48dd0c5422 Merge remote-tracking branch 'origin/main' into feat/oss-snap-begin
# Conflicts:
#	docs/design/invariants.md
2026-11-24 13:38:41 -08:00
Ping Qiu c54ba73cd9 Merge pull request #560 from seaweedfs/docs/public-rule-comment-names
docs: describe public rules in comments
2026-11-24 13:38:17 -08:00
pingqiuandClaude Fable 5.1 eb471459de test: keep the NVMe/TCP listener on loopback when the harness listens off loopback
blockvolume refuses a non-loopback frontend listen; the test reaches its
NVMe target only from the same host (user-space client or kernel nvme
connect), so the NVMe address stays 127.0.0.1 (headSzLoopbackAddr) while
data and ctrl use SWBLOCK_TEST_LISTEN_HOST.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-24 13:29:39 -08:00
pingqiuandClaude Fable 5.1 6f24d3bfbe test: pass --insecure-external-bind when the harness listens off loopback
blockmaster refuses a non-loopback --listen without it; a two-host run
(SWBLOCK_TEST_LISTEN_HOST set) now passes it. Loopback runs are unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-24 13:24:47 -08:00
pingqiuandClaude Opus 5.5 cb3f23e373 docs: snapshot kernel ledger rows for this step
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 13:16:05 -08:00
pingqiu 8a8c436fbc Merge branch 'feat/oss-snap-clean-session' into test/oss-snap-head-guard 2026-11-24 13:15:55 -08:00
pingqiuandClaude Opus 5.5 f213daf8a5 docs: snapshot kernel ledger rows for this step
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 13:15:52 -08:00
pingqiu 08bd6ce82a Merge branch 'feat/oss-snap-claim' into feat/oss-snap-clean-session 2026-11-24 13:15:50 -08:00
pingqiuandClaude Opus 5.5 202c2392d1 docs: snapshot kernel ledger rows for this step
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 13:15:48 -08:00