pub fn promote_replica(
        &self,
        new_replica: Replica,
        old_replica: Replica,
        shared_sc_sink: Arc<ExclusiveKfSink>) 
    {

         debug!("promoting replica: {} from: {}",new_replica,old_replica);

         if let Some(follower_replica) = self.ctx.followers_state().remove_replica(&old_replica.leader,&old_replica.id) {
                    
            debug!("old follower replica exists, converting to leader: {}",old_replica.id);

            let leader_state = LeaderReplicaState::new(
                    new_replica.id.clone(),
                    new_replica.leader,
                    follower_replica.storage_owned(),
                    new_replica.replicas
            );

            self.spawn_leader_controller(new_replica.id,leader_state,shared_sc_sink); 

        }
    }
/// Promote follower replica as leader, 
/// This is done in 3 steps
/// // 1: Remove follower replica from followers state
/// // 2: Terminate followers controller if need to be (if there are no more follower replicas for that controller)
/// // 3: Start leader controller
Promote follower replica as leader,
This is done in 3 steps
1: Remove follower replica from followers state
2: Terminate followers controller if need to be (if there are no more follower replicas for that controller)
3: Start leader controller
Promote follower replica as leader This is done in 3 steps 1 : Remove follower replica from followers state 2 : Terminate followers controller if need to be ( if there are no more follower replicas for that controller ) 3 : Start leader controller
pub fn promote_replica(
        &self,
        new_replica: Replica,
        old_replica: Replica,
        shared_sc_sink: Arc<ExclusiveKfSink>) 
    {
         debug!("promoting replica: {} from: {}",new_replica,old_replica);
         if let Some(follower_replica) = self.ctx.followers_state().remove_replica(&old_replica.leader,&old_replica.id) {
            debug!("old follower replica exists, converting to leader: {}",old_replica.id);
            let leader_state = LeaderReplicaState::new(
                    new_replica.id.clone(),
                    new_replica.leader,
                    follower_replica.storage_owned(),
                    new_replica.replicas
            );
            self.spawn_leader_controller(new_replica.id,leader_state,shared_sc_sink); 
        }
    }
pub fn promote_replica ( & self , new_replica : Replica , old_replica : Replica , shared_sc_sink : Arc < ExclusiveKfSink > ) { debug ! ( " " new_replica old_replica ) ; if let Some ( follower_replica ) = self . ctx . followers_state ( ) . remove_replica ( & old_replica . leader , & old_replica . id ) { debug ! ( " " old_replica id ) ; let leader_state = LeaderReplicaState :: new ( new_replica . id . clone ( ) , new_replica . leader , follower_replica . storage_owned ( ) , new_replica . replicas ) ; self . spawn_leader_controller ( new_replica . id , leader_state , shared_sc_sink ) ; } }
Promote follower replica as leader,
This is done in 3 steps
 1: Remove follower replica from followers state
 2: Terminate followers controller if need to be (if there are no more follower replicas for that controller)
 3: Start leader controller
Promote follower replica as leader This is done in 3 steps 1 : Remove follower replica from followers state 2 : Terminate followers controller if need to be ( if there are no more follower replicas for that controller ) 3 : Start leader controller
&self
new_replica
Replica
old_replica
Replica
shared_sc_sink
Arc<ExclusiveKfSink>
&self
new_replica
Replica
old_replica
Replica
shared_sc_sink
Arc<ExclusiveKfSink>