Skip to content

Commit

Permalink
Only send control processor requests if observed and target run mode …
Browse files Browse the repository at this point in the history
…differ

This fixes #2244.
  • Loading branch information
tillrohrmann committed Nov 8, 2024
1 parent 2f00d4c commit 373979b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions crates/admin/src/cluster_controller/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,12 +501,15 @@ impl<T: TransportConnect> Scheduler<T> {

if let Some(target_state) = target_state {
for (node_id, run_mode) in target_state.iter() {
observed_state.remove(&node_id);

commands.entry(node_id).or_default().push(ControlProcessor {
partition_id: *partition_id,
command: ProcessorCommand::from(run_mode),
});
if !observed_state
.remove(&node_id)
.is_some_and(|observed_run_mode| observed_run_mode == run_mode)
{
commands.entry(node_id).or_default().push(ControlProcessor {
partition_id: *partition_id,
command: ProcessorCommand::from(run_mode),
});
}
}
}

Expand Down

0 comments on commit 373979b

Please sign in to comment.