Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
Doris-Extras committed Sep 23, 2024
1 parent ba281ee commit 8298d70
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions be/src/runtime/workload_group/workload_group_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,10 @@ void WorkloadGroupMgr::refresh_wg_weighted_memory_limit() {
bool is_high_wartermark = false;
wg.second->check_mem_used(&is_low_wartermark, &is_high_wartermark);
int64_t wg_high_water_mark_limit =
wg_mem_limit * wg.second->spill_threshold_high_water_mark() * 1.0 / 100;
(int64_t)(wg_mem_limit * wg.second->spill_threshold_high_water_mark() * 1.0 / 100);
int64_t weighted_high_water_mark_limit =
wg_weighted_mem_limit * wg.second->spill_threshold_high_water_mark() * 1.0 / 100;
(int64_t)(wg_weighted_mem_limit * wg.second->spill_threshold_high_water_mark() *
1.0 / 100);
std::string debug_msg;
if (is_high_wartermark || is_low_wartermark) {
debug_msg = fmt::format(
Expand Down Expand Up @@ -264,9 +265,9 @@ void WorkloadGroupMgr::refresh_wg_weighted_memory_limit() {
<< " enabled hard limit, but the slot count < 1, could not take affect";
} else {
// If the query enable hard limit, then not use weighted info any more, just use the settings limit.
query_weighted_mem_limit =
(wg_high_water_mark_limit * query_ctx->get_slot_count() * 1.0) /
total_slot_count;
query_weighted_mem_limit = (int64_t)((wg_high_water_mark_limit *
query_ctx->get_slot_count() * 1.0) /
total_slot_count);
}
} else {
// If low water mark is not reached, then use process memory limit as query memory limit.
Expand All @@ -276,9 +277,9 @@ void WorkloadGroupMgr::refresh_wg_weighted_memory_limit() {
} else {
query_weighted_mem_limit =
total_used_slot_count > 0
? (wg_high_water_mark_limit + total_used_slot_count) *
query_ctx->get_slot_count() * 1.0 /
total_used_slot_count
? (int64_t)((wg_high_water_mark_limit + total_used_slot_count) *
query_ctx->get_slot_count() * 1.0 /
total_used_slot_count)
: wg_high_water_mark_limit;
}
}
Expand Down

0 comments on commit 8298d70

Please sign in to comment.