Skip to main content

AdminService

Trait AdminService 

Source
pub trait AdminService:
    Send
    + Sync
    + 'static {
    // Required methods
    fn describe_active_node<'life0, 'async_trait>(
        &'life0 self,
        request: Request<DescribeActiveNodeRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<DescribeActiveNodeResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn step_down_active_node<'life0, 'async_trait>(
        &'life0 self,
        request: Request<StepDownActiveNodeRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<StepDownActiveNodeResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Generated trait containing gRPC methods that should be implemented for use with AdminServiceServer.

Required Methods§

Source

fn describe_active_node<'life0, 'async_trait>( &'life0 self, request: Request<DescribeActiveNodeRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<DescribeActiveNodeResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the node ID, node epoch, and lease holder of the active Server process.

The process that receives the call answers from the node lease it holds. It fails with FailedPrecondition when it is not the active process, for example while it starts, stands by, or steps down, or while no process holds the lease during a hold-off. Wait past the hold-off and call again. The call changes nothing, so it is safe to retry.

Source

fn step_down_active_node<'life0, 'async_trait>( &'life0 self, request: Request<StepDownActiveNodeRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<StepDownActiveNodeResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Makes the active Server process of a node ID give up its node lease.

The active process stops serving and waits, within a bound, for in-flight commits. It then releases the node lease and stays running as a standby process. It waits for lease_reacquisition_hold_off before it competes for the lease again, so another standby process of the same node ID can take over first. If none does, it takes the lease back with a new node epoch.

After the release, the call watches the node lease. It returns as soon as another process takes over. Otherwise it returns after the hold-off and one attempt by this process to take the lease back. The call therefore lasts at most the commit drain bound, the release, the hold-off, and one lease acquisition attempt. The response names the process that holds the lease, or says that neither case was confirmed within that bound.

Without a precondition, a call steps down whichever process is active when it arrives, so a blind retry can step down the process that just took over. Call DescribeActiveNode first and set expected_node_id and expected_node_epoch to the values it returned. Keep those values for any retry.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§