This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch spill_and_reserve in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/spill_and_reserve by this push: new e861a578c75 fix typo error watermark e861a578c75 is described below commit e861a578c75e684afb65daa5974bafbc9fd42cf9 Author: yiguolei <guo...@selectdb.com> AuthorDate: Wed Nov 13 17:50:49 2024 +0800 fix typo error watermark --- be/src/runtime/query_context.h | 10 +++++----- be/src/runtime/workload_group/workload_group.h | 12 ++++++------ .../workload_group/workload_group_manager.cpp | 20 ++++++++++---------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/be/src/runtime/query_context.h b/be/src/runtime/query_context.h index c7143c339eb..e363fa3ba49 100644 --- a/be/src/runtime/query_context.h +++ b/be/src/runtime/query_context.h @@ -300,11 +300,11 @@ public: } if (_workload_group) { - bool is_low_wartermark = false; - bool is_high_wartermark = false; - _workload_group->check_mem_used(&is_low_wartermark, &is_high_wartermark); + bool is_low_watermark = false; + bool is_high_watermark = false; + _workload_group->check_mem_used(&is_low_watermark, &is_high_watermark); // If the wg is not enable hard limit, this will also take effect to lower down the memory usage. - if (is_high_wartermark) { + if (is_high_watermark) { LOG(INFO) << "Query " << print_id(_query_id) << " goes to low memory mode due to workload group high water mark reached"; @@ -312,7 +312,7 @@ public: return; } - if (is_low_wartermark && + if (is_low_watermark && ((_query_options.__isset.enable_join_spill && _query_options.enable_join_spill) || (_query_options.__isset.enable_sort_spill && _query_options.enable_sort_spill) || (_query_options.__isset.enable_agg_spill && _query_options.enable_agg_spill))) { diff --git a/be/src/runtime/workload_group/workload_group.h b/be/src/runtime/workload_group/workload_group.h index 6e2fa426cf6..c6dc448085b 100644 --- a/be/src/runtime/workload_group/workload_group.h +++ b/be/src/runtime/workload_group/workload_group.h @@ -115,14 +115,14 @@ public: _wg_refresh_interval_memory_growth.fetch_sub(size); } - void check_mem_used(bool* is_low_wartermark, bool* is_high_wartermark) const { + void check_mem_used(bool* is_low_watermark, bool* is_high_watermark) const { auto realtime_total_mem_used = _total_mem_used + _wg_refresh_interval_memory_growth.load(); - *is_low_wartermark = (realtime_total_mem_used > + *is_low_watermark = (realtime_total_mem_used > + ((double)_memory_limit * + _spill_low_watermark.load(std::memory_order_relaxed) / 100)); + *is_high_watermark = (realtime_total_mem_used > ((double)_memory_limit * - _spill_low_watermark.load(std::memory_order_relaxed) / 100)); - *is_high_wartermark = (realtime_total_mem_used > - ((double)_memory_limit * - _spill_high_watermark.load(std::memory_order_relaxed) / 100)); + _spill_high_watermark.load(std::memory_order_relaxed) / 100)); } std::string debug_string() const; diff --git a/be/src/runtime/workload_group/workload_group_manager.cpp b/be/src/runtime/workload_group/workload_group_manager.cpp index 1b44ec976ba..77aeefcef53 100644 --- a/be/src/runtime/workload_group/workload_group_manager.cpp +++ b/be/src/runtime/workload_group/workload_group_manager.cpp @@ -288,9 +288,9 @@ void WorkloadGroupMgr::handle_paused_queries() { auto& queries_list = it->second; const auto& wg = it->first; - bool is_low_wartermark = false; - bool is_high_wartermark = false; - wg->check_mem_used(&is_low_wartermark, &is_high_wartermark); + bool is_low_watermark = false; + bool is_high_watermark = false; + wg->check_mem_used(&is_low_watermark, &is_high_watermark); bool has_changed_hard_limit = false; int64_t flushed_memtable_bytes = 0; @@ -471,7 +471,7 @@ void WorkloadGroupMgr::handle_paused_queries() { } } // Not need waiting flush memtable and below low watermark disable load buffer limit - if (flushed_memtable_bytes <= 0 && !is_low_wartermark) { + if (flushed_memtable_bytes <= 0 && !is_low_watermark) { wg->enable_write_buffer_limit(false); } @@ -689,9 +689,9 @@ bool WorkloadGroupMgr::handle_single_query_(std::shared_ptr<QueryContext> query_ void WorkloadGroupMgr::update_queries_limit_(WorkloadGroupPtr wg, bool enable_hard_limit) { auto wg_mem_limit = wg->memory_limit(); auto all_query_ctxs = wg->queries(); - bool is_low_wartermark = false; - bool is_high_wartermark = false; - wg->check_mem_used(&is_low_wartermark, &is_high_wartermark); + bool is_low_watermark = false; + bool is_high_watermark = false; + wg->check_mem_used(&is_low_watermark, &is_high_watermark); int64_t wg_high_water_mark_limit = (int64_t)(wg_mem_limit * wg->spill_threshold_high_water_mark() * 1.0 / 100); int64_t memtable_usage = wg->write_buffer_size(); @@ -703,7 +703,7 @@ void WorkloadGroupMgr::update_queries_limit_(WorkloadGroupPtr wg, bool enable_ha wg_high_water_mark_limit - memtable_usage - 10 * 1024 * 1024; } std::string debug_msg; - if (is_high_wartermark || is_low_wartermark) { + if (is_high_watermark || is_low_watermark) { debug_msg = fmt::format( "\nWorkload Group {}: mem limit: {}, mem used: {}, " "high water mark mem limit: {}, load memtable usage: {}, used ratio: {}", @@ -715,7 +715,7 @@ void WorkloadGroupMgr::update_queries_limit_(WorkloadGroupPtr wg, bool enable_ha } // If reached low watermark and wg is not enable memory overcommit, then enable load buffer limit - if (is_low_wartermark && !wg->enable_memory_overcommit()) { + if (is_low_watermark && !wg->enable_memory_overcommit()) { wg->enable_write_buffer_limit(true); } // Both enable overcommit and not enable overcommit, if user set slot memory policy @@ -767,7 +767,7 @@ void WorkloadGroupMgr::update_queries_limit_(WorkloadGroupPtr wg, bool enable_ha ? (int64_t)((wg_high_water_mark_except_load + total_used_slot_count) * query_ctx->get_slot_count() * 1.0 / total_used_slot_count) : wg_high_water_mark_except_load; - if (!is_low_wartermark && !enable_hard_limit) { + if (!is_low_watermark && !enable_hard_limit) { query_weighted_mem_limit = wg_high_water_mark_except_load; } else { query_weighted_mem_limit = expected_query_weighted_mem_limit; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org