You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "yiguolei (via GitHub)" <gi...@apache.org> on 2024/09/10 07:44:53 UTC

[PR] move paused query and handle logic to workload group manager [doris]

yiguolei opened a new pull request, #40603:
URL: https://github.com/apache/doris/pull/40603

   ## Proposed changes
   
   Issue Number: close #xxx
   
   <!--Describe your changes.-->
   
   


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] move paused query and handle logic to workload group manager [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #40603:
URL: https://github.com/apache/doris/pull/40603#discussion_r1751446698


##########
be/src/runtime/workload_group/workload_group_manager.cpp:
##########
@@ -291,6 +296,158 @@ void WorkloadGroupMgr::get_wg_resource_usage(vectorized::Block* block) {
     }
 }
 
+void WorkloadGroupMgr::add_paused_query(const std::shared_ptr<QueryContext>& query_ctx) {
+    std::lock_guard<std::mutex> lock(_paused_queries_lock);
+    DCHECK(query_ctx != nullptr);
+    auto wg = query_ctx->workload_group();
+    auto&& [it, inserted] = _paused_queries_list[wg].emplace(query_ctx);
+    if (inserted) {
+        LOG(INFO) << "here insert one new paused query: " << it->query_id()
+                  << ", wg: " << (void*)(wg.get());
+    }
+}
+
+/**
+ * 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 WorkloadGroupMgr::handle_paused_queries() {

Review Comment:
   warning: function 'handle_paused_queries' exceeds recommended size/complexity thresholds [readability-function-size]
   ```cpp
   void WorkloadGroupMgr::handle_paused_queries() {
                          ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/runtime/workload_group/workload_group_manager.cpp:316:** 132 lines including whitespace and comments (threshold 80)
   ```cpp
   void WorkloadGroupMgr::handle_paused_queries() {
                          ^
   ```
   
   </details>
   



-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] move paused query and handle logic to workload group manager [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #40603:
URL: https://github.com/apache/doris/pull/40603#issuecomment-2339912409

   Thank you for your contribution to Apache Doris.
   Don't know what should be done next? See [How to process your PR](https://cwiki.apache.org/confluence/display/DORIS/How+to+process+your+PR)
   
   Since 2024-03-18, the Document has been moved to [doris-website](https://github.com/apache/doris-website).
   See [Doris Document](https://cwiki.apache.org/confluence/display/DORIS/Doris+Document).


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] move paused query and handle logic to workload group manager [doris]

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei merged PR #40603:
URL: https://github.com/apache/doris/pull/40603


-- 
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-unsubscribe@doris.apache.org

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


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