pub enum ReplicaClass {
Voting,
AsyncReadReplica,
}Expand description
How a node chooses its WAL upstream.
This is orthogonal to the election MemberKind/VotingState model: a
node’s streaming class answers “may this node accept a cascade source?”,
where the membership model answers “does this node vote / can it become
primary?”. A witness has no data stream at all, so it is irrelevant here;
the meaningful split is between members on the durability path (which must
stream directly) and pure read scale-out replicas (which may cascade).
Variants§
Voting
Participates in the durability/election quorum. Streams directly from the primary and refuses any cascade source (ADR 0030). This is the safe default: a node only cascades when explicitly declared a read-replica.
AsyncReadReplica
Async read-scale-out replica. Not in the durability path, so it may stream from an intermediate replica to bound the primary’s fan-out.
Implementations§
Source§impl ReplicaClass
impl ReplicaClass
Sourcepub fn from_member(member: &Member) -> Self
pub fn from_member(member: &Member) -> Self
Derive the streaming class from an election membership view.
Any member that currently counts toward quorum
(Member::is_voter) is on the durability path and must stream
directly; a data member that is non-voting (e.g. a read-replica that
never joins the voter set) may cascade. This lets a caller that
already holds a Member derive the cascade policy without
re-declaring intent.
Sourcepub fn may_cascade(self) -> bool
pub fn may_cascade(self) -> bool
Whether a node of this class is permitted to stream from an intermediate replica rather than the primary.
Trait Implementations§
Source§impl Clone for ReplicaClass
impl Clone for ReplicaClass
Source§fn clone(&self) -> ReplicaClass
fn clone(&self) -> ReplicaClass
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ReplicaClass
Source§impl Debug for ReplicaClass
impl Debug for ReplicaClass
Source§impl Default for ReplicaClass
impl Default for ReplicaClass
Source§fn default() -> ReplicaClass
fn default() -> ReplicaClass
impl Eq for ReplicaClass
Source§impl PartialEq for ReplicaClass
impl PartialEq for ReplicaClass
Source§fn eq(&self, other: &ReplicaClass) -> bool
fn eq(&self, other: &ReplicaClass) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ReplicaClass
Auto Trait Implementations§
impl Freeze for ReplicaClass
impl RefUnwindSafe for ReplicaClass
impl Send for ReplicaClass
impl Sync for ReplicaClass
impl Unpin for ReplicaClass
impl UnsafeUnpin for ReplicaClass
impl UnwindSafe for ReplicaClass
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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