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

Method add_replica

src/storage-controller/src/instance.rs:140–153  ·  view source on GitHub ↗

Adds a new replica to this storage instance.

(&mut self, id: ReplicaId, config: ReplicaConfig)

Source from the content-addressed store, hash-verified

138
139 /// Adds a new replica to this storage instance.
140 pub fn add_replica(&mut self, id: ReplicaId, config: ReplicaConfig) {
141 // Reduce the history to limit the amount of commands sent to the new replica, and to
142 // enable the `objects_installed` assert below.
143 self.history.reduce();
144
145 let metrics = self.metrics.for_replica(id);
146 let replica = Replica::new(id, config, metrics, self.response_tx.clone());
147
148 self.replicas.insert(id, replica);
149
150 self.update_scheduling(false);
151
152 self.replay_commands(id);
153 }
154
155 /// Replays commands to the specified replica.
156 pub fn replay_commands(&mut self, replica_id: ReplicaId) {

Callers 2

connect_replicaMethod · 0.45

Calls 6

update_schedulingMethod · 0.80
replay_commandsMethod · 0.80
reduceMethod · 0.45
for_replicaMethod · 0.45
cloneMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected