MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / drop_replica

Method drop_replica

src/compute-client/src/controller.rs:754–773  ·  view source on GitHub ↗

Removes a replica from an instance, including its service in the orchestrator.

(
        &mut self,
        instance_id: ComputeInstanceId,
        replica_id: ReplicaId,
    )

Source from the content-addressed store, hash-verified

752
753 /// Removes a replica from an instance, including its service in the orchestrator.
754 pub fn drop_replica(
755 &mut self,
756 instance_id: ComputeInstanceId,
757 replica_id: ReplicaId,
758 ) -> Result<(), ReplicaDropError> {
759 use ReplicaDropError::*;
760
761 let instance = self.instance_mut(instance_id)?;
762
763 // Validation
764 if !instance.replicas.contains(&replica_id) {
765 return Err(ReplicaMissing(replica_id));
766 }
767
768 instance.replicas.remove(&replica_id);
769
770 instance.call(move |i| i.remove_replica(replica_id).expect("validated"));
771
772 Ok(())
773 }
774
775 /// Creates the described dataflow and initializes state for its output.
776 ///

Callers

nothing calls this directly

Calls 7

ReplicaMissingClass · 0.85
instance_mutMethod · 0.80
expectMethod · 0.80
containsMethod · 0.45
removeMethod · 0.45
callMethod · 0.45
remove_replicaMethod · 0.45

Tested by

no test coverage detected