async fn update_replica(&self, replica_msg: Replica) {
        debug!(
            "received update replica {} from leader: {}",
            replica_msg, self.leader_id
        );

        let replica_key = replica_msg.id.clone();
        if self.followers_state.has_replica(&replica_key) {
            debug!("has already follower replica: {}, igoring", replica_key);
        } else {
            let log = &self.config.storage().new_config();
            match FollowerReplicaState::new(
                self.config.id(),
                replica_msg.leader,
                &replica_key,
                &log,
            )
            .await
            {
                Ok(replica_state) => {
                    self.followers_state.insert_replica(replica_state);
                }
                Err(err) => error!(
                    "error creating follower replica: {}, errr: {:#?}",
                    replica_key, err
                ),
            }
        }
    }
/// create new replica if doesn't exist yet
create new replica if doesn't exist yet
create new replica if doesn ' t exist yet
async fn update_replica(&self, replica_msg: Replica) {
        debug!(
            "received update replica {} from leader: {}",
            replica_msg, self.leader_id
        );
        let replica_key = replica_msg.id.clone();
        if self.followers_state.has_replica(&replica_key) {
            debug!("has already follower replica: {}, igoring", replica_key);
        } else {
            let log = &self.config.storage().new_config();
            match FollowerReplicaState::new(
                self.config.id(),
                replica_msg.leader,
                &replica_key,
                &log,
            )
            .await
            {
                Ok(replica_state) => {
                    self.followers_state.insert_replica(replica_state);
                }
                Err(err) => error!(
                    "error creating follower replica: {}, errr: {:#?}",
                    replica_key, err
                ),
            }
        }
    }
async fn update_replica ( & self , replica_msg : Replica ) { debug ! ( " " replica_msg self leader_id ) ; let replica_key = replica_msg . id . clone ( ) ; if self . followers_state . has_replica ( & replica_key ) { debug ! ( " " replica_key ) ; } else { let log = & self . config . storage ( ) . new_config ( ) ; match FollowerReplicaState :: new ( self . config . id ( ) , replica_msg . leader , & replica_key , & log , ) . await { Ok ( replica_state ) => { self . followers_state . insert_replica ( replica_state ) ; } Err ( err ) => error ! ( " " replica_key err ) , } } }
create new replica if doesn't exist yet
create new replica if doesn ' t exist yet
&self
replica_msg
Replica
&self
replica_msg
Replica