diff --git a/src/v/cluster/controller_backend.cc b/src/v/cluster/controller_backend.cc index 73196a94ee1c5..dd4a8f98730ec 100644 --- a/src/v/cluster/controller_backend.cc +++ b/src/v/cluster/controller_backend.cc @@ -959,7 +959,10 @@ controller_backend::process_partition_reconfiguration( * configuration so old replicas are not longer needed. */ if (can_finish_update( - type, target_assignment.replicas, previous_replicas)) { + partition->get_leader_id(), + type, + target_assignment.replicas, + previous_replicas)) { co_return co_await dispatch_update_finished( std::move(ntp), target_assignment); } @@ -1009,12 +1012,14 @@ controller_backend::process_partition_reconfiguration( } bool controller_backend::can_finish_update( + std::optional current_leader, topic_table_delta::op_type update_type, const std::vector& current_replicas, const std::vector& previous_replicas) { // force abort update may be finished by any node if (update_type == topic_table_delta::op_type::force_abort_update) { - return true; + return current_leader == _self; + ; } // update may be finished by a node that was added to replica set if (!has_local_replicas(_self, previous_replicas)) { diff --git a/src/v/cluster/controller_backend.h b/src/v/cluster/controller_backend.h index 47d5e0f83a5ae..4f9fc093ecd18 100644 --- a/src/v/cluster/controller_backend.h +++ b/src/v/cluster/controller_backend.h @@ -340,6 +340,7 @@ class controller_backend model::ntp, ss::shard_id, partition_assignment); bool can_finish_update( + std::optional, topic_table_delta::op_type, const std::vector&, const std::vector&);