PrimaryReplicatorProxy

Struct PrimaryReplicatorProxy 

Source
pub struct PrimaryReplicatorProxy { /* private fields */ }

Implementations§

Trait Implementations§

Source§

impl PrimaryReplicator for PrimaryReplicatorProxy

Source§

async fn on_data_loss(&self, cancellation_token: BoxedCancelToken) -> Result<u8>

Source§

fn update_catch_up_replica_set_configuration( &self, currentconfiguration: &ReplicaSetConfig, previousconfiguration: &ReplicaSetConfig, ) -> Result<()>

Informs the replicator there there is a current configuration and a previous configuration. Called on primary to inform the set of active secondary replicas that may begin to catchup. Idle secondary replicas are not included here. Read more
Source§

async fn wait_for_catch_up_quorum( &self, catchupmode: ReplicaSetQuorumMode, cancellation_token: BoxedCancelToken, ) -> Result<()>

Called on primary to wait for replicas to catch up, before accepting writes. Read more
Source§

fn update_current_replica_set_configuration( &self, currentconfiguration: &ReplicaSetConfig, ) -> Result<()>

Informs the replicator about the current replica set configuration, and there is no longer a previous configuration. Remarks: Replicas here are not marked as must_catchup.
Source§

async fn build_replica( &self, replica: &ReplicaInformation, cancellation_token: BoxedCancelToken, ) -> Result<()>

Transferring state up to the current quorum LSN to a new or existing replica that is outside the current configuration. (not included in update_catch_up_replica_set_configuration) Read more
Source§

fn remove_replica(&self, replicaid: i64) -> Result<()>

Notifies primary that an idle replica built by build_replica() api call has gone down and replicator should not send more operations to that replica and should release all resources. Remarks: Removing replicas already in the partition, update_catch_up_replica_set_configuration is called instead with ReplicaSetConfig not containng the to be removed replica. SF does not call remove_replica on the replica where build_replica is still running.
Source§

impl Replicator for PrimaryReplicatorProxy

Source§

async fn open(&self, cancellation_token: BoxedCancelToken) -> Result<WString>

Opens replicator, and returns the replicator address that is visible to primary in ReplicaInformation. Remarks: Replicator does not have an assigned role yet and should setup listening endpoint.
Source§

async fn close(&self, cancellation_token: BoxedCancelToken) -> Result<()>

Source§

async fn change_role( &self, epoch: &Epoch, role: &ReplicaRole, cancellation_token: BoxedCancelToken, ) -> Result<()>

Change the replicator role. Read more
Source§

async fn update_epoch( &self, epoch: &Epoch, cancellation_token: BoxedCancelToken, ) -> Result<()>

(TODO: This doc is from IStateProvider but not Replicator.) Indicates to a replica that the configuration of a replica set has changed due to a change or attempted change to the primary replica. The change occurs due to failure or load balancing of the previous primary replica. Epoch changes act as a barrier by segmenting operations into the exact configuration periods in which they were sent by a specific primary replica. Read more
Source§

fn get_current_progress(&self) -> Result<i64>

Get the current LSN, end of log, called on secondaries. SF uses this to do primary selection. It is also passed to update_catch_up_replica_set_configuration() on primary. Primary uses this for catchup.
Source§

fn get_catch_up_capability(&self) -> Result<i64>

Get the first LSN, beginning of log. Remarks: SF uses this to determine if other replicas can catch up from this replica. Other replica’s end of log must be higher than this replica’s beginning of log in order for the other replica to catchup, otherwise SF needs to drop the other replica (if the current replica is chosen to be primary).
Source§

fn abort(&self)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<TraitVariantBlanketType> LocalPrimaryReplicator for TraitVariantBlanketType
where TraitVariantBlanketType: PrimaryReplicator,

Source§

async fn on_data_loss( &self, cancellation_token: Box<dyn CancelToken>, ) -> Result<u8, Error>

Source§

fn update_catch_up_replica_set_configuration( &self, currentconfiguration: &ReplicaSetConfig, previousconfiguration: &ReplicaSetConfig, ) -> Result<(), Error>

Informs the replicator there there is a current configuration and a previous configuration. Called on primary to inform the set of active secondary replicas that may begin to catchup. Idle secondary replicas are not included here. Read more
Source§

fn update_current_replica_set_configuration( &self, currentconfiguration: &ReplicaSetConfig, ) -> Result<(), Error>

Informs the replicator about the current replica set configuration, and there is no longer a previous configuration. Remarks: Replicas here are not marked as must_catchup.
Source§

async fn wait_for_catch_up_quorum( &self, catchupmode: ReplicaSetQuorumMode, cancellation_token: Box<dyn CancelToken>, ) -> Result<(), Error>

Called on primary to wait for replicas to catch up, before accepting writes. Read more
Source§

async fn build_replica( &self, replica: &ReplicaInformation, cancellation_token: Box<dyn CancelToken>, ) -> Result<(), Error>

Transferring state up to the current quorum LSN to a new or existing replica that is outside the current configuration. (not included in update_catch_up_replica_set_configuration) Read more
Source§

fn remove_replica(&self, replicaid: i64) -> Result<(), Error>

Notifies primary that an idle replica built by build_replica() api call has gone down and replicator should not send more operations to that replica and should release all resources. Remarks: Removing replicas already in the partition, update_catch_up_replica_set_configuration is called instead with ReplicaSetConfig not containng the to be removed replica. SF does not call remove_replica on the replica where build_replica is still running.
Source§

impl<TraitVariantBlanketType> LocalReplicator for TraitVariantBlanketType
where TraitVariantBlanketType: Replicator,

Source§

async fn open( &self, cancellation_token: Box<dyn CancelToken>, ) -> Result<WString, Error>

Opens replicator, and returns the replicator address that is visible to primary in ReplicaInformation. Remarks: Replicator does not have an assigned role yet and should setup listening endpoint.
Source§

async fn close( &self, cancellation_token: Box<dyn CancelToken>, ) -> Result<(), Error>

Source§

async fn change_role( &self, epoch: &Epoch, role: &ReplicaRole, cancellation_token: Box<dyn CancelToken>, ) -> Result<(), Error>

Change the replicator role. Read more
Source§

async fn update_epoch( &self, epoch: &Epoch, cancellation_token: Box<dyn CancelToken>, ) -> Result<(), Error>

(TODO: This doc is from IStateProvider but not Replicator.) Indicates to a replica that the configuration of a replica set has changed due to a change or attempted change to the primary replica. The change occurs due to failure or load balancing of the previous primary replica. Epoch changes act as a barrier by segmenting operations into the exact configuration periods in which they were sent by a specific primary replica. Read more
Source§

fn get_current_progress(&self) -> Result<i64, Error>

Get the current LSN, end of log, called on secondaries. SF uses this to do primary selection. It is also passed to update_catch_up_replica_set_configuration() on primary. Primary uses this for catchup.
Source§

fn get_catch_up_capability(&self) -> Result<i64, Error>

Get the first LSN, beginning of log. Remarks: SF uses this to determine if other replicas can catch up from this replica. Other replica’s end of log must be higher than this replica’s beginning of log in order for the other replica to catchup, otherwise SF needs to drop the other replica (if the current replica is chosen to be primary).
Source§

fn abort(&self)

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more