Skip to content

Commit

Permalink
[branch-3.0]Reset workload group's default value (#43942) (#45393)
Browse files Browse the repository at this point in the history
pick #43942
  • Loading branch information
wangbo authored Dec 13, 2024
1 parent bf57dde commit 0f95d59
Show file tree
Hide file tree
Showing 6 changed files with 288 additions and 180 deletions.
12 changes: 7 additions & 5 deletions be/src/runtime/workload_group/workload_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,19 +342,19 @@ WorkloadGroupInfo WorkloadGroupInfo::parse_topic_info(

// 4 cpu_share
uint64_t cpu_share = CgroupCpuCtl::cpu_soft_limit_default_value();
if (tworkload_group_info.__isset.cpu_share) {
if (tworkload_group_info.__isset.cpu_share && tworkload_group_info.cpu_share > 0) {
cpu_share = tworkload_group_info.cpu_share;
}

// 5 cpu hard limit
int cpu_hard_limit = CPU_HARD_LIMIT_DEFAULT_VALUE;
if (tworkload_group_info.__isset.cpu_hard_limit) {
if (tworkload_group_info.__isset.cpu_hard_limit && tworkload_group_info.cpu_hard_limit > 0) {
cpu_hard_limit = tworkload_group_info.cpu_hard_limit;
}

// 6 mem_limit
std::string mem_limit_str = MEMORY_LIMIT_DEFAULT_VALUE;
if (tworkload_group_info.__isset.mem_limit) {
if (tworkload_group_info.__isset.mem_limit && tworkload_group_info.mem_limit != "-1") {
mem_limit_str = tworkload_group_info.mem_limit;
}
bool is_percent = true;
Expand Down Expand Up @@ -407,13 +407,15 @@ WorkloadGroupInfo WorkloadGroupInfo::parse_topic_info(

// 14 scan io
int read_bytes_per_second = -1;
if (tworkload_group_info.__isset.read_bytes_per_second) {
if (tworkload_group_info.__isset.read_bytes_per_second &&
tworkload_group_info.read_bytes_per_second > 0) {
read_bytes_per_second = tworkload_group_info.read_bytes_per_second;
}

// 15 remote scan io
int remote_read_bytes_per_second = -1;
if (tworkload_group_info.__isset.remote_read_bytes_per_second) {
if (tworkload_group_info.__isset.remote_read_bytes_per_second &&
tworkload_group_info.remote_read_bytes_per_second > 0) {
remote_read_bytes_per_second = tworkload_group_info.remote_read_bytes_per_second;
}

Expand Down
Loading

0 comments on commit 0f95d59

Please sign in to comment.