Skip to content

Commit

Permalink
c/backend: wait for leader to be elected before finishing abort cancel
Browse files Browse the repository at this point in the history
When forcibly aborting reconfiguration we should wait for the new leader
to be elected in the configuration that the partition was forced to.
This way we can be certain that the new configuration will finally be
replicated to the majority of nodes even tough the leader may not
exists at the time when configuration is replicated.

Fixes: redpanda-data#9243

Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit 3948312)
  • Loading branch information
mmaslankaprv authored and Michal Maslanka committed Jul 20, 2023
1 parent edf37e9 commit e3c5741
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/v/cluster/controller_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1116,9 +1116,9 @@ bool controller_backend::can_finish_update(
uint64_t current_retry,
topic_table_delta::op_type update_type,
const std::vector<model::broker_shard>& current_replicas) {
// force abort update may be finished by any node
if (update_type == topic_table_delta::op_type::force_abort_update) {
return true;
// Wait for the leader to be elected in the new replica set.
return current_leader == _self;
}
/**
* If the revert feature is active we use current leader to dispatch
Expand Down

0 comments on commit e3c5741

Please sign in to comment.