pub struct Response<A: Application> {
pub journal_persisted_wire_seq: Arc<AtomicU64>,
pub durability_mode: Arc<AtomicU8>,
pub replication_metrics: Option<Arc<ReplicationMetrics>>,
pub replica_active: Option<[Arc<AtomicBool>; 2]>,
pub heartbeat_interval: Option<Duration>,
pub busy_spin: bool,
pub utilization: Arc<StageUtilization>,
pub encoder: ResponseEncoderArc<A>,
}Expand description
Configuration and shared state for the response stage.
Fields§
§journal_persisted_wire_seq: Arc<AtomicU64>Highest wire seq durably persisted on the primary’s journal.
In the same sequence space as OutputSlot.wire_seq and the
replica metrics (metrics.in_memory_sequence /
metrics.acked_sequence), so the durability gate can compare
these values numerically and the comparison is meaningful
regardless of starting_sequence (fresh vs recovered primary).
Updated by the journal stage after every fsync batch via
set_last_seq_publisher.
durability_mode: Arc<AtomicU8>Operator-selected durability mode, published through a shared
[AtomicU8] so the admin DURABILITY command can swap it at
runtime without restarting the node. The response stage reads
this once per gate iteration with a relaxed load (cheaper than a
Mutex or refcounted Arc<Policy> snapshot) and rebuilds its
local Policy when the byte changes. See
crate::durability_policy::DurabilityMode::as_u8 for the
encoding.
replication_metrics: Option<Arc<ReplicationMetrics>>Per-slot replica cursors. None for standalone deployments
(no replication wiring) — the policy then evaluates against the
primary alone.
replica_active: Option<[Arc<AtomicBool>; 2]>Per-slot replica active flags. Only “true” slots are included in
the cursor view fed to Policy::evaluate, so disconnected slots
don’t pollute the view with stale zero cursors. When the
resulting view is too small to satisfy a clause, the policy
reports degraded and the gate stalls.
Mirrors replication_metrics — None in standalone.
heartbeat_interval: Option<Duration>§busy_spin: bool§utilization: Arc<StageUtilization>§encoder: ResponseEncoderArc<A>Wire encoder for application-shaped payloads. Constructed
once at boot (Arc::new(ExchangeResponseEncoder)) and shared
with the DPDK response stage.