pub struct HostRolloutRecords<'a> {
pub(super) conn: &'a Mutex<Connection>,
}Fields§
§conn: &'a Mutex<Connection>Implementations§
Source§impl<'a> HostRolloutRecords<'a>
impl<'a> HostRolloutRecords<'a>
Sourcepub fn upsert(&self, state: &HostRolloutState) -> Result<()>
pub fn upsert(&self, state: &HostRolloutState) -> Result<()>
Upsert the full record for (rollout_id, hostname). Used by the
reducer applier after every successful step().
Sourcepub fn load(
&self,
rollout_id: &str,
hostname: &str,
) -> Result<Option<HostRolloutState>>
pub fn load( &self, rollout_id: &str, hostname: &str, ) -> Result<Option<HostRolloutState>>
Load the record for (rollout_id, hostname). Returns None when
the record doesn’t exist yet (first event for this pair).
Sourcepub fn all_for_rollout(&self, rollout_id: &str) -> Result<Vec<HostRolloutState>>
pub fn all_for_rollout(&self, rollout_id: &str) -> Result<Vec<HostRolloutState>>
All records for a given rollout. Used by the planner to derive
FleetState.host_states (RFC-0006 §4.1).
Sourcepub fn active_for_host(&self, hostname: &str) -> Result<Vec<HostRolloutState>>
pub fn active_for_host(&self, hostname: &str) -> Result<Vec<HostRolloutState>>
Non-terminal-non-reverted records for a hostname across all
rollouts. Used by the heartbeat handler to drive boot-recovery
synthesis (RFC-0005 §9.5): when the agent’s wire ack drops
(mid-rollout agent restart, post-rollback nixfleet-agent
SIGTERM, CP wipe), the next heartbeat carries current_closure
but no rollout_id — CP scans these records and matches:
- In-flight rollout (Pending/Activating/Deferred/Soaking)
with
target_closure == agent_current→ synthesiseRemoteActivationCompleted(the activation took, ack lost). - Failed rollout with
current_closure_at_dispatch == agent_current→ synthesiseRemoteRollbackComplete(the rollback took, ack lost).
Failed is included because the rollback-recovery synth runs
against records whose state-machine transition is still
pending CP-side. Reverted and Converged are excluded —
those are terminal-on-the-agent and need no recovery synth.