github-actions[bot] commented on code in PR #39883:
URL: https://github.com/apache/doris/pull/39883#discussion_r1729996690


##########
be/src/pipeline/task_scheduler.cpp:
##########
@@ -187,15 +195,170 @@ void TaskScheduler::_do_work(size_t index) {
     }
 }
 
+void TaskScheduler::add_paused_task(PipelineTask* task) {
+    std::lock_guard<std::mutex> lock(_paused_queries_lock);
+    auto query_ctx_sptr = 
task->runtime_state()->get_query_ctx()->shared_from_this();
+    DCHECK(query_ctx_sptr != nullptr);
+    auto wg = query_ctx_sptr->workload_group();
+    _paused_queries_list[wg].emplace(std::move(query_ctx_sptr));
+    _paused_queries_cv.notify_all();
+}
+
+/**
+ * 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.
+ */
+void TaskScheduler::_paused_queries_handler() {

Review Comment:
   warning: function '_paused_queries_handler' exceeds recommended 
size/complexity thresholds [readability-function-size]
   ```cpp
    */
                           ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/pipeline/task_scheduler.cpp:213:** 138 lines including whitespace 
and comments (threshold 80)
   ```cpp
    */
                           ^
   ```
   
   </details>
   



##########
be/src/pipeline/exec/hashjoin_build_sink.cpp:
##########
@@ -110,6 +110,37 @@ Status HashJoinBuildSinkLocalState::open(RuntimeState* 
state) {
     return Status::OK();
 }
 
+size_t HashJoinBuildSinkLocalState::get_reserve_mem_size(RuntimeState* state) {

Review Comment:
   warning: method 'get_reserve_mem_size' can be made const 
[readability-make-member-function-const]
   
   be/src/pipeline/exec/hashjoin_build_sink.h:56:
   ```diff
   -     [[nodiscard]] size_t get_reserve_mem_size(RuntimeState* state);
   +     [[nodiscard]] size_t get_reserve_mem_size(RuntimeState* state) const;
   ```
   
   ```suggestion
   size_t HashJoinBuildSinkLocalState::get_reserve_mem_size(RuntimeState* 
state) const {
   ```
   



##########
be/src/pipeline/exec/operator.h:
##########
@@ -20,6 +20,7 @@
 #include <fmt/format.h>

Review Comment:
   warning: 'fmt/format.h' file not found [clang-diagnostic-error]
   ```cpp
   #include <fmt/format.h>
            ^
   ```
   



##########
be/src/vec/exprs/vexpr_context.h:
##########
@@ -19,6 +19,8 @@
 
 #include <glog/logging.h>

Review Comment:
   warning: 'glog/logging.h' file not found [clang-diagnostic-error]
   ```cpp
   #include <glog/logging.h>
            ^
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to