Record that a migration has completed.
(&mut self, vshard_id: u32)
| 182 | |
| 183 | /// Record that a migration has completed. |
| 184 | pub fn migration_completed(&mut self, vshard_id: u32) { |
| 185 | self.active_migrations.remove(&vshard_id); |
| 186 | if self.active_migrations.is_empty() { |
| 187 | self.last_rebalance = Some(Instant::now()); |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | /// Check if a specific tenant can start another migration. |
| 192 | pub fn can_migrate_tenant(&self, tenant_id: u64) -> bool { |