pub struct ReplicationConfig {
pub role: ReplicationRole,
pub term: u64,
pub poll_interval_ms: u64,
pub max_batch_size: usize,
pub region: String,
pub quorum: QuorumConfig,
pub slot_retention_max_lag_lsn: u64,
pub slot_idle_timeout_ms: u64,
}Expand description
Configuration for replication.
Fields§
§role: ReplicationRole§term: u64Current replication term/epoch stamped into WAL-derived records.
poll_interval_ms: u64How often replica polls for new WAL records (milliseconds).
max_batch_size: usizeMaximum batch size for WAL record transfer.
region: StringRegion identifier for this instance (Phase 2.6 multi-region).
Used by the quorum coordinator to spread write acks across
fault domains: QuorumConfig::required_regions forces a commit
to wait until at least one replica in each listed region has
acked. Defaults to "local" for single-region deployments.
quorum: QuorumConfigQuorum configuration (Phase 2.6 multi-region).
slot_retention_max_lag_lsn: u64Maximum LSN lag a replication slot may pin before the primary invalidates it and allows WAL pruning to continue.
slot_idle_timeout_ms: u64Maximum wall-clock idle age for a slot before invalidation.
Implementations§
Source§impl ReplicationConfig
impl ReplicationConfig
pub fn standalone() -> ReplicationConfig
pub fn primary() -> ReplicationConfig
pub fn replica(primary_addr: impl Into<String>) -> ReplicationConfig
Sourcepub fn with_quorum(self, quorum: QuorumConfig) -> ReplicationConfig
pub fn with_quorum(self, quorum: QuorumConfig) -> ReplicationConfig
Attach a quorum configuration (fluent setter).
Sourcepub fn with_region(self, region: impl Into<String>) -> ReplicationConfig
pub fn with_region(self, region: impl Into<String>) -> ReplicationConfig
Set the region identifier (fluent setter).
Sourcepub fn with_term(self, term: u64) -> ReplicationConfig
pub fn with_term(self, term: u64) -> ReplicationConfig
Set the replication term stamped into newly produced records.
pub fn with_slot_retention_max_lag_lsn( self, max_lag_lsn: u64, ) -> ReplicationConfig
pub fn with_slot_idle_timeout_ms(self, timeout_ms: u64) -> ReplicationConfig
Trait Implementations§
Source§impl Clone for ReplicationConfig
impl Clone for ReplicationConfig
Source§fn clone(&self) -> ReplicationConfig
fn clone(&self) -> ReplicationConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ReplicationConfig
impl RefUnwindSafe for ReplicationConfig
impl Send for ReplicationConfig
impl Sync for ReplicationConfig
impl Unpin for ReplicationConfig
impl UnsafeUnpin for ReplicationConfig
impl UnwindSafe for ReplicationConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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