Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v23.2.x] c/controller_backend: try to force-abort reconfiguration only on leaders #18044

Merged
merged 1 commit into from
May 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/v/cluster/controller_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1777,12 +1777,20 @@ ss::future<std::error_code> controller_backend::force_abort_replica_set_update(
}
co_return errc::waiting_for_recovery;
} else {
auto current_leader = partition->get_leader_id();
if (current_leader && current_leader != _self) {
// The leader is alive and we are a follower. Wait for the leader to
// replicate the aborting configuration, but don't append it
// ourselves to minimize the chance of log inconsistency.
co_return errc::not_leader;
}

auto ec = co_await partition->force_abort_replica_set_update(rev);

if (ec) {
co_return ec;
}
auto current_leader = partition->get_leader_id();
current_leader = partition->get_leader_id();
if (!current_leader.has_value() || current_leader == _self) {
co_return check_configuration_update(
_self, partition, replicas, rev);
Expand Down
Loading