Commit Graph
3422 Commits
Author SHA1 Message Date
pingqiuandClaude Opus 5.5 c7cff76f00 replication: the store learner runs on the peer's queue worker
The learning barrier used the peer's connection from its own goroutine,
outside the work queue that keeps one writer per connection, so on an
exposed volume it could overlap the first ship. It is now a queue job on
that worker; it is queued only when there is room (it never saturates the
queue, which would degrade the peer) and retried otherwise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 11:47:43 -08:00
pingqiuandClaude Opus 5.5 9bcb6c28cd replication: a failed store-learning barrier never degrades the peer
At bring-up the primary may install a peer whose replica does not listen
yet. The barrier that learns the replica's store then failed and degraded
the peer; nothing re-probes a degraded peer before a write, so its store
was never attested and a new volume never left creating. The store-learning
barrier now leaves the peer as it is on failure and retries in the
background (100 ms doubling to 2 s) until the store is learned or the peer
leaves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 11:43:24 -08:00
Ping Qiu 395a2b0953 Merge pull request #597 from seaweedfs/fix/failover-ship-order-main
volume, replication: a promoted replica moves its ship order to its store before it serves
2026-11-25 09:34:37 -08:00
pingqiuandClaude Opus 5.5 ab3023c655 volume: track the prepared ship order apart from the listener role
The move of the ship order to the store keyed on the listener role, which
a primary fence sets before the move runs. A refused move followed by a
replay of the same line skipped it, and so did a genuine primary after the
excluded-replica path had fenced the listener as primary only to close
ingress. The host now records 'ship order prepared' itself: cleared when
it takes a replica role, set only after a successful move.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 09:09:45 -08:00
pingqiuandClaude Opus 5.5 b06f3e4252 volume: the ship order is moved until a move succeeded (red)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 09:09:44 -08:00
Ping Qiu e3f0cbd08c Merge pull request #593 from seaweedfs/g2/attest-before-count
replication, master, volume: count a peer only with the master-recorded store
2026-11-25 09:03:03 -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
Ping Qiu a9f3ed741e Merge pull request #584 from seaweedfs/fix/promotion-g1-line-evidence
master, authority, volume: one promotion decider; the line carries its evidence and the target checks it
2026-11-25 08:09:23 -08:00
pingqiu 998a3744a9 Merge the base branch (fencing-round fixture on read evidence) 2026-11-25 07:38:56 -08:00
pingqiuandClaude Opus 5.5 0634cce906 volume: the replica-store wait applies only where stores are required
A host whose replication slot does not count peers by recorded store
counts no peer ack, so the creation wait does not close its frontend.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 07:38:21 -08:00
pingqiuandClaude Opus 5.5 58b3c02386 replication: learn new peers' stores outside the volume lock; convergence test
The frontier-0 store barriers run in parallel after UpdateReplicaSet
releases v.mu. A replica refused for an unrecorded store stays Healthy with
its learned store, so the next attestation records it with no operator.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:53:38 -08:00
pingqiuandClaude Opus 5.5 be0ecab7e6 nvmerdma: the test's fencing round answers on read evidence
The test's gate fake fenced its survivors without saying their evidence
was read, so since a fenced answer counts only on a read, valid table, it
had no survivor and the failover it asserts never came.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:52:49 -08:00
pingqiuandClaude Opus 5.5 a7bbbe5428 replication: test the ship order after replicated entries
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:51:32 -08:00
pingqiuandClaude Opus 5.5 aa074bc05f volume, replication: a node taking the primary role moves its ship order to its store
A replica applies entries through replication, so its store's next LSN
moves while the write observer's ship cursor stays where the observer was
installed. Promoted, its first local write waited in the LSN resequencer
for an entry that never comes as a local write, and every write after a
failover failed at its deadline. On a transition into the primary role
(listener fenced as primary, frontend not serving yet) the host moves the
ship cursor to the store's next LSN.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:51:32 -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 5d315bcf5d replication: tests for the write-ACK count of an unacknowledged store
An unacknowledged replica's ack does not complete a sync_quorum flush
(it does once its store is acknowledged). The first-heartbeat window's
defect is pinned by a skipped red test: a fresh primary with healthy
replicas must fail no flush before its first acknowledged heartbeat.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:18:03 -08:00
pingqiuandClaude Opus 5.5 91fce5380c replication, volume: a peer counts toward write ACKs only with a master-acked store
Where the primary attests its write-ACK stores (every heartbeat of a
volume host), a Healthy peer counts toward write ACKs only once the
master has acknowledged the attestation naming its current store. A peer
rebuilt onto a new store still answers barriers (that is how its store
is learned) but does not count until that store is acked, so it can
never be the only holder of an acknowledged write that a promotion
cannot verify. The host passes an acknowledged attestation to the
replication volume after each successful heartbeat.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:13:24 -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 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 1a4eaea461 test: the fencing round's replica half under crash, interrupt and the real path
transport: the persist interrupted at each step (write, rename, dirsync)
makes no promise and a restart loads the old floor or the fence epoch,
never anything else; a drain timeout makes no promise; concurrent rounds
never lower the floor.
volume, on a real listener and floor record: after the answer at e+1 the
old primary's ships at e and below are refused, also after a restart, and
the line re-issued at e+1 is admitted; a superseded round answers its
higher floor and lowers nothing; a crash before the persist answers
nothing and binds no restart; a crash after the persist binds the restart
and the re-asked round answers at the same floor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 05:30:19 -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 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 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 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
Ping Qiu f35678dece Merge pull request #586 from seaweedfs/ci/spec-trace-scenarios-are-tests-main
ci: spec trace counts runner scenarios as tests
2026-11-25 04:24:57 -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 8740a96113 ci: spec trace counts runner scenarios as tests
A scenario under testops/scenarios/*.yaml is a test definition, so a PR that
changes only scenarios (and tests) passes as kind TEST. Production Go next to
a scenario still fails TEST, as do a script beside the scenarios and a yaml
outside testops/scenarios.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 04:13:18 -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 1f881aa28d transport: a fencing round never fences the volume's primary
A listener in the primary role refuses FenceFloor (ErrFencePrimary),
checked under the lock that raises the floor, and keeps its floor at the
epoch it serves; the caller sends no answer.

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 f9ce00ce6b transport, volume: a fencing round's answer is the replica's durable promise
On a probe round with a fence epoch naming its store, the replica raises
its epoch floor in memory (new frames below it are refused at once),
waits for every mutation admitted before to finish, persists the floor,
and only then reads its evidence and answers with the durable floor. A
failed fence is not answered; a round naming another store raises
nothing; a plain round reports the floor. The floor never goes down, and
the line re-issued to the same primary at the fenced epoch is admitted
as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 03:55:21 -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 e636957f4d rpc: the fencing round's fields (fence epoch, expected store, answered floor)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 03:47:38 -08:00
pingqiuandClaude Opus 5.5 86feb6d834 volume: a promotion replay on a trimmed epoch table is held by its store and end
A table trimmed at its row cap may no longer reach the probed LSN, so a
replay has no row to compare. It then rests on the store id and the
durable end; a first promotion still needs the row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 03:38: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 a0129f0397 volume: a replayed promotion line is checked against its evidence
A line at an epoch the store already holds rows at was adopted as a
replay before any check, so a same-epoch promotion naming another store,
no store, or an end this store does not hold was admitted. A promotion
now runs its checks on every delivery; a genuine replay still matches,
since the row noted at the new epoch starts past the probed LSN.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 03:34:31 -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
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