pub async fn remove(&self, node_id: NodeId) -> StoreResult<()> {
        let metrics = self.app_node.raft.metrics().borrow().clone();
        let membership = metrics.membership_config.get_configs();

        // if !membership.contains(&node_id) {
        //     return Ok(());
        // }

        // TODO(xp): deal with joint config
        assert!(membership.get(1).is_none());

        // safe unwrap: if the first config is None, panic is the expected behavior
        // here.
        let mut membership = membership.get(0).unwrap().clone();

        membership.remove(&node_id);
        if !membership.contains(&node_id) {
            return Ok(());
        }
        self.change_membership(membership).await
    }
// remove the node, specified by id, from the cluster.
remove the node, specified by id, from the cluster.
remove the node specified by id from the cluster .
pub async fn remove(&self, node_id: NodeId) -> StoreResult<()> {
        let metrics = self.app_node.raft.metrics().borrow().clone();
        let membership = metrics.membership_config.get_configs();
        // if !membership.contains(&node_id) {
        //     return Ok(());
        // }
        // TODO(xp): deal with joint config
        assert!(membership.get(1).is_none());
        // safe unwrap: if the first config is None, panic is the expected behavior
        // here.
        let mut membership = membership.get(0).unwrap().clone();
        membership.remove(&node_id);
        if !membership.contains(&node_id) {
            return Ok(());
        }
        self.change_membership(membership).await
    }
pub async fn remove ( & self , node_id : NodeId ) -> StoreResult < ( ) > { let metrics = self . app_node . raft . metrics ( ) . borrow ( ) . clone ( ) ; let membership = metrics . membership_config . get_configs ( ) ; // if !membership.contains(&node_id) { //     return Ok(()); // } // TODO(xp): deal with joint config assert ! ( membership get ( 1 ) is_none ( ) ) ; // safe unwrap: if the first config is None, panic is the expected behavior // here. let mut membership = membership . get ( 0 ) . unwrap ( ) . clone ( ) ; membership . remove ( & node_id ) ; if ! membership . contains ( & node_id ) { return Ok ( ( ) ) ; } self . change_membership ( membership ) . await }
remove the node, specified by id, from the cluster.
remove the node specified by id from the cluster .
&self
node_id
NodeId
&self
node_id
NodeId