Skip to content

Commit

Permalink
c/partition_balancer: rename planned_movement_disk_size
Browse files Browse the repository at this point in the history
  • Loading branch information
ztlpn committed Aug 5, 2022
1 parent 9ec1d24 commit 55dfad0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
13 changes: 4 additions & 9 deletions src/v/cluster/partition_balancer_planner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ result<allocation_units> partition_balancer_planner::get_reallocation(
}

rrs.moving_partitions.insert(ntp);
rrs.planned_movement_disk_size += partition_size;
rrs.planned_moves_size += partition_size;
for (const auto r :
reallocation.value().get_assignments().front().replicas) {
if (
Expand Down Expand Up @@ -263,9 +263,7 @@ void partition_balancer_planner::get_unavailable_nodes_reassignments(
for (const auto& t : _topic_table.topics_map()) {
for (const auto& a : t.second.get_assignments()) {
// End adding movements if batch is collected
if (
rrs.planned_movement_disk_size
>= _config.movement_disk_size_batch) {
if (rrs.planned_moves_size >= _config.movement_disk_size_batch) {
return;
}

Expand Down Expand Up @@ -359,8 +357,7 @@ void partition_balancer_planner::get_full_node_reassignments(
}

for (const auto* node_disk : sorted_full_nodes) {
if (
rrs.planned_movement_disk_size >= _config.movement_disk_size_batch) {
if (rrs.planned_moves_size >= _config.movement_disk_size_batch) {
return;
}

Expand All @@ -377,9 +374,7 @@ void partition_balancer_planner::get_full_node_reassignments(
auto ntp_size_it = ntp_on_node_sizes.begin();
while (node_disk->final_used_ratio() > _config.soft_max_disk_usage_ratio
&& ntp_size_it != ntp_on_node_sizes.end()) {
if (
rrs.planned_movement_disk_size
>= _config.movement_disk_size_batch) {
if (rrs.planned_moves_size >= _config.movement_disk_size_batch) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/v/cluster/partition_balancer_planner.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class partition_balancer_planner {

private:
struct reallocation_request_state {
uint64_t planned_movement_disk_size = 0;
uint64_t planned_moves_size = 0;
absl::flat_hash_map<model::ntp, size_t> ntp_sizes;
absl::flat_hash_map<model::node_id, node_disk_space> node_disk_reports;
absl::flat_hash_set<model::node_id> unavailable_nodes;
Expand Down

0 comments on commit 55dfad0

Please sign in to comment.