Skip to content

Commit

Permalink
Merge pull request #18091 from mmaslankaprv/balancer-variable
Browse files Browse the repository at this point in the history
c/balancer_backend: first initialize planner and then call plan
  • Loading branch information
mmaslankaprv authored Apr 28, 2024
2 parents 3846def + a52d0ad commit a1a5b38
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions src/v/cluster/partition_balancer_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -357,24 +357,26 @@ ss::future<> partition_balancer_backend::do_tick() {
// claim node unresponsive it doesn't responded to at least 7
// status requests by default 700ms
auto const node_responsiveness_timeout = _node_status_interval() * 7;
auto plan_data
= co_await partition_balancer_planner(
planner_config{
.mode = _mode(),
.soft_max_disk_usage_ratio = soft_max_disk_usage_ratio,
.hard_max_disk_usage_ratio = hard_max_disk_usage_ratio,
.max_concurrent_actions = _max_concurrent_actions(),
.node_availability_timeout_sec = _availability_timeout(),
.ondemand_rebalance_requested
= _cur_term->_ondemand_rebalance_requested,
.segment_fallocation_step = _segment_fallocation_step(),
.min_partition_size_threshold = get_min_partition_size_threshold(),
.node_responsiveness_timeout = node_responsiveness_timeout,
.topic_aware = _topic_aware(),
},
_state,
_partition_allocator)
.plan_actions(health_report.value(), _tick_in_progress.value());

partition_balancer_planner planner(
planner_config{
.mode = _mode(),
.soft_max_disk_usage_ratio = soft_max_disk_usage_ratio,
.hard_max_disk_usage_ratio = hard_max_disk_usage_ratio,
.max_concurrent_actions = _max_concurrent_actions(),
.node_availability_timeout_sec = _availability_timeout(),
.ondemand_rebalance_requested
= _cur_term->_ondemand_rebalance_requested,
.segment_fallocation_step = _segment_fallocation_step(),
.min_partition_size_threshold = get_min_partition_size_threshold(),
.node_responsiveness_timeout = node_responsiveness_timeout,
.topic_aware = _topic_aware(),
},
_state,
_partition_allocator);

auto plan_data = co_await planner.plan_actions(
health_report.value(), _tick_in_progress.value());

_cur_term->last_tick_time = clock_t::now();
_cur_term->last_violations = std::move(plan_data.violations);
Expand Down

0 comments on commit a1a5b38

Please sign in to comment.