mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-11 14:28:33 +01:00
Adds sw-block/ directory with:
- distsim: protocol correctness simulator (96 tests)
- cluster model with epoch fencing, barrier semantics, commit modes
- endpoint identity, control-plane flow, candidate eligibility
- timeout events, timer races, same-tick ordering
- session ownership tracking with ID-based stale fencing
- enginev2: standalone V2 sender/session implementation (63 tests)
- per-replica Sender with identity-preserving reconciliation
- RecoverySession with FSM phase transitions and session ID
- execution APIs: BeginConnect, RecordHandshake, BeginCatchUp,
RecordCatchUpProgress, CompleteSessionByID — all sender-authority-gated
- recovery outcome branching: zero-gap, catch-up, needs-rebuild
- assignment-intent orchestration with epoch fencing
- design docs: acceptance criteria, open questions, first-slice spec,
protocol development process
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3.9 KiB
3.9 KiB
Phase 01
Date: 2026-03-26
Status: completed
Purpose: drive V2 simulator development by closing the scenario backlog in sw-block/design/v2_scenarios.md
Goal
Make the V2 simulator cover the important protocol scenarios as explicitly as possible.
This phase is about:
- simulator fidelity
- scenario coverage
- invariant quality
This phase is not about:
- product integration
- SPDK
- raw allocator
- production transport
Source Of Truth
Design/source-of-truth:
sw-block/design/v2_scenarios.md
Prototype code:
sw-block/prototype/fsmv2/sw-block/prototype/volumefsm/sw-block/prototype/distsim/
Assigned Tasks For sw
P0
S19chain of custody across multiple promotions
- add fixed test(s)
- verify committed data from
A -> B -> C - update coverage matrix
S20live partition with competing writes
- add fixed test(s)
- stale side must not advance committed lineage
- update coverage matrix
P1
S5flapping replica stays recoverable
- repeated disconnect/reconnect
- no unnecessary rebuild while recovery remains possible
S6tail-chasing under load
- primary keeps writing while replica catches up
- explicit outcome:
- converge and promote
- or abort to rebuild
S18primary restart without failover
- same-lineage restart behavior
- no stale session assumptions
- stronger
S12
- more than one promotion candidate
- choose valid lineage, not merely highest apparent LSN
P2
- protocol-version comparison support
- model:
V1V1.5V2
- use the same scenario set to show:
- V1 breaks
- V1.5 improves but still strains
- V2 handles recovery more explicitly
- richer Smart WAL scenarios
- time-varying
ExtentReferencedavailability - recoverable then unrecoverable transitions
-
delayed/drop network scenarios beyond simple disconnect
-
multi-node reservation expiry / rebuild timeout cases
Invariants To Preserve
After every scenario or random run, preserve:
- committed data is durable per policy
- uncommitted data is not revived as committed
- stale epoch traffic does not mutate current lineage
- recovered/promoted node matches reference state at target
LSN - committed prefix remains contiguous
Required Updates Per Task
For each completed scenario:
- add or update test(s)
- update
sw-block/design/v2_scenarios.md- package
- test name
- status
- note any missing simulator capability
Current Progress
Already in place before this phase:
fsmv2local FSM prototypevolumefsmorchestrator prototypedistsimdistributed simulator- randomized
distsimruns - first event/interleaving simulator work in
distsim/simulator.go
Open focus:
S19covered indistsimS20partially covered indistsimS5partially covered indistsimS6partially covered indistsimS18partially covered indistsim- stronger
S12covered indistsim - protocol-version comparison design added in:
sw-block/design/protocol-version-simulation.md
- remaining focus is now P2 plus stronger versions of partial scenarios
Phase Status
P0
S19chain of custody across multiple promotions: doneS20live partition with competing writes: partial
P1
S5flapping replica stays recoverable: partialS6tail-chasing under load: partialS18primary restart without failover: partial- stronger
S12: done
P2
- active next step:
- protocol-version comparison support
- stronger versions of current partial scenarios
Exit Criteria
Phase 01 is done when:
S19andS20are coveredS5,S6,S18, and strongerS12are at least partially covered- coverage matrix in
v2_scenarios.mdis current - random simulation still passes after added scenarios
Completion Note
Phase 01 completed with:
S19covered- stronger
S12covered S20,S5,S6,S18strengthened but correctly left aspartial
Next execution phase:
sw-block/.private/phase/phase-02.md