Commit Graph
3276 Commits
Author SHA1 Message Date
pingqiuandClaude Opus 5.5 dcc6c19556 docs: the invariant row count is printed by the test, not kept in the file
Every pull request that added a row edited the hand-kept count line, so
each merge to main re-conflicted every open pull request. The check now
prints the count and fails if the file states one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 20:19:30 -08:00
Ping Qiu f4dad3a8d6 Merge pull request #569 from seaweedfs/feat/oss-snap-delete
layout: volume delete and the release of a dependent
2026-11-24 19:58:54 -08:00
Ping Qiu 89b3a4b634 Merge pull request #576 from seaweedfs/ci/spec-trace-hosted
ci: run the spec trace check on a GitHub-hosted runner
2026-11-24 19:49:30 -08:00
Ping Qiu 5625b8dab6 Merge pull request #568 from seaweedfs/feat/oss-snap-identity
layout: volume, holder and dependent identities
2026-11-24 19:46:19 -08:00
Ping Qiu 98b0c288a9 Merge pull request #573 from seaweedfs/test/systemd-serve-after-barrier
test: systemd startup gate asserts serve-after-barrier in process
2026-11-24 19:29:13 -08:00
pingqiuandClaude Opus 5.5 b81e0597d2 ci: run the spec trace check on a GitHub-hosted runner
The check runs no PR code and needs no project host, but it queued behind
the self-hosted test jobs; every PR's merge waited on that queue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 19:23:48 -08:00
Ping Qiu 3113f9420f Merge pull request #567 from seaweedfs/feat/oss-snap-remove
layout: remove pool names no root reaches, inside the lease
2026-11-24 19:22:13 -08:00
Ping Qiu b9ea626c09 Merge pull request #571 from seaweedfs/feat/wal-record-decode
storage: export a read-only decode of one v3 WAL record
2026-11-24 19:21:18 -08:00
pingqiuandClaude Opus 5.5 a3ff2ce060 docs: M9 names the tombstone create and the dependent release
The M9 introduction names its one HEAD create (the deleted HEAD the
operator's remove-dependent writes for a restore target without HEAD);
the diagram and the transition table add absent -> deleted (tombstone)
and the release of a target from a source's dependents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 19:19:20 -08:00
pingqiuandClaude Opus 5.5 74a17f96fb layout: a volume delete holds its no-holder premise with the master
The delete checked once that no block held the volume, then marked HEAD
deleting by a separate read: a grant and claim in between let it delete a
live volume. The delete now first has the master record its delete
reservation (no line is granted for the volume after it), then checks
that no line holds a live lease between the HEAD read and the
conditional update that marks HEAD deleting. After the reservation no
live lease can appear, and a claim landing between the read and the
update fails the update.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 19:08:08 -08:00
pingqiuandClaude Opus 5.5 e502ad4b92 test: the moved-away source's journal shows the refused foreign line and no adoption
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 19:05:39 -08:00
pingqiu dcd7b3c5e5 Merge branch 'feat/oss-snap-identity' into feat/oss-snap-delete
# Conflicts:
#	docs/design/invariants.md
2026-11-24 18:56:51 -08:00
pingqiuandClaude Opus 5.5 ccba156cc8 Merge the removal's convergence fix; M9 guards name the claim id
From the claim id on, the transition table's holder rule is the epoch,
the server and the claim id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 18:56:25 -08:00
pingqiuandClaude Opus 5.5 3bb31d2fa8 layout: a later cleaning reclaims a name a dead remover marked
The removal planned only unmarked candidates, so a name marked by a
cleaning that died before its delete stayed in the pool for ever. Every
found candidate is now planned with its whole tag (session and mark) as
read; the conditional mark replaces an abandoned mark, and the dead
remover's late delete, conditional on its own mark, fails. The interrupt
test now requires every orphan gone after the re-run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 18:55:25 -08:00
pingqiuandClaude Opus 5.5 0664157645 test: the moved-away source never serves and exits only 75 (no lineage of its own)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 18:45:01 -08:00
pingqiu 1d8f8c6ac7 Merge branch 'feat/oss-snap-identity' into feat/oss-snap-delete 2026-11-24 18:44:33 -08:00
pingqiuandClaude Opus 5.5 b7206486b5 test: the UTF-8 holder case fails for its own reason; M9 names the claim id
The invalid-UTF-8 holder fixture lacked a volume id and a claim id, so it
was refused for those first and a mutant dropping the holder's UTF-8
check survived; every UTF-8 case now carries the other fields and
asserts the UTF-8 refusal itself. The M9 diagram and transition table
name the claim id in Claim (replay on epoch, server and claim id;
another claim id at the same epoch and server refused).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 18:44:31 -08:00
pingqiuandClaude Opus 5.5 2fa488bedb layout: tombstone any restore target without HEAD; nothing removes a HEAD
The operator's remove-dependent now writes the deleted HEAD for any
target without HEAD, not only one without VOLUME too: a restore that
died between its VOLUME and its HEAD would otherwise leave a target
that could be neither released nor deleted, pinning the source's
snapshot for ever. The later HEAD create of such a restore fails on the
tombstone, as before.

A volume delete refuses, before any write, a listed path that is not a
pool, segment or root object, so HEAD (which stays, deleted), VOLUME and
the directory are never removed. A source scan lists every delete and
every directory-naming site in core/ and cmd/ and fails on a new one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 18:42:43 -08:00
pingqiuandClaude Opus 5.5 0666f6ad18 test: the moved-source case stops the new holder first (the simulated hosts share one volume lock directory)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 18:41:39 -08:00
pingqiuandClaude Opus 5.5 5046436c8b test: the systemd startup gate asserts serve-after-barrier in process (no fence exit) and a moved source's exit 78
Fixes #572.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 18:35:38 -08:00
pingqiuandClaude Opus 5.5 4559840134 layout: volume directories never reused; a tombstone for a target never created
A volume's directory is <name>-<first 8 hex of its volume id>, created
exclusively and never reused; the reader reads a foreign chunk from the
directory its reference's owner name and id give, after checking that
directory's VOLUME id. For a restore target never created, the
operator's remove-dependent writes a deleted HEAD exclusively in the
target's directory (a tombstone, which needs no holder) and only then
releases the dependent, so the restore can never create the target
afterwards; if the target's HEAD appears first, the release is refused.
Only that command creates a tombstone (source guard).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 18:33:59 -08:00
pingqiuandClaude Opus 5.5 0ecfbd330d storage: export a read-only decode of one v3 WAL record
DecodeWALRecordV3 wraps the decoder recovery uses (same geometry, size
and CRC checks and errors) and returns LSN, type, LBA, length and the
whole record size; WALRecordHeaderBytesV3 is the header the codec adds.
For read-only tools that analyse crash images; recovery does not use it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 18:30:57 -08:00
pingqiu b275038fb0 Merge branch 'feat/oss-snap-identity' into feat/oss-snap-delete 2026-11-24 18:28:28 -08:00
pingqiu 737fe13483 Merge branch 'feat/oss-snap-remove' into feat/oss-snap-identity
# Conflicts:
#	core/frontend/chunkstore/layout/head_test.go
2026-11-24 18:28:25 -08:00
pingqiuandClaude Opus 5.5 b95486c124 layout: the removal reads its tags before its HEAD view
Read lazily after HEAD, a candidate's tag could already be a
successor's: a stale remover that paused after reading HEAD would then
mark and delete a chunk the successor had reused and committed. The
removal now reads every candidate's tag first, only then reads HEAD and
requires it is still this holder's with its own cleaning, and marks
against the earlier tags: a successor that acted before the HEAD read
leaves a HEAD that is not this holder's (nothing is written); one that
acted after rewrote the tag (the mark fails). Tests cover both, and the
old order fails the first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 18:27:12 -08:00
pingqiu 6f7cf03477 Merge branch 'feat/oss-snap-identity' into feat/oss-snap-delete 2026-11-24 18:23:13 -08:00
pingqiu d5bc889f7f Merge branch 'feat/oss-snap-remove' into feat/oss-snap-identity 2026-11-24 18:23:10 -08:00
pingqiuandClaude Opus 5.5 4310a09469 test: the removal's conditional writes on a real filer
An integration test (stock weed, chunkstore_integration tag) runs the
layout's object writes against a real filer through a filer-backed
object store whose entries carry the writer's session and the removal
mark as extended attributes: a delete with another mark is refused; a
reuse by a successor makes the remover's late mark and late delete both
fail their conditions and the object stays; a mark on the current
metadata and its own delete remove it; deleting a missing entry
succeeds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 18:23:08 -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
Ping Qiu 7a14a0fd33 Merge pull request #547 from seaweedfs/fix/authority-dir-fsync
fix: a failed directory fsync fails every authority store write
2026-11-24 17:32:05 -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
pingqiuandClaude Opus 5.5 da0ed44c94 docs: INV-AUTH-PERSIST-BEFORE-PUBLISH-001 statement under 300 bytes
The "never reported as failed" detail is already in the row's note.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 17:23:50 -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 2aebd987ef test: reload after the fail-stop must return exactly the written record
The reload used Load, which hides skipped corrupt records, and accepted
no record. The child stops after the rename without a power loss, so the
record is on disk: reloadExactly requires LoadWithSkips to return it
(deep-equal) with no skip, and its own controls refuse a corrupt, a
missing and a different record. The latch note and comments no longer
name a directory sync failure as a latch cause (that case fail-stops).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 15:51:22 -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
pingqiuandClaude Opus 5.5 6c0e1ad9e0 fix: fail-stop when the directory fsync after a rename fails
The rename is done, so a failed directory open or fsync leaves the
record's durability unknown. Reporting "failed" let a restart reload a
write its caller had acted on as failed. blockmaster now exits
(ExitDurabilityUnknown = 74, typed line) for every record type; the
restart reloads whatever survived. A close error after a good fsync is
reported written. Windows keeps its previous behaviour. The fault seam
names the step (open, fsync, close). INV-AUTH-PERSIST-BEFORE-PUBLISH-001
rewritten to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 15:34:59 -08:00
pingqiuandClaude Opus 5.5 7c7d1223de test: a directory fsync failure after the rename must fail-stop (red)
The child process does one Put with an injected directory fsync failure;
it must exit ExitDurabilityUnknown with the typed line and never return
to its caller. The parent reloads the store: the record or none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 15:31:49 -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