Skip to main content

Module boot_fsm

Module boot_fsm 

Source
Expand description

§Deterministic Boot Finite State Machine

Implements a production-grade boot sequence with:

  • Well-defined states: Init → Migrate → Recover → Warmup → Ready
  • Time budgets for each phase (for Kubernetes probe alignment)
  • Progress reporting for external observability
  • Recovery modes: Normal, ReadOnlyRecovery, ForceRecovery

§Kubernetes Integration

The FSM exports progress metrics that align with K8s probe semantics:

  • startupProbe: tolerates long recovery (uses recovery budget)
  • readinessProbe: true only when FSM is in Ready
  • livenessProbe: heartbeat-based (separate from FSM)

§Safety Property

Ready ⇒ (recovery_complete ∧ invariants_checked ∧ services_registered)

§Complexity Bounds

Recovery is O(|WAL| + |checkpoint|). The FSM tracks and exposes this to allow operators to configure appropriate probe timeouts.

Structs§

BootBudgets
Time budget configuration for each boot phase
BootError
Error during boot
BootMetrics
Boot metrics for observability
BootOrchestrator
Boot orchestrator that coordinates the full boot sequence
BootStateMachine
Boot state machine with thread-safe state transitions
HealthStatus
Health status for probes and observability
PhaseProgress
Progress information for a boot phase
PreloadHints
Preload hints for deterministic warmup

Enums§

BootPhase
Boot phase states (DFA transitions)
RecoveryMode
Recovery mode configuration