Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
Doris-Extras committed Sep 24, 2024
1 parent 18494c1 commit ac8f7e6
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions be/src/runtime/workload_group/workload_group_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ void WorkloadGroupMgr::refresh_wg_weighted_memory_limit() {
if (!is_low_wartermark && wg.second->memory_sufficent()) {
query_weighted_mem_limit = wg_high_water_mark_limit;
} else {
query_weighted_mem_limit =
query_ctx->query_weighted_mem_limit =
total_used_slot_count > 0
? (int64_t)((wg_high_water_mark_limit + total_used_slot_count) *
query_ctx->get_slot_count() * 1.0 /
Expand Down Expand Up @@ -335,17 +335,17 @@ void WorkloadGroupMgr::add_paused_query(const std::shared_ptr<QueryContext>& que
auto&& [it, inserted] = _paused_queries_list[wg].emplace(
query_ctx, doris::GlobalMemoryArbitrator::last_affected_cache_capacity_adjust_weighted);
if (inserted) {
LOG(INFO) << "here insert one new paused query: " << it->query_id()
<< ", wg: " << (void*)(wg.get());
LOG(INFO) << "workload group " << wg->debug_string()
<< " insert one new paused query: " << it->query_id();
}
}

/**
* Strategy 1: A revocable query should not have any running task(PipelineTask).
* strategy 2: If the workload group is below low water mark, we make all queries in this wg runnable.
* strategy 3: Pick the query which has the max revocable size to revoke memory.
* strategy 4: If all queries are not revocable and they all have not any running task,
* we choose the max memory usage query to cancel.
* strategy 2: If the workload group has any task exceed workload group memlimit, then set all queryctx's memlimit
* strategy 3: If any query exceed process memlimit, then should clear all caches.
* strategy 4: If any query exceed query's memlimit, then do spill disk or cancel it.
* strategy 5: If any query exceed process's memlimit and cache is zero, then do spill disk or cancel it.
*/
void WorkloadGroupMgr::handle_paused_queries() {
std::unique_lock<std::mutex> lock(_paused_queries_lock);
Expand Down Expand Up @@ -444,6 +444,9 @@ void WorkloadGroupMgr::handle_paused_queries() {
++query_it;
}
}

// Finished deal with one workload group, and should deal with next one.
++it;
}
}

Expand Down

0 comments on commit ac8f7e6

Please sign in to comment.