pub trait RollbackTransport {
// Required methods
fn read_divergent_tail(
&mut self,
from_exclusive: u64,
to_inclusive: u64,
) -> Vec<TailRecord>;
fn persist_rollback_file(
&mut self,
tail: &DivergentTail,
) -> Result<String, String>;
fn recover_to_lsn(&mut self, target_lsn: u64) -> Result<(), String>;
fn emit_rollback_event(&mut self, event: RollbackEvent);
fn rejoin_as_replica(&mut self, primary_addr: &str, term: u64);
}Expand description
Side effects the rollback coordinator drives, injected so the state machine stays pure and deterministically testable.
Production implementors back these onto the MVCC history store
(ADR 0014) for the recover-to-LSN, the rollback-file writer, the
crate::telemetry::operator_event::OperatorEvent bus, and the gRPC
role-swap. Tests back them onto a scripted fake.
Required Methods§
Sourcefn read_divergent_tail(
&mut self,
from_exclusive: u64,
to_inclusive: u64,
) -> Vec<TailRecord>
fn read_divergent_tail( &mut self, from_exclusive: u64, to_inclusive: u64, ) -> Vec<TailRecord>
Read the divergent tail records in (from_exclusive, to_inclusive]
from the local timeline / MVCC history store, in LSN order.
Sourcefn persist_rollback_file(
&mut self,
tail: &DivergentTail,
) -> Result<String, String>
fn persist_rollback_file( &mut self, tail: &DivergentTail, ) -> Result<String, String>
Persist the divergent tail to a durable rollback file and return a
path/handle that identifies it. Returning Err aborts the
rollback before any data is removed — rollback is never silent.
Sourcefn recover_to_lsn(&mut self, target_lsn: u64) -> Result<(), String>
fn recover_to_lsn(&mut self, target_lsn: u64) -> Result<(), String>
Recover the live timeline to target_lsn over the MVCC history
store, discarding every version above it and restoring the
pre-images visible at target_lsn.
Sourcefn emit_rollback_event(&mut self, event: RollbackEvent)
fn emit_rollback_event(&mut self, event: RollbackEvent)
Emit the loud, auditable operator event for the completed rollback.
Sourcefn rejoin_as_replica(&mut self, primary_addr: &str, term: u64)
fn rejoin_as_replica(&mut self, primary_addr: &str, term: u64)
Reconfigure the node to stream as a replica of primary_addr under
term.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".