(&mut self, cmd: ComputeCommand)
| 1101 | /// Sends a command to replicas of this instance. |
| 1102 | #[mz_ore::instrument(level = "debug")] |
| 1103 | fn send(&mut self, cmd: ComputeCommand) { |
| 1104 | // Record the command so that new replicas can be brought up to speed. |
| 1105 | // We record the *base* (un-specialized) command, so that the per-replica |
| 1106 | // dyncfg overrides are re-applied at replay time in `add_replica` rather |
| 1107 | // than baked into the shared history. |
| 1108 | self.history.push(cmd.clone()); |
| 1109 | |
| 1110 | let target_replica = self.target_replica(&cmd); |
| 1111 | |
| 1112 | // Borrow the overrides and dyncfg separately from `self.replicas` so the per-replica |
| 1113 | // specialization below does not conflict with the mutable replica borrow. |
| 1114 | let overrides = &self.replica_dyncfg_overrides; |
| 1115 | let dyncfg = &self.dyncfg; |
| 1116 | |
| 1117 | if let Some(rid) = target_replica { |
| 1118 | if let Some(replica) = self.replicas.get_mut(&rid) { |
| 1119 | let cmd = Self::specialize_command_for_replica(cmd, rid, overrides, dyncfg); |
| 1120 | let _ = replica.client.send(cmd); |
| 1121 | } |
| 1122 | } else { |
| 1123 | for (rid, replica) in self.replicas.iter_mut() { |
| 1124 | let cmd = |
| 1125 | Self::specialize_command_for_replica(cmd.clone(), *rid, overrides, dyncfg); |
| 1126 | let _ = replica.client.send(cmd); |
| 1127 | } |
| 1128 | } |
| 1129 | } |
| 1130 | |
| 1131 | /// Specializes a command for a specific replica by merging that replica's dyncfg override into |
| 1132 | /// its configuration. For `UpdateConfiguration` the override is merged into the update. For |
no test coverage detected