/// Create a "standard" shared MiniCluster that has a router, ingester,
/// querier
///
/// Note: Since the underlying server processes are shared across multiple
/// tests so all users of this MiniCluster should only modify
/// their namespace
Create a "standard" shared MiniCluster that has a router, ingester,
querier

Since the underlying server processes are shared across multiple
tests so all users of this MiniCluster should only modify
their namespace
Create a " standard " shared MiniCluster that has a router ingester querier Since the underlying server processes are shared across multiple tests so all users of this MiniCluster should only modify their namespace
pub async fn create_shared(database_url: String) -> Self {
        let start = Instant::now();
        let mut shared_servers = GLOBAL_SHARED_SERVERS.lock().await;
        debug!(mutex_wait=?start.elapsed(), "creating standard cluster");
        // try to reuse existing server processes
        if let Some(shared) = shared_servers.take() {
            if let Some(cluster) = shared.creatable_cluster().await {
                debug!("Reusing existing cluster");
                // Put the server back
                *shared_servers = Some(shared);
                let start = Instant::now();
                // drop the lock prior to calling create() to allow
                // others to proceed
                std::mem::drop(shared_servers);
                let new_self = cluster.create().await;
                info!(total_wait=?start.elapsed(), "created new new mini cluster from existing cluster");
                return new_self;
            } else {
                info!("some server proceses of previous cluster have already returned");
            }
        }
        // Have to make a new one
        info!("Create a new server");
        let new_cluster = Self::create_non_shared_standard(database_url).await;
        // Update the shared servers to point at the newly created server proesses
        *shared_servers = Some(SharedServers::new(&new_cluster));
        new_cluster
    }
pub async fn create_shared ( database_url : String ) -> Self { let start = Instant :: now ( ) ; let mut shared_servers = GLOBAL_SHARED_SERVERS . lock ( ) . await ; debug ! ( mutex_wait start elapsed ( ) " " ) ; // try to reuse existing server processes if let Some ( shared ) = shared_servers . take ( ) { if let Some ( cluster ) = shared . creatable_cluster ( ) . await { debug ! ( " " ) ; // Put the server back * shared_servers = Some ( shared ) ; let start = Instant :: now ( ) ; // drop the lock prior to calling create() to allow // others to proceed std :: mem :: drop ( shared_servers ) ; let new_self = cluster . create ( ) . await ; info ! ( total_wait start elapsed ( ) " " ) ; return new_self ; } else { info ! ( " " ) ; } } // Have to make a new one info ! ( " " ) ; let new_cluster = Self :: create_non_shared_standard ( database_url ) . await ; // Update the shared servers to point at the newly created server proesses * shared_servers = Some ( SharedServers :: new ( & new_cluster ) ) ; new_cluster }
Create a "standard" shared MiniCluster that has a router, ingester,
querier
Create a " standard " shared MiniCluster that has a router ingester querier
database_url
String