Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature](executor) support Workload Move Action in BE #28918

Closed
wants to merge 1 commit into from

Conversation

wangbo
Copy link
Contributor

@wangbo wangbo commented Dec 23, 2023

Proposed changes

support Workload Move Action in BE

@wangbo
Copy link
Contributor Author

wangbo commented Dec 23, 2023

run buildall

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions


#pragma once

#include <glog/logging.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'glog/logging.h' file not found [clang-diagnostic-error]

#include <glog/logging.h>
         ^

namespace doris {
class WorkloadMoveActionListener : public TopicListener {
public:
~WorkloadMoveActionListener() {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use '= default' to define a trivial destructor [modernize-use-equals-default]

Suggested change
~WorkloadMoveActionListener() {}
~WorkloadMoveActionListener() = default;

@@ -93,6 +93,10 @@ class TaskScheduler {

TaskQueue* task_queue() const { return _task_queue.get(); }

void set_wg_id(uint64_t wg_id) { this->_wg_id = wg_id; }

uint64_t get_wg_id() { return _wg_id; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: method 'get_wg_id' can be made const [readability-make-member-function-const]

Suggested change
uint64_t get_wg_id() { return _wg_id; }
uint64_t get_wg_id() const { return _wg_id; }

@@ -153,6 +153,15 @@ class FragmentMgr : public RestMonitorIface {

std::string dump_pipeline_tasks();

void get_query_ctx_by_query_id(TUniqueId query_id,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: method 'get_query_ctx_by_query_id' can be made static [readability-convert-member-functions-to-static]

Suggested change
void get_query_ctx_by_query_id(TUniqueId query_id,
static void get_query_ctx_by_query_id(TUniqueId query_id,

_task_group = tg;
}

taskgroup::TaskGroup* get_task_group() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: method 'get_task_group' can be made static [readability-convert-member-functions-to-static]

Suggested change
taskgroup::TaskGroup* get_task_group() {
static taskgroup::TaskGroup* get_task_group() {

}

vectorized::SimplifiedScanScheduler* get_scan_scheduler() { return _scan_task_scheduler; }
vectorized::SimplifiedScanScheduler* get_scan_scheduler() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: method 'get_scan_scheduler' can be made static [readability-convert-member-functions-to-static]

Suggested change
vectorized::SimplifiedScanScheduler* get_scan_scheduler() {
static vectorized::SimplifiedScanScheduler* get_scan_scheduler() {

@@ -237,6 +238,21 @@ void TaskGroupManager::delete_task_group_by_ids(std::set<uint64_t> used_wg_id) {
LOG(INFO) << "finish clear unused cgroup path";
}

bool TaskGroupManager::migrate_memory_tracker_to_group(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: method 'migrate_memory_tracker_to_group' can be made static [readability-convert-member-functions-to-static]

be/src/runtime/task_group/task_group_manager.h:81:

-     bool migrate_memory_tracker_to_group(std::shared_ptr<MemTrackerLimiter> mem_tracker,
+     static bool migrate_memory_tracker_to_group(std::shared_ptr<MemTrackerLimiter> mem_tracker,

std::lock_guard<std::shared_mutex> write_lock(_group_mutex);
if (_task_groups.find(src_group_id) == _task_groups.end() ||
_task_groups.find(dst_group_id) == _task_groups.end()) {
return false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: redundant boolean literal in conditional return statement [readability-simplify-boolean-expr]

be/src/runtime/task_group/task_group_manager.cpp:244:

-     if (_task_groups.find(src_group_id) == _task_groups.end() ||
-         _task_groups.find(dst_group_id) == _task_groups.end()) {
-         return false;
-     }
-     _task_groups[src_group_id]->remove_mem_tracker_limiter(mem_tracker);
-     *dst_group_ptr = _task_groups[dst_group_id];
-     (*dst_group_ptr)->add_mem_tracker_limiter(mem_tracker);
- 
-     return true;
+     return !_task_groups.find(src_group_id) == _task_groups.end() ||
+         _task_groups.find(dst_group_id) == _task_groups.end();


return true;
}

void TaskGroupManager::stop() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: method 'reset_query_ctx_scan_scheduler' can be made static [readability-convert-member-functions-to-static]

be/src/runtime/task_group/task_group_manager.h:85:

-     void reset_query_ctx_scan_scheduler(QueryContext* query_ctx, uint64_t dst_group_id);
+     static void reset_query_ctx_scan_scheduler(QueryContext* query_ctx, uint64_t dst_group_id);

@@ -71,15 +71,27 @@ class TaskGroupManager {
// doris task group only support cpu soft limit
bool enable_cgroup() { return enable_cpu_hard_limit() || config::enable_cgroup_cpu_soft_limit; }

pipeline::TaskQueue* get_task_queue_by_id(uint64_t group_id) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: method 'get_task_queue_by_id' can be made static [readability-convert-member-functions-to-static]

Suggested change
pipeline::TaskQueue* get_task_queue_by_id(uint64_t group_id) {
static pipeline::TaskQueue* get_task_queue_by_id(uint64_t group_id) {

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 36.58% (8550/23371)
Line Coverage: 28.66% (69530/242571)
Region Coverage: 27.66% (35948/129979)
Branch Coverage: 24.39% (18378/75350)
Coverage Report: http://coverage.selectdb-in.cc/coverage/19d0ebb79f40c571ede6e64dcf10e99ea4523f07_19d0ebb79f40c571ede6e64dcf10e99ea4523f07/report/index.html

@wangbo
Copy link
Contributor Author

wangbo commented Dec 24, 2023

run buildall

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 36.59% (8552/23370)
Line Coverage: 28.67% (69549/242574)
Region Coverage: 27.67% (35969/129976)
Branch Coverage: 24.40% (18383/75348)
Coverage Report: http://coverage.selectdb-in.cc/coverage/e06c2e0911e609893d1b1f76711640a1ce6c2ed6_e06c2e0911e609893d1b1f76711640a1ce6c2ed6/report/index.html

@wangbo wangbo closed this Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants