Commit Graph
698 Commits
Author SHA1 Message Date
pingqiuandClaude Opus 5.5 ab747bfa47 change: cut over to the content-named store and delete the legacy store
The runtime stores each volume in one content-named layout on the filer:
immutable chunks, segments and roots are ordinary filer files, and one
HEAD entry per volume carries every conditional commit. A holder claims
HEAD under its granted epoch and claim id, cuts in its own session,
commits by HEAD generation and position, and is fenced when its identity
moves. Catalog, restore, snapshot, retention, cleaning, verify and volume
delete run through the layout kernel; the master mints the layout
identity, reads HEAD proofs and holds the delete reservation and lease
barrier. The legacy store, its intents and its compatibility paths are
removed; existing stores are recreated, not converted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:59:23 -08:00
Ping Qiu 47ea126e89 Merge pull request #608 from seaweedfs/r5/double-failover
test: a double failover of an RF3 sync-quorum volume reads back every acknowledged write
2026-11-25 12:08:55 -08:00
pingqiuandClaude Opus 5.5 314b79bff1 volume: a probe dispatch acts only for the peer it was admitted for
Priming and the adapter lookup were keyed by ReplicaID. A dispatch the loop
admitted for an old degraded peer, delayed while a lineage bump replaced the
peer under the same ReplicaID, then primed the new healthy peer's adapter,
whose probe raced the volume's live session again. The registry now keeps
the exact peer each adapter was added for; PrimePendingFor and
AdapterForPeer compare it under the registry lock, and a mismatch primes
nothing and sends no wire probe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 10:33:10 -08:00
pingqiuandClaude Opus 5.5 70ef278671 volume: the per-peer adapter never opens sessions on a healthy peer; degraded-peer re-probe on by default
With the degraded-peer probe loop on, the per-peer adapter registry primed
each new peer's engine at the add, and the engine's assignment probe and
fence ran on the replica with sessions of their own while the volume's
seed barrier and live ship owned it. The replica keeps the newest session,
so it refused the volume's own barrier as stale and the next write missed
quorum. The registry now records the identity at the add and primes the
adapter only on the probe loop's first dispatch for the peer, which comes
only once the peer is degraded (its live session failed and was
invalidated); that first dispatch is the adapter's own probe, not a second
one. With the race gone, --degraded-probe-interval defaults to 5s, so a
replica that fell out of the volume rejoins without an operator.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 10:33:10 -08:00
pingqiuandClaude Opus 5.5 0a069427a5 volume: a failed replica role call is retried until it succeeds
A replica whose floor could not be persisted (a full or read-only disk)
latched its role failure and stayed out of the volume until an operator
restarted it. The host now re-applies the current replica role with
backoff and clears the latch on success; a refusal that a retry cannot
change (ErrRoleRefused: the ingress is closed, or the volume refuses
replica peers) keeps its reason and is not retried.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 10:33:10 -08:00
pingqiuandClaude Opus 5.5 df88f674a7 test: a double failover of an RF3 sync-quorum volume reads back every acknowledged write
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 10:28:09 -08:00
pingqiuandClaude Opus 5.5 ccb0683605 blockvolume: the heal test's floor fault holds for root
A read-only durable root does not stop root from writing the floor record,
so the test skipped as root and a root-run gate could never pass it. The
fault now moves the root aside and puts a regular file at its path: a new
file under it fails with ENOTDIR for any user, while the files the replica
already holds open keep working. The rejoin removes the file and moves the
root back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 05:41:11 -08:00
pingqiuandClaude Opus 5.5 588ec6f413 blockvolume: the heal and the survivor's rejoin are separate tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 05:27:03 -08:00
pingqiuandClaude Opus 5.5 b34980ce4f blockvolume: real-process test of a failed fencing round and its heal
RF3 sync_quorum from a cluster spec: a survivor that cannot persist its
floor leaves the fencing round one short; the stopped primary is healed at
the next epoch once it answers, serves a new write, and reads back both.
The last step (the survivor rejoining after its disk recovers) is red:
a failed replica role call is not retried.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 05:25:17 -08:00
pingqiuandClaude Opus 5.5 cfa2891502 blockvolume: the replication ingress answers a fencing round
The host finds its fencer through the self fence, which in the binary is
the replication ingress; it had no FenceFloor/DurableFloor, so a replica
answered a fencing round without raising its floor and the master counted
no survivor. The ingress now forwards both to its listener.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 05:25:17 -08:00
pingqiuandClaude Opus 5.5 5fb4fccd85 authority, volume: the line carries its primary kind and evidence; the target checks its own store before it adopts
A line names how it made its primary the primary: BOOTSTRAP (the volume's
first primary), PROMOTION (with the gate's evidence: the target's durable
LSN and its epoch-table row there) or FORCED. The one mint refuses a
reassign without a kind, the kind and evidence are kept on the durable
authority record so a replayed line carries them, and AssignmentFact
carries them to the target.

The target adopts the primary role of a replicated volume only if its own
store still shows what was probed: a replay of an epoch it adopted needs a
valid epoch table; BOOTSTRAP needs no data; PROMOTION needs a valid table,
a durable end at or above the probed LSN and the probed row at that LSN
(a tail beyond it is its own log); FORCED adopts. A line without a kind to
a node holding data is refused, except a store from before the epoch
table replaying the line of its own durable floor (the upgrade). A
refusal latches the role admission failure (the slot becomes ineligible),
and the next round shows the store's real end and row. A single-replica
workspace move keeps its own start check.

Red: the promotion adoption trace (a store replaced between the line and
its adoption, an acknowledged block lost) fails on main and passes; one
row per guard of the adoption check; the mint refuses a kind-less reassign.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 03:23:18 -08:00
pingqiuandClaude Opus 5.5 26ffb11403 master, volume: the promotion probe round
When blockmaster decides a promotion it mints a fresh round id and sends a
ProbeRound to the node of each replica it asks, over that node's
authenticated round stream (SubscribeProbeRounds); each replica answers
from its store as it is now: durable end, the epoch-table row there,
whether the table is present and valid, and its role (AnswerProbe). Only
an answer with this round's id, from the node asked, for the replica
asked, counts; reports, old answers and answers from another node never
do. The round replaces the /status probe, which mutual TLS keeps on
loopback, and is installed at startup for every deployment (it was
launcher-only). Both methods are node-only.

Regenerated with the pinned protoc-gen-go v1.27.1 and protoc-gen-go-grpc
v1.3.0 (the gRPC file's header now names protoc v7.34.1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 02:42:31 -08:00
Ping Qiu b25202f264 Merge pull request #581 from seaweedfs/fix/promotion-g4-divergent-tail
replication: a survivor holding a divergent old-epoch tail after promotion is degraded and rebuilt
2026-11-25 01:20:23 -08:00
pingqiuandClaude Opus 5.5 a3008d9ff8 transport: a recovery lane start must state its from-LSN; live applies hold the epoch table's fence
A lane start without the LSN it starts after took the mark unconditionally;
it is now refused (nothing is released on this wire). A live entry passed
its note and could be held while a recovery took the mark and installed a
base, then land as a stray block under a table later made valid: live
applies now hold the apply fence shared and run only while the table is
valid, so a recovery's Invalidate drains them. Every lane start sender
states its from-LSN (EncodeRecoveryLaneStart).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 00:43:29 -08:00
pingqiuandClaude Opus 5.5 8813162775 transport: recovery applies are fenced against a change of the epoch table's owner; a catch-up over an invalid table needs a rebuild
An apply admitted under recovery A's mark could land after recovery B took
the mark and completed: its entry lay under B's valid table, labelled B's
epoch. Every recovery-data apply (both lanes, dual lane through the gate)
now runs under the table's apply fence, shared, and only while its token
owns the mark; Invalidate, CompleteRecovery and Replace take the fence
exclusive, so a change of owner waits for in-flight applies to settle and
the old owner's later applies are refused. A catch-up may complete only if
the table was valid when it took the mark (one persisted bit); after any
overlap only a rebuild makes it valid. A catch-up states the LSN it starts
after, and the replica takes the mark only if its durable end matches. A
live entry of a new epoch is accepted only at the store's next LSN.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 00:36:41 -08:00
pingqiuandClaude Opus 5.5 e82abea6b8 k8s: Kubernetes installs run blockmaster with mutual TLS; the plaintext off-host bind flag is refused
blockmaster refuses --insecure-external-bind (a non-loopback --listen needs
mutual TLS; the runtime HTTP listener stays on loopback), and
--launcher-master-tls-secret-prefix makes each generated volume mount its
server's node certificate Secret and dial with it. The chart, the launcher
renderer, the alpha/g15b/g15d manifests and gate scripts mount the Secrets
and pass the TLS flags; network.externalStatus and the frontend runtime
HTTP option fail the render. scripts/k8s-alpha-certs.sh issues development
certificates and the role file. The systemd startup gate runs its
off-loopback master with mutual TLS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 00:20:11 -08:00
pingqiuandClaude Opus 5.5 2e96506299 transport: the epoch table's invalid mark is owned by the newest recovery's random token
Two overlapping recoveries: A synced its data and paused, B started and
imported newer bytes (the table already invalid), then A's replace made the
table valid over B's data. Invalidate now draws a fresh random token,
persists it as the mark's owner and returns it; a later recovery takes the
mark over. A recovery completes only under its own token, checked and
written under one lock; any other completion is refused and not acked, and
a dead recovery's token is never presented again, so after a reload the
table stays invalid until a new recovery completes. Dual-lane sessions hold
the mark under a sentinel no completion presents. A promotion over an
invalid table clears the owner. The block design gains the epoch table's
state diagram.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 23:58:44 -08:00
pingqiuandClaude Opus 5.5 b59ae172a9 transport: a recovery makes the epoch table invalid before its first byte; only its final replace makes it valid
A catch-up or rebuild applies history whose epochs arrive only at its end.
If the data was synced and the replace then failed or the node stopped,
the old rows named the new data, and after a promotion an old survivor
with different entries at those LSNs reconciled as shared. The table is
now durably invalid from the recovery lane's start, a rebuild's first base
byte and every dual-lane session, until the final replace: invalid reads
as no table, which reconciles as diverged, and a live note is refused. A
promotion over an invalid table makes it exactly [(epoch, next LSN)].
A census classifies every peer-apply path as row first or invalid first;
the writer census honours build constraints and fails on any type-check
error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 23:14:25 -08:00
Ping Qiu b436a0c809 Merge pull request #577 from seaweedfs/fix/restarted-moved-source
fix: stop a restarted moved source with typed MOVED and exit 78
2026-11-24 22:40:23 -08:00
pingqiuandClaude Opus 5.5 61068fc9bf transport: the epoch table drops rows above the recovered next LSN at load, and keeps at most 512 rows
A primary that adopted an epoch over an unsynced tail, lost the tail in a
crash and adopted the epoch again kept the row's higher first LSN: its new
writes below it were attributed to the previous epoch, so an old primary's
unacknowledged tail in that range reconciled as shared. The ingress now
trims rows above the store's next LSN after recovery, and the next note
appends the row at its real first LSN. Every write keeps the newest 512
rows, so the record always fits the read bound; the rebuild-done list is
bounded the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:39:50 -08:00
pingqiuandClaude Opus 5.5 9a8f450c72 blockvolume: the primary's epoch row starts at the store's next LSN (no sync during role adoption)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:26:48 -08:00
pingqiuandClaude Opus 5.5 dc3d727c46 blockvolume: the primary's epoch row is noted after the fence drained inbound applies, before the role call returns
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:26:48 -08:00
pingqiuandClaude Opus 5.5 e628a42896 replication: the promotion seed reconciles a survivor by (last data epoch, end) against the primary's epoch table
The ingress owns the volume's epoch table: the listener notes shipped
entries, the primary's row (epoch, durable end + 1) is made durable before
a primary role is adopted, and the replication volume reads it at the seed
barrier. A survivor whose entries are not the primary's (an equal length at
another epoch, a tail above the frontier, data without a table) needs a
rebuild and is not counted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:26:48 -08:00
pingqiuandClaude Opus 5.5 028351bcdc volume: the per-peer engine gets this primary's frontier at the add as its start position
With the degraded-peer probe loop on, a peer the seed barrier degraded for a
divergent tail would otherwise be probed, classified caught up (R >= H) and
fenced back into healthy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:26:47 -08:00
pingqiuandClaude Opus 5.5 bd646b9985 test: the off-loopback flag cases use a documentation address
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 21:10:09 -08:00
pingqiuandClaude Opus 5.5 267ff9f821 test: the master TLS flag test uses server id node-b
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 21:09:31 -08:00
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
pingqiu bfeab6ca94 fix: terminate a restarted moved source with typed MOVED and exit 78 2026-11-24 19:35: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 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
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 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
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
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
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
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
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
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
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