Expand description
Cluster lifecycle state tracking for observability.
ClusterLifecycleTracker is the single source of truth for “what
phase is this node’s cluster init in right now”. It is owned by
the main binary, passed by reference into start_cluster and
friends, and read by:
- The
/cluster/statusHTTP endpoint. - The
nodedb_cluster_statePrometheus gauge. - systemd via
readiness::notify_statussosystemctl statussurfaces a live phase string during the seconds-to-minutes window when the cluster is still forming. - INFO-level structured logs — every transition calls
info!with the previous state, the new state, and the reason so a post- mortem on a flaky deploy can be done fromjournalctlalone.
Transitions are validated only in the loose sense that every
transition goes through a typed method on the tracker. There is no
strict state machine — a cluster can legitimately go
Joining{3} → Failed{"timeout"} → Joining{0} → Ready{3} if the
operator restarts with force_bootstrap, so we allow any → any.
Structs§
- Cluster
Lifecycle Tracker - Thread-safe container for the current
ClusterLifecycleState.
Enums§
- Cluster
Lifecycle State - Discrete phase of this node’s cluster init.