Commit Graph
3284 Commits
Author SHA1 Message Date
pingqiu 4af20f8ac2 Merge remote-tracking branch 'origin/main' into feat/phase0-auth
# Conflicts:
#	docs/design/invariants.md
2026-11-24 19:46:12 -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
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 db2067a2da test: every operator or admin method is strict unless named with its reason
The strict-method guard is inverted: a new operator or admin method added
without Strict fails, and ReportClusterEvent (event log append only) is the
one named exception. The guide says the attempt line survives a blockmaster
crash, not a host crash.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 19:10:30 -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
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
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 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
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
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 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 4250b2d06e Merge remote-tracking branch 'origin/main' into feat/phase0-auth
# Conflicts:
#	docs/design/invariants.md
2026-11-24 17:32:03 -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
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
pingqiuandClaude Opus 5.5 252f41a6c2 fix(auth): a strict call is refused without an audit log (and TLS requires --audit-log); the overflow warning is off the caller path; strict queue-full drops are counted; the census descends into selector receivers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 16:00:18 -08:00
pingqiuandClaude Opus 5.5 e57773d678 test(auth): red: strict call without an audit log; overflow warning on the caller path; uncounted strict drop; nested bypass reference
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 15:59:02 -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
pingqiuandClaude Opus 5.5 ddf7596f96 test(auth): the development-bypass census counts every reference (aliases, initializers, renamed and dot imports) with negative controls
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 15:44:22 -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 b824366163 feat(auth): mutating operator and admin calls write their audit attempt first or are refused (strict rules); /status/audit counts dropped lines
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 15:38:24 -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 3007058e46 test(auth): guard: the development-mode bypass has one production caller; docs: two role-file lines with one node id are two keys of one server
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 15:33:14 -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
pingqiuandClaude Opus 5.5 c5c818f376 fix(auth): streams re-apply the method's rule for the current role; audit never blocks a call (bounded queue, accepted node calls skip it); a validated reload is published before it is logged
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 15:28:08 -08:00
pingqiuandClaude Opus 5.5 03ce649868 test(auth): red: a downgraded role keeps its stream; a blocked audit writer stalls node responses and revocations
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 15:26:43 -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
pingqiu d67b35050a Merge remote-tracking branch 'origin/main' into fix/authority-dir-fsync 2026-11-24 15:20:35 -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
pingqiuandClaude Opus 5.5 cde691b550 test: T9 leases survive 20 forced reconnects (test-only connection age; grace scales with a short age)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 15:13:07 -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
pingqiuandClaude Opus 5.5 c506956740 test: T6/T7 seal then lose the certificate (no write after the seal)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 15:01:14 -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
pingqiuandClaude Opus 5.5 29c917aac1 test: T6 expired and T7 revoked holder certificate: fence, admin forced move, lost range
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 15:00:19 -08:00
pingqiuandClaude Opus 5.5 bfaf9aec19 test: T13 keeps the plaintext refusal; the operator's forced move is T7's
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 14:58:56 -08:00
pingqiuandClaude Opus 5.5 8578b80cc9 sw-block: 'not authorized' (exit 5) with the cure for a refused caller or a plaintext client of a TLS master; T13
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 14:55:56 -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
pingqiuandClaude Opus 5.5 d5b96e7826 fix(master): a heartbeat for another server id is refused before its report is validated
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 14:47:56 -08:00
pingqiuandClaude Opus 5.5 3c38ad18ef test: phase 0 procedure tests T8, T11, T12 on the TLS binaries
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 14:45:02 -08:00
pingqiuandClaude Opus 5.5 b842582d5f test: the revoke-crash procedure renews as its holder over mutual TLS when the gate runs on TLS
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 14:42:46 -08:00
pingqiuandClaude Opus 5.5 bf91dce8b4 test: the procedure harness runs on mutual TLS (SW_BLOCK_PROCEDURE_TLS=1)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 14:30:32 -08:00
pingqiuandClaude Opus 5.5 8165ac9414 test(auth): T10 renewal-path cost at 32 volumes; the per-call check never waits for a reload
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 14:28:40 -08:00
pingqiu af3493ed0f Merge remote-tracking branch 'origin/main' into feat/phase0-auth
# Conflicts:
#	cmd/blockvolume/chunk_maintenance.go
#	core/host/master/services.go
#	core/host/volume/host.go
#	docs/design/invariants.md
2026-11-24 14:21:44 -08:00