Commit Graph
3292 Commits
Author SHA1 Message Date
pingqiu f8fc136803 Merge remote-tracking branch 'origin/main' into docs/drop-row-count
# Conflicts:
#	docs/design/invariants.md
2026-11-24 21:12:23 -08:00
Ping Qiu 06e07f028f Merge pull request #570 from seaweedfs/feat/oss-snap-start
layout: a holder's start applies the local-root rules
2026-11-24 21:04:04 -08:00
Ping Qiu 1f34a10077 Merge pull request #580 from seaweedfs/ci/revert-576
ci: run the spec trace check on the project's runner again (revert #576)
2026-11-24 21:01:53 -08:00
pingqiuandClaude Opus 5.5 599caf1354 ci: run the spec trace check on the project's runner again (revert #576)
GitHub-hosted jobs for this repository wait in a shared queue: since
04:21Z every spec trace job sat queued on ubuntu-latest with no runner,
so no pull request could pass its checks. The workflow's own comment had
said so (the hosted queue can wait for hours).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 20:55:40 -08:00
pingqiuandClaude Opus 5.5 609b485604 docs: invcheck package comment matches the printed row count
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 20:20:59 -08:00
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
pingqiu a81c00be16 Merge branch 'feat/oss-snap-delete' into feat/oss-snap-start 2026-11-24 19:19:24 -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
pingqiu b4413b079f Merge branch 'feat/oss-snap-delete' into feat/oss-snap-start 2026-11-24 19:08:48 -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 a2cd2b4318 Merge branch 'feat/oss-snap-delete' into feat/oss-snap-start
# Conflicts:
#	docs/design/invariants.md
2026-11-24 18:57:09 -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 6e43955848 layout: Start validates the local root against the HEAD its claim updates
Start checked the local root against its first read of HEAD, then
claimed through a transition that read HEAD again without the check: a
claim by another lineage, or a published position rising past the local
root, between the two reads was written over. The local-root check now
runs again inside the claim's transition, on the very HEAD the
conditional update replaces.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 18:47:27 -08:00
pingqiu 7ed69b1635 Merge branch 'feat/oss-snap-delete' into feat/oss-snap-start
# Conflicts:
#	core/frontend/chunkstore/head_readers_test.go
#	docs/design/invariants.md
2026-11-24 18:45:58 -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
pingqiu 9a11df8998 Merge branch 'feat/oss-snap-delete' into feat/oss-snap-start
# Conflicts:
#	core/frontend/chunkstore/head_readers_test.go
#	core/frontend/chunkstore/layout/guard_test.go
#	docs/design/invariants.md
2026-11-24 18:36:04 -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 3e98df9da5 Merge branch 'feat/oss-snap-delete' into feat/oss-snap-start 2026-11-24 18:28:49 -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 3110026383 Merge branch 'feat/oss-snap-delete' into feat/oss-snap-start 2026-11-24 18:23:16 -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 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
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
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