pub struct Rollouts<'a> {
pub(super) conn: &'a Mutex<Connection>,
}Fields§
§conn: &'a Mutex<Connection>Implementations§
Source§impl Rollouts<'_>
impl Rollouts<'_>
Sourcepub fn record_rollout_opened(
&self,
rollout_id: &str,
channel: &str,
target_ref: &str,
opened_at: DateTime<Utc>,
opened_event_log_seq: Option<i64>,
) -> Result<()>
pub fn record_rollout_opened( &self, rollout_id: &str, channel: &str, target_ref: &str, opened_at: DateTime<Utc>, opened_event_log_seq: Option<i64>, ) -> Result<()>
Pure-insert of a new Opening-state rollout row. Idempotent on
rollout_id PK (INSERT OR IGNORE) — no side effects on other
rows.
Supersession of prior in-flight rollouts on the same channel is
driven through the rollout reducer (Phase 10c): the applier
snapshots in-flight predecessors, calls this method, then routes
a RolloutEvent::SuccessorOpened per predecessor through
process_rollout_event. The reducer transitions each predecessor
from its current state to Superseded and emits a
RolloutEffect::RecordRolloutTransition that the applier writes
via record_rollout_transition. Closes the last RFC-0004 §3
“implicit side effect” anti-pattern in Phase 10.
Sourcepub fn record_rollout_transition(
&self,
rollout_id: &str,
to: RolloutState,
at: DateTime<Utc>,
event_log_seq: Option<i64>,
) -> Result<usize>
pub fn record_rollout_transition( &self, rollout_id: &str, to: RolloutState, at: DateTime<Utc>, event_log_seq: Option<i64>, ) -> Result<usize>
Record a state transition on an existing rollout row. Stamps the
state column, the appropriate timestamp side-effect
(terminal_at / superseded_at), and the
last_transition_event_log_seq FK.
Idempotent on (rollout_id, target_state): if the row is already
at to, the UPDATE no-ops via the WHERE state != ? guard.
Sourcepub fn set_current_wave(
&self,
rollout_id: &str,
wave: u32,
event_log_seq: Option<i64>,
) -> Result<usize>
pub fn set_current_wave( &self, rollout_id: &str, wave: u32, event_log_seq: Option<i64>, ) -> Result<usize>
Monotonic wave-index advance; WHERE current_wave < ?2 blocks
concurrent ticks from racing backwards. Stamps the
last_transition_event_log_seq FK alongside.
pub fn current_wave(&self, rollout_id: &str) -> Result<Option<u32>>
Sourcepub fn state(&self, rollout_id: &str) -> Result<Option<RolloutRow>>
pub fn state(&self, rollout_id: &str) -> Result<Option<RolloutRow>>
Full row projection, or None if the rollout is unknown. Callers
project state directly; the v0.1 is_superseded/is_terminal/
is_finished boolean derivations are gone (use state == RolloutState::X reads).
Sourcepub fn list_active(&self) -> Result<GateRollouts>
pub fn list_active(&self) -> Result<GateRollouts>
Gate-observed source. Filters Superseded and Pruned only —
terminal rollouts stay visible so channel-edges can detect
“predecessor converged”. UI consumers should use list_in_flight.
Sourcepub fn list_in_flight(&self) -> Result<UiRollouts>
pub fn list_in_flight(&self) -> Result<UiRollouts>
UI source. Filters Superseded, Pruned, AND Terminal
(operator’s “done” view).
fn list_filtered(&self, exclude_terminal: bool) -> Result<Vec<ActiveRollout>>
Sourcepub fn prune_finished_rollouts(
&self,
max_age_hours: i64,
) -> Result<(usize, usize)>
pub fn prune_finished_rollouts( &self, max_age_hours: i64, ) -> Result<(usize, usize)>
Prune finished (Superseded | Terminal | Failed | Reverted)
rollouts past max_age_hours AND their host_rollout_records
rows. Returns (host_rollout_records_pruned, rollouts_pruned).
Phase 10b: this physical-deletion pass becomes a
RetentionExpired event emission instead, transitioning the row
to Pruned (the row persists for audit; v0.3 retention-
compaction handles physical deletion per RFC-0008 §3 + §13).
For 10a we keep the physical prune so the existing operator
workflow stays unchanged while the rollout reducer is
unimplemented.