Adds a new replica to this storage instance.
(&mut self, id: ReplicaId, config: ReplicaConfig)
| 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) { |
no test coverage detected