Skip to content

Commit

Permalink
c/members_manager: validate if node exists in the cluster before update
Browse files Browse the repository at this point in the history
Previously `members_manager::handle_configuration_update_request` method
did not validate if a node exists in the cluster. This lead to assertion
being triggered when resulting cluster configuration was checked. Added
validation of node existence in the `members_table`.

Fixes: redpanda-data#13108

Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit 952a324)
  • Loading branch information
mmaslankaprv authored and vbotbuildovich committed Sep 1, 2023
1 parent 2f0de10 commit 659d70c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/v/cluster/cluster_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -498,11 +498,11 @@ std::optional<ss::sstring> check_result_configuration(
const members_table::cache_t& current_brokers,
const model::broker& new_configuration) {
auto it = current_brokers.find(new_configuration.id());
vassert(
it != current_brokers.end(),
"When broker configuration is being updated the broker must exists. "
"Updating broker {} configuration.",
new_configuration);
if (it == current_brokers.end()) {
return fmt::format(
"broker {} does not exists in list of cluster members",
new_configuration.id());
}
auto& current_configuration = it->second.broker;
/**
* do no allow to decrease node core count
Expand Down

0 comments on commit 659d70c

Please sign in to comment.