/// send route replica offsets to leader replica controller
/// it spawn request 
send route replica offsets to leader replica controller
it spawn request
send route replica offsets to leader replica controller it spawn request
async fn route_replica_offset(ctx: DefaultSharedGlobalContext,follower_id: SpuId,replica: ReplicaOffsetRequest) {
    let replica_key = replica.replica;
    let follower_update = FollowerOffsetUpdate {
        follower_id: follower_id,
        leo: replica.leo,
        hw: replica.hw
    };
    match ctx.leaders_state().send_message(&replica_key,LeaderReplicaControllerCommand::FollowerOffsetUpdate(follower_update)).await {
        Ok(success_stat) => {
            if success_stat {
                trace!("send offset data to: replica leader: {}",replica_key);
            } else {
                warn!("replica leader: {} was not found",replica_key);      // this could happen when leader controller is not happen
            }
        },
        Err(err) => error!("Error writing message to replica {}, err: {}",replica_key,err)
    }
 }
async fn route_replica_offset ( ctx : DefaultSharedGlobalContext , follower_id : SpuId , replica : ReplicaOffsetRequest ) { let replica_key = replica . replica ; let follower_update = FollowerOffsetUpdate { follower_id : follower_id , leo : replica . leo , hw : replica . hw } ; match ctx . leaders_state ( ) . send_message ( & replica_key , LeaderReplicaControllerCommand :: FollowerOffsetUpdate ( follower_update ) ) . await { Ok ( success_stat ) => { if success_stat { trace ! ( " " replica_key ) ; } else { warn ! ( " " replica_key ) ; // this could happen when leader controller is not happen } } , Err ( err ) => error ! ( " " replica_key err ) } }
send route replica offsets to leader replica controller
it spawn request
send route replica offsets to leader replica controller it spawn request
ctx
DefaultSharedGlobalContext
follower_id
SpuId
replica
ReplicaOffsetRequest