Commit Graph
3441 Commits
Author SHA1 Message Date
pingqiuandClaude Opus 5.5 a135bef99c docs: INV-PROMOTE-FRONTIER-001 cites where SyncAckKnown is set now
85171f71 removed core/host/master/promotion_probe.go; the probe round
(core/host/master/probe_round.go) sets SyncAckKnown since. The row's
"Enforced in" cell still named the removed file, so
TestActiveInvariantRowsCiteExistingPaths failed (the -short CI run skips
internal/invcheck).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:36:45 -08:00
Ping Qiu f24312e39f Merge pull request #609 from seaweedfs/fix/store-learn-bringup
replication: a failed store-learning barrier never degrades the peer
2026-11-25 12:44:03 -08:00
pingqiuandClaude Opus 5.5 6354c7087d replication: the store-learning controls fail, never skip, when the replica cannot re-bind
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 12:36:40 -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
Ping Qiu 3c4bf79d3b Merge pull request #596 from seaweedfs/fix/fence-rejoin
volume, replication: a fallen-out replica rejoins without an operator (role-call retry; degraded re-probe on by default without racing the live session)
2026-11-25 12:08:20 -08:00
pingqiuandClaude Opus 5.5 cd0d17bcd8 replication: the redial control waits for the dropped connection
The control slept a fixed time and could pass with no connection accepted
and dropped. It now waits for the listener's accept-then-drop and fails if
none happened; without the transport fix it fails at the store assertion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 12:04:48 -08:00
pingqiuandClaude Opus 5.5 353df5993e transport: a barrier that fails on its connection drops it
A send or receive failure left session.conn in place, so a caller that
does not invalidate the session (the store learner) reused the dead
socket on every retry and never learned a restarted replica's store. The
barrier now detaches and closes the connection, as the catch-up and
rebuild senders do; the next barrier re-dials.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 11:55:27 -08:00
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
pingqiuandClaude Opus 5.5 5a6048a218 volume: a late older fact never clears a newer pending supporting assignment
A supporting fact cleared pendingSupport unconditionally, so a late replay
of an older line (its role call refused as stale) wiped the assignment a
newer fact left pending; the retry then admitted the newer listener but
never completed its assignment. A fact now clears or replaces the pending
assignment only when its epoch is the same or newer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 11:24:46 -08:00
pingqiuandClaude Opus 5.5 5244dc3663 volume: both supporting completions run through one guarded function
The fact's own successful role call released selfFenceMu before it
completed the supporting assignment, and facts run concurrently by design,
so a newer self-primary or excluding fact could cross: the old admission
then cleared that fact's primary watchdog or emitted an old marker. The
direct path and the retry now both complete through
completeSupportingIfCurrentLocked, which checks and completes without
releasing selfFenceMu: only while the desired role is still replica at that
epoch and no newer fact was seen. A newer fact records its epoch under the
lock before it acts, so it waits for the completion or supersedes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 11:07:22 -08:00
pingqiuandClaude Opus 5.5 a292f142cc volume: an old supporting completion never lands after a newer transition
The retry released selfFenceMu before completing a skipped supporting
assignment, and only supporting completions took the lock that ordered it,
so a newer self-primary or excluding fact could act in between; the retry
then ran supportingAdmitted for the old epoch (clearing the primary
watchdog) and emitted an old ready marker. The retry now completes under
selfFenceMu, and every fact records its epoch under that lock at the very
start of applyFact, before it acts at all (the watchdog runs before the
role call); the retry completes only while no newer epoch was seen. A newer
fact waits at that record until the completion is done. Only the record is
under the lock, so facts applied concurrently by design do not nest it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 10:51:04 -08:00
pingqiuandClaude Opus 5.5 49dcf2d22e volume: note why the role-call retry does not touch shipPrepared
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 10:33:33 -08:00
pingqiuandClaude Opus 5.5 a0b6a5da17 volume: order the supporting completion with a narrow lock, not around applyFact
A mutex around all of applyFact deadlocked facts applied concurrently by
design (a replay worker beside the stream, a fact applied from inside
another's hook). supportMu now spans only the completion of a supporting
assignment, in the fact path after its role call released selfFenceMu and
in the retry (supportMu, then selfFenceMu), so an older epoch's completion
never lands after a newer one's. The retry completes the pending
assignment only while the host still wants the replica role at its epoch;
a newer fact moves that epoch or replaces the pending entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 10:33:11 -08:00
pingqiuandClaude Opus 5.5 e69c2af879 volume: a role-call retry completes the supporting assignment the failure skipped
When a supporting fact's replica role call failed, the fact returned before
the adapter took the line's identity and before the supporting admission
was recorded. The retry cleared the latch but never applied those, so with
no new fact the engine stayed at the old line. The skipped assignment is
now kept (pendingSupport) and the retry completes it once its role call
succeeds at that epoch, with the same steps as the assignment path. A new
mutex serialises applyFact with that completion (order: it, then
selfFenceMu), and every applied fact supersedes a pending one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 10:33:11 -08:00
pingqiuandClaude Opus 5.5 663c745d89 volume: pin the window between the prime check and the adapter's first command
After PrimePendingFor's identity check the registry lock is released
before OnAssignment, so the peer can be replaced in between. That window
is closed by the executor: every command the adapter issues runs through
the old peer's BlockExecutor and enters through beginAsyncOperation, and
UpdateReplicaSet stops a replaced peer's executor (stopped under its lock,
then in-flight work drained) before it installs the replacement and seeds
it. The lock graph on PrimePending now says so, and a test holds the
dispatch in that window (a package-private hook), replaces the peer at the
same lineage on another address of the same replica, and checks that no
late connection reaches the replica and the replacement keeps its session.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 10:33:10 -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 88a03a40bb component: the apply-failure recovery test follows deferred priming
The test waited for its registry adapter to probe the new peer right after
the add, which is the adapter acting on a healthy peer the volume's live
session owns. It now checks the adapter has issued nothing at the add and
wires the probe loop as the binary does (priming on the first dispatch for
a degraded peer); its degrade, recover and replay assertions are unchanged.

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
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