pub struct FailoverManager { /* private fields */ }Expand description
Manages failover for a single local cluster watching its peers.
When a peer cluster becomes unreachable for longer than the grace period, the failover manager attempts to re-register ownership of grains that were owned by the failed cluster.
Implementations§
Source§impl FailoverManager
impl FailoverManager
pub fn new( local_cluster_id: ClusterId, config: FailoverConfig, health: Arc<ClusterHealth>, directory: Arc<dyn CrossClusterDirectory>, shutdown_rx: Receiver<bool>, ) -> Self
Sourcepub async fn promote_grain(
&self,
grain_id: &GrainId,
current_ownership: &GrainOwnership,
) -> Result<GrainOwnership, DirectoryError>
pub async fn promote_grain( &self, grain_id: &GrainId, current_ownership: &GrainOwnership, ) -> Result<GrainOwnership, DirectoryError>
Attempt to promote a specific grain owned by a failed cluster.
Uses CAS on the directory with an incremented epoch. Returns the new ownership record on success, or the existing owner if another cluster won the promotion race.
Auto Trait Implementations§
impl !RefUnwindSafe for FailoverManager
impl !UnwindSafe for FailoverManager
impl Freeze for FailoverManager
impl Send for FailoverManager
impl Sync for FailoverManager
impl Unpin for FailoverManager
impl UnsafeUnpin for FailoverManager
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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>
Wrap the input message
T in a tonic::Request