Skip to content

Commit

Permalink
c/members_backend: check domain while decr removed replicas
Browse files Browse the repository at this point in the history
in calculate_unevenness_error we calculate current replicas per node by
domain. Previously we didn't check domain of replicas that are going to
be removed so we decremented allocated_replicas incorreclty.

Now we add check that removing replica has same domain as we are
counting now
  • Loading branch information
ZeDRoman committed Apr 6, 2023
1 parent a0df091 commit 4bdccb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/v/cluster/members_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ double calculate_unevenness_error(
* from the node after successful reallocation
*/
for (const auto& r : update.partition_reallocations) {
if (r.allocation_units) {
if (get_allocation_domain(r.ntp) == domain && r.allocation_units) {
for (const auto& to_remove : r.replicas_to_remove) {
auto it = node_replicas.find(to_remove);
if (it != node_replicas.end()) {
Expand Down

0 comments on commit 4bdccb2

Please sign in to comment.