Commit Graph
245 Commits
Author SHA1 Message Date
pingqiuandClaude Opus 5.5 17004151bf fix(master): a fenced failover's fence is pending from the attempt; the unsupported gate heals it
The operator's fencing round may fence survivors above the line whatever
it decides, and an allowed decision may still fail to publish: the fence
is now pending from the attempt until a line reaches its epoch. The
unsupported gate continues the line's own primary at e+1 on a pending
fence before any candidate check, as the supported gate does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:28:56 -08:00
pingqiuandClaude Opus 5.5 7903ffaeb1 test(master): a fenced failover's recovery: unpublished allowed round, unsupported-path heal (red)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:28:26 -08:00
pingqiuandClaude Opus 5.5 4555092854 fix(master): fence only the failover of an unreachable primary; test the race with the promotion loop
A reachable RF3 sync_quorum primary's move is a planned move again and
stays refused for want of a seal; only the operator's failover of an
unreachable primary is decided on the fencing round. Adds the test where
the operator's failover and the master's promotion loop decide the same
volume at once: both fence at the same next epoch, one line is published.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:22:09 -08:00
pingqiuandClaude Opus 5.5 43ccf9456e fix(master): manual failover of an unreachable primary runs the fencing round at every replica count
An operator failover whose primary has no fresh, reachable heartbeat (a
lost host) is no planned move from a live primary: it is now decided on
the fencing round for RF2 as for RF3 (one path, basis Fenced). A failover
from a reachable RF2 primary stays planned; best_effort stays refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:12:18 -08:00
pingqiuandClaude Opus 5.5 6db8fbd8cf test(master): RF2 manual failover of an unreachable primary decides on the fencing round (red)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:12:07 -08:00
pingqiuandClaude Opus 5.5 8058cad9e5 fix(master): RF3 sync_quorum manual failover runs the fencing round
A planned move of an RF3 sync_quorum volume needs a seal (its target is
not in every acknowledgement set), so the operator's failover was refused
and a volume whose primary host is lost could not be moved at all. The
fencing round is that seal: the failover now fences every other replica at
the line's next epoch and publishes only on the round's decision (enough
fenced survivors; the target holds the highest fenced end and is ready),
with basis Fenced. A refused round leaves the fence pending so a returning
primary is continued at e+1. RF2 and sync_all stay planned moves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:05:26 -08:00
pingqiuandClaude Opus 5.5 9fccb40247 test(master): RF3 sync_quorum manual failover decides on the fencing round (red)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:04:18 -08:00
Ping Qiu 2759b5658a Merge pull request #611 from seaweedfs/fix/creating-primary-not-replaced
master: a primary in the creation wait is not replaced for answering not ready
2026-11-25 16:43:19 -08:00
Ping Qiu 6ed99b411b Merge pull request #574 from seaweedfs/cutover/b
change: cut over to the content-named store and delete the legacy store
2026-11-25 15:47:31 -08:00
Ping Qiu 2bd2afae54 Merge pull request #614 from seaweedfs/fix/stream-resend-no-info-var
master: the assignment stream keeps no local copy of the assignment
2026-11-25 15:07:57 -08:00
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
pingqiuandClaude Opus 5.5 71682c1e03 master: a primary in the creation wait is not replaced for answering not ready
A new volume's primary hides its frontend until the master has recorded
every replica's store, so it answers the promotion probe "not
primary-ready" by design. Past its boot grace, the promotion gate took
that for a failed primary and fenced it, reassigning the volume. While the
master still awaits the volume's stores (read before the probe), and only
while the primary's own fresh slot is acceptable, the not-ready answer is
judged as the wait; an unreachable, ineligible or withdrawn primary is
still replaced. Fixtures that fail over an established volume now attest
its stores.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:56:17 -08:00
pingqiuandClaude Opus 5.5 24a4330384 master: check the newer round is open after the late delivery is refused
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:29:06 -08:00
pingqiuandClaude Opus 5.5 dcbcb0c7b0 master: the late-answer test proves a newer round is open at the delivery
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:25:16 -08:00
pingqiuandClaude Opus 5.5 44bdfa6ca7 master: test that an old probe round's late answer is refused by a new round
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:21:45 -08:00
pingqiuandClaude Opus 5.5 0c6b3ff608 master: the assignment stream keeps no local copy of the assignment
The re-send on a store record change held the last line in a local
adapter.AssignmentInfo variable, which the non-forgeability guard refuses
(only the publisher mints one). The stream now keeps a closure that
rebuilds the fact from the line it received.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:14:06 -08:00
pingqiuandClaude Opus 5.5 cd4aaafdad master: the creation wait follows the volume's current replicas
An initial replica replaced during the wait (a new replica id) is no
longer waited for: the count is over the current replica slots, and the
wait is cleared for good the first time every current replica has a
recorded store, so a later replacement never closes the volume again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 08:26:09 -08:00
pingqiuandClaude Opus 5.5 5bf6e17ab1 replication, master, volume: count a peer only with the master-recorded store
A peer counts toward write ACKs only while its barrier store equals the
store the master recorded for it from a primary's attestation, carried in
the replica descriptor; empty never matches, and the peer's own word never
changes it. A record change re-sends the assignment at the same
generation and the primary updates expected stores in place.

A volume's first bind records its initial replicas: until each has an
attested store the fact carries the awaited count, the primary serves no
frontend I/O and reports "creating: waiting for replica attestations
(n of N)"; the primary learns new peers' stores with a barrier at LSN 0.
Replica rows show store_attested/store_id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:43:45 -08:00
pingqiuandClaude Opus 5.5 fdf0ad08c2 master: an empty fenced answer counts only on a read, valid table
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:10:51 -08:00
pingqiuandClaude Opus 5.5 a034d3f7a3 master: a fenced answer counts only on evidence that was read
An answer whose epoch table is absent, or whose evidence could not be
read, reported no table and so was never marked invalid: it counted
toward N-K+1 with end 0 and could let a lower end become the target.
A fenced answer (and the heal's own answer) now counts only when its
evidence was read on a present, valid table, from the attested store.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:10:20 -08:00
pingqiuandClaude Opus 5.5 e79996437f wip: P2 primary fence below the floor refused; P3 test; basis census; test stand-ins state a basis
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 05:54:29 -08:00
pingqiuandClaude Opus 5.5 b2cb5d4879 wip: one decision function on every failover path; a promotion states its basis; no fence in boot grace
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 05:44:23 -08:00
pingqiuandClaude Opus 5.5 520fd27de0 wip red: an unfenced promotion and the unsupported path's failover
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 05:43:01 -08:00
pingqiuandClaude Opus 5.5 3d0ca51699 master: a fenced reassign is never skipped as already current
The heal of a failed fencing round reassigns the current replica at its
own endpoints, which the product tick and the publication admission both
dropped as already current. A reassign with a fenced epoch skips that
check: the mint takes it only at that epoch, so it cannot advance twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 05:25:17 -08:00
pingqiuandClaude Opus 5.5 2bfc86687d wip: the heal outlives the tick of a failed fencing round
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 04:27:59 -08:00
pingqiuandClaude Opus 5.5 765235ba1d wip: an empty volume whose primary was lost fails over on a fenced round; a fenced replica still answers ready
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 04:21:33 -08:00
pingqiuandClaude Opus 5.5 994e801dff wip: the stale-heartbeat failover test sees the lagging replica; a wait row for a higher lagging end
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 04:17:21 -08:00
pingqiuandClaude Opus 5.5 8f6b79a022 wip: failover tests see the lagging replica; it holding the highest end makes the volume wait
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 04:08:11 -08:00
pingqiuandClaude Opus 5.5 c39a9213ac master: a replica dropped from the ack set keeps its attested store
An attestation is merged into the volume's record: each replica it names
gets that store as its reference, and a replica it does not name keeps
its last one, since it may be the only holder of an acknowledged write.
A new attestation after a rebuild replaces it; a wiped store has another
id and is still not a survivor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 04:04:06 -08:00
pingqiuandClaude Opus 5.5 726ec9dc0a wip: a lagging replica is fenced and counted; the target holds the highest fenced end
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 04:03:08 -08:00
pingqiuandClaude Opus 5.5 fdee737e2f wip: fencing round tests (gate, heal, round ask, mint)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 04:00:09 -08:00
pingqiuandClaude Opus 5.5 939fe74a8b wip: master side of the fencing round, and the heal after a failed one
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 03:51:58 -08:00
pingqiuandClaude Opus 5.5 d92cfe3748 authority, master: a rebalance passes the planned-move guard
A rebalance moves the primary while it is alive, so it is a planned move,
yet it needed only the gate's promotion evidence. Under RF3 sync_quorum
the old primary can be acknowledged by the other replica alone while the
target adopts. The gate now marks a slot PlannedMoveAllowed from the same
plannedMoveAllowed(profile, replicas) a failback uses, and the controller
publishes a rebalance only to such a slot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 03:37:48 -08:00
pingqiuandClaude Opus 5.5 85171f71fa replication, master: read the epoch row after the sync; the HTTP evidence provider is test-only
LocalPrimaryEvidence synced after reading the table, so a row appended in
between was paired with a newer end. Sync first, then read the table.

The workload-plan HTTP provider has no production caller since the probe
round; it moves to a test file so the round is the one way to evidence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 03:26:59 -08:00
pingqiuandClaude Opus 5.5 121a4ec5ed master, volume, replication: a promotion survivor is the store its primary attested
The primary attests, in its heartbeat, the store id (superblock UUID) of
each replica counted toward its write ACKs. A probe round answer carries
the replica's store id; a candidate is ready only when that id is the one
its primary attested (a replaced or never-attested store is not a
survivor). The promotion line carries the probed store id, and the target
refuses a promotion whose store id is missing or is not its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 03:23:18 -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 c9fe8a7123 authority, master: one decider: a primary change is published only through the promotion gate
The promotion gate (one function: the probe round's answers -> the allowed
replica and its evidence) now covers every replicated volume, RF2
included: on main RF2 and every observation-fed failover promoted on
heartbeat readiness with no evidence of the candidate's data. The gate
puts its evidence on the slot it allows; the controller's failover and
rebalance carry it and publish nothing without it. The legacy PolicyOwner
(no production caller) is deleted. Failback is the operator's planned move
through the gate: the target is probed by the round, and the move is
allowed only when the target is in every acknowledgement set (sync_all at
any replica count, sync_quorum with RF2); RF3 sync_quorum (needs a seal)
and best_effort (forced only) are refused with typed errors.

About forty tests encoded the evidence-free decision. Their subjects are
unchanged; each now gets the candidate's evidence the way the gate gives
it (the controller's candidate helper, the convergence snapshots, a
stand-in gate sink for the observation-fed routes, a static round answer
for the RF2 and failback tests). None is skipped or loosened. New: ready
replicas without the gate's evidence promote nothing; RF2 promotes on a
ready answer and not without one; the planned-move guard, one row per ack
profile and replica count.

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
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
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
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 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 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 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 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
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
pingqiu 8aaf3e4c7d Merge remote-tracking branch 'origin/main' into fix/no-reassign-on-unknown-primary
# Conflicts:
#	docs/design/invariants.md
2026-11-24 12:29:42 -08:00
pingqiu 0aa6dcd24e Merge remote-tracking branch 'origin/main' into fix/1.0.1-live-holder
# Conflicts:
#	docs/design/invariants.md
2026-11-24 12:02:48 -08:00
pingqiuandClaude Opus 5.5 3bb1cfb1e9 test, docs: a missing primary pod is unknown: no automatic reassign; Kubernetes alpha failover is manual
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 10:37:36 -08:00
pingqiuandClaude Opus 5.5 3aafd4e1f1 fix(master): never reassign on a primary that did not answer its status probe
An unknown fact is not a failed one: the unsupported promotion path now
moves the line only on the current primary's own not-ready report, like
the supported path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 10:28:49 -08:00