mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-05-29 21:20:21 +00:00
Make the first V2 core owner explicit in sw-block by freezing Phase 14 docs, mode/readiness/publication semantics, and bounded command emission rules. This turns accepted Phase 13 constraints into executable core behavior without overclaiming live runtime cutover. Made-with: Cursor
38 lines
1.6 KiB
Go
38 lines
1.6 KiB
Go
// Package replication implements V2 per-replica sender/session ownership.
|
|
//
|
|
// This is the real V2 engine core, promoted from the prototype at
|
|
// sw-block/prototype/enginev2/. It preserves all accepted invariants:
|
|
//
|
|
// - One stable Sender per replica, identified by ReplicaID
|
|
// - One active Session per replica per epoch
|
|
// - Session identity fencing: stale sessionID rejected at every execution API
|
|
// - Endpoint change invalidates active session
|
|
// - Epoch bump invalidates all stale-epoch sessions
|
|
// - Catch-up is bounded (frozen target, budget enforcement)
|
|
// - Rebuild is a separate, exclusive sender-owned execution path
|
|
// - Completion requires convergence (catch-up) or ReadyToComplete (rebuild)
|
|
//
|
|
// File layout:
|
|
//
|
|
// Slice 1 core (ownership/fencing):
|
|
//
|
|
// types.go — Endpoint, ReplicaState, SessionKind, SessionPhase
|
|
// sender.go — Sender: per-replica owner with execution APIs
|
|
// session.go — Session: recovery lifecycle with FSM phases
|
|
// registry.go — Registry: sender group with reconcile + assignment intent
|
|
//
|
|
// Phase 14 explicit core shell:
|
|
//
|
|
// state.go — VolumeState, readiness, boundary, normalized mode
|
|
// event.go — bounded event vocabulary
|
|
// command.go — side-effect-free command decisions
|
|
// projection.go — bounded outward publication projection
|
|
// engine.go — ApplyEvent() -> state update -> emit commands/projection
|
|
//
|
|
// Carried forward from prototype (accepted in Phase 4.5):
|
|
//
|
|
// budget.go — CatchUpBudget: bounded catch-up enforcement
|
|
// rebuild.go — RebuildState: rebuild execution FSM
|
|
// outcome.go — HandshakeResult, RecoveryOutcome classification
|
|
package replication
|