This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 38294b98db Fix comparator of ResouceGroupSet (#19523)
38294b98db is described below
commit 38294b98db755c4b6ee58a73777eed55d2eaca1d
Author: wangbo <[email protected]>
AuthorDate: Sat May 13 09:17:16 2023 +0800
Fix comparator of ResouceGroupSet (#19523)
---
be/src/pipeline/task_queue.cpp | 4 ++--
be/src/runtime/task_group/task_group.cpp | 4 ++++
be/src/runtime/task_group/task_group.h | 2 ++
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/be/src/pipeline/task_queue.cpp b/be/src/pipeline/task_queue.cpp
index 7ad69bfa21..8078d7b414 100644
--- a/be/src/pipeline/task_queue.cpp
+++ b/be/src/pipeline/task_queue.cpp
@@ -213,9 +213,9 @@ bool
TaskGroupTaskQueue::TaskGroupSchedEntityComparator::operator()(
auto l_share = lhs_ptr->cpu_share();
auto r_share = rhs_ptr->cpu_share();
if (l_share != r_share) {
- return l_share < rhs_val;
+ return l_share < r_share;
} else {
- return lhs_ptr < rhs_ptr;
+ return lhs_ptr->task_group_id() < rhs_ptr->task_group_id();
}
}
}
diff --git a/be/src/runtime/task_group/task_group.cpp
b/be/src/runtime/task_group/task_group.cpp
index ea3a453d9c..ebe775a485 100644
--- a/be/src/runtime/task_group/task_group.cpp
+++ b/be/src/runtime/task_group/task_group.cpp
@@ -58,6 +58,10 @@ uint64_t TaskGroupEntity::cpu_share() const {
return _tg->cpu_share();
}
+uint64_t TaskGroupEntity::task_group_id() const {
+ return _tg->id();
+}
+
std::string TaskGroupEntity::debug_string() const {
return fmt::format("TGE[id = {}, cpu_share = {}, task size: {},
v_time:{}ns]", _tg->id(),
cpu_share(), _queue.size(), _vruntime_ns);
diff --git a/be/src/runtime/task_group/task_group.h
b/be/src/runtime/task_group/task_group.h
index 9a3aa117c7..e66ef2e1b0 100644
--- a/be/src/runtime/task_group/task_group.h
+++ b/be/src/runtime/task_group/task_group.h
@@ -61,6 +61,8 @@ public:
std::string debug_string() const;
+ uint64_t task_group_id() const;
+
private:
// TODO pipeline use MLFQ
std::queue<pipeline::PipelineTask*> _queue;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]