pub struct ReplicaControlPlane {
pub promote: PromotionRequest,
pub tip_ready: Arc<AtomicBool>,
pub journal_tip: AdvertisedJournalTip,
pub primary_link_up: Arc<AtomicBool>,
pub pipeline_healthy: Arc<AtomicBool>,
/* private fields */
}Expand description
The handles a replica’s receive loop shares with the rest of the node — the admin endpoint and the control-plane raft driver. Bundled (rather than five positional parameters) because they always travel together through the kernel-TCP and DPDK receiver signatures, and a transposition between same-typed flags is exactly the bug a bundle prevents.
Fields§
§promote: PromotionRequestPromotion request: polled by the receive loop; filed by the
admin PROMOTE command or the raft driver (auto-promotion).
tip_ready: Arc<AtomicBool>Flipped true once journal recovery has seeded the fence epoch,
so the raft driver can trust this node’s advertised tip — see
melin_raft::recency::TipSource.
journal_tip: AdvertisedJournalTipSequence half of the advertised journal tip — see
melin_transport_core::AdvertisedJournalTip.
primary_link_up: Arc<AtomicBool>true while this replica holds an authenticated replication
connection to its primary. The raft driver refuses to
auto-promote while set: a live link means the primary is
demonstrably alive, and winning a control-plane election (e.g.
because a different node’s raft died) must not depose a
healthy primary.
pipeline_healthy: Arc<AtomicBool>Whether the replica’s pipeline is healthy — fed to the replica’s
minimal health endpoint (/health OK/ERR and the
melin_pipeline_healthy gauge). Process-lifetime (the per-session
pipeline is torn down and rebuilt across resyncs, so its own
journal_failed latch cannot be handed to the endpoint):
true from boot, latched false by the journal stage’s failure
wrapper, reset true when a fresh pipeline is built.