You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: global_context.rs
    path of file: ./repos/fluvio/crates/fluvio-spu/src/core
    
    the code of the file until where you have to start completion: //!
//! # Global Context
//!
//! Global Context maintains states need to be shared across in the SPU

use std::sync::Arc;
use std::fmt::Debug;

use tracing::{debug, error, instrument};

use fluvio_types::SpuId;
use fluvio_storage::R
    
        async fn switch_leader_for_follower(&self, new: Replica, old: Replica) {
            // we stay as follower but we switch to new leader
            debug!("still follower but switching leader: {}", new);
            if self
                .followers_state()
                .remove_replica(old.leader, &old.id)
                .await
                .is_none()
            {
                error!("there was no follower replica: {} to switch", new);
            }
            if let Err(err) = self.followers_state_owned().add_replica(self, new).await {
                error!("leader switch failed: {}", err);
            }
        }