Skip to main content

wait_until_drained

Function wait_until_drained 

Source
pub async fn wait_until_drained(
    store: &AssignmentSnapshotStore,
    authority: Option<&LeaderLeaseStore>,
    me: NodeId,
    vnode_count: u32,
    poll: Duration,
    deadline: Duration,
) -> bool
Expand description

Poll the durable assignment snapshot until me owns no vnodes (its state has been reassigned elsewhere) or deadline elapses. Returns true if fully drained. A version materialized from a drain is accepted only with its matching shared-authority decision; None therefore supports ordinary snapshots but fails closed for a drain finalization. Used by a draining node to know when it is safe to exit.