pub struct Follower { /* private fields */ }Expand description
The twin’s loop over one source into one set of stores.
Implementations§
Source§impl Follower
impl Follower
Sourcepub fn new(stores: Arc<ServerStores>, source: Box<dyn LogSource>) -> Self
pub fn new(stores: Arc<ServerStores>, source: Box<dyn LogSource>) -> Self
A follower of source into stores.
Sourcepub fn with_volume(self, volume: Arc<dyn Volume>) -> Self
pub fn with_volume(self, volume: Arc<dyn Volume>) -> Self
Stage snapshots on volume instead of the box’s own filesystem (the tests’ capped
volume, twin-resync-space 2026-10-06).
Sourcepub fn sharing_failures(self, failures: Arc<Mutex<Option<Failing>>>) -> Self
pub fn sharing_failures(self, failures: Arc<Mutex<Option<Failing>>>) -> Self
Share the run of failures with the follower before this one (the supervisor’s re-dial starts a new follower on the same primary: the run goes on).
Sourcepub fn with_fetch_bytes(self, bytes: u64) -> Self
pub fn with_fetch_bytes(self, bytes: u64) -> Self
How many blob bytes one fetch asks for (tests ask for tiny fetches to exercise the restart-mid-range path).
Sourcepub fn applied_seq(&self) -> u64
pub fn applied_seq(&self) -> u64
The twin’s own head.
Sourcepub fn step(&self) -> Result<Progress>
pub fn step(&self) -> Result<Progress>
One poll: head, the gap rule, fetch-append-apply until level.
A poll that reached the primary and then failed says so in the status
(2026-09-21, lane T4). Only the head() call used to set a status on
failure. Everything after it — append_at on a full volume, an apply
that will not go in, a fetch that dies mid-range — propagated with ?,
and the STATUS WAS LEFT EXACTLY AS THE LAST GOOD POLL SET IT: following,
often caught_up, with an empty why. run logged one warn and
polled again. So the shape a twin’s life actually ends in — its data
volume filling — read as a healthy, current copy on both twin status
and the primary’s heartbeat, for as long as the box stayed up. A twin’s
whole job is to be trustworthy at the moment nobody has time to check.
Sourcepub fn run(&self, poll: Duration, stop: &AtomicBool) -> Ended
pub fn run(&self, poll: Duration, stop: &AtomicBool) -> Ended
Poll until stop; an unreachable primary is retried every poll, a
snapshot-needed stops the loop and leaves the status saying so. What it
returns says why it returned (Ended).
Sourcepub fn maintenance_beat(&self)
pub fn maintenance_beat(&self)
One poll while this twin grows its own set: the status says
maintenance FIRST (so the report on this very poll carries the word), then
the primary is asked for its head only — nothing is fetched, appended or
applied, so nothing touches the unmounted set.
Auto Trait Implementations§
impl !Freeze for Follower
impl !RefUnwindSafe for Follower
impl !UnwindSafe for Follower
impl Send for Follower
impl Sync for Follower
impl Unpin for Follower
impl UnsafeUnpin for Follower
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request