You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "TangSiyang2001 (via GitHub)" <gi...@apache.org> on 2023/04/14 15:19:59 UTC

[GitHub] [doris] TangSiyang2001 opened a new pull request, #18691: [enhancement] make agent batch task是、 cancel cancelable in BE

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

   # Proposed changes
   
   Issue Number: close #xxx
   
   ## Problem summary
   
   Describe your changes.
   
   ## Checklist(Required)
   
   * [ ] Does it affect the original behavior
   * [ ] Has unit tests been added
   * [ ] Has document been added or modified
   * [ ] Does it need to update dependencies
   * [ ] Is this PR support rollback (If NO, please explain WHY)
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   run buildall


-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   run buildall


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   run p0


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement] make agent batch tasks cancelable in BE

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

   run buildall


-- 
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


[GitHub] [doris] TangSiyang2001 commented on a diff in pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

Posted by "TangSiyang2001 (via GitHub)" <gi...@apache.org>.
TangSiyang2001 commented on code in PR #18691:
URL: https://github.com/apache/doris/pull/18691#discussion_r1172029988


##########
fe/fe-core/src/main/java/org/apache/doris/task/AgentBatchTask.java:
##########
@@ -50,23 +51,35 @@
 import com.google.common.collect.Lists;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
+import org.apache.thrift.TException;
 
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.function.BiFunction;
 
 /*
  * This class group tasks by backend
  */
 public class AgentBatchTask implements Runnable {
     private static final Logger LOG = LogManager.getLogger(AgentBatchTask.class);
 
+    /**
+     * for tracing this batch task
+     */
+    private final long batchId;
+
     // backendId -> AgentTask List
-    private Map<Long, List<AgentTask>> backendIdToTasks;
+    private final Map<Long, List<AgentTask>> backendIdToTasks;
 
     public AgentBatchTask() {
-        this.backendIdToTasks = new HashMap<Long, List<AgentTask>>();
+        if (FeConstants.runningUnitTest) {
+            this.batchId = 1L;

Review Comment:
   > I wouldn't recommend it if it's just for UT.
   > This can be done by way of mocks without intruding into the code.
   
   Actually BackupJobTest.java encountered exception without this way, it seems to be caused by calling `Env.getCurrentEnv().getNextId();` in ut environment, where getCurrentEnv() seems to return null. Is there a way can resolve the problem during mocks?



-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   run buildall


-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   run buildall


-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement] make agent batch tasks cancelable in BE

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

   run buildall


-- 
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] [enhancement-wip](schema-change) make agent batch tasks cancelable in BE [doris]

Posted by "TangSiyang2001 (via GitHub)" <gi...@apache.org>.
TangSiyang2001 closed pull request #18691: [enhancement-wip](schema-change) make agent batch tasks cancelable in BE
URL: https://github.com/apache/doris/pull/18691


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement] make agent batch tasks cancelable in BE

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

   run buildall


-- 
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


[GitHub] [doris] CalvinKirs commented on a diff in pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

Posted by "CalvinKirs (via GitHub)" <gi...@apache.org>.
CalvinKirs commented on code in PR #18691:
URL: https://github.com/apache/doris/pull/18691#discussion_r1172008764


##########
fe/fe-core/src/main/java/org/apache/doris/task/AgentBatchTask.java:
##########
@@ -50,23 +51,35 @@
 import com.google.common.collect.Lists;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
+import org.apache.thrift.TException;
 
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.function.BiFunction;
 
 /*
  * This class group tasks by backend
  */
 public class AgentBatchTask implements Runnable {
     private static final Logger LOG = LogManager.getLogger(AgentBatchTask.class);
 
+    /**
+     * for tracing this batch task
+     */
+    private final long batchId;
+
     // backendId -> AgentTask List
-    private Map<Long, List<AgentTask>> backendIdToTasks;
+    private final Map<Long, List<AgentTask>> backendIdToTasks;
 
     public AgentBatchTask() {
-        this.backendIdToTasks = new HashMap<Long, List<AgentTask>>();
+        if (FeConstants.runningUnitTest) {
+            this.batchId = 1L;

Review Comment:
   I wouldn't recommend it if it's just for UT.
   This can be done by way of mocks without intruding into the code.



-- 
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


[GitHub] [doris] TangSiyang2001 commented on a diff in pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

Posted by "TangSiyang2001 (via GitHub)" <gi...@apache.org>.
TangSiyang2001 commented on code in PR #18691:
URL: https://github.com/apache/doris/pull/18691#discussion_r1172515010


##########
fe/fe-core/src/main/java/org/apache/doris/task/AgentBatchTask.java:
##########
@@ -50,23 +51,35 @@
 import com.google.common.collect.Lists;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
+import org.apache.thrift.TException;
 
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.function.BiFunction;
 
 /*
  * This class group tasks by backend
  */
 public class AgentBatchTask implements Runnable {
     private static final Logger LOG = LogManager.getLogger(AgentBatchTask.class);
 
+    /**
+     * for tracing this batch task
+     */
+    private final long batchId;
+
     // backendId -> AgentTask List
-    private Map<Long, List<AgentTask>> backendIdToTasks;
+    private final Map<Long, List<AgentTask>> backendIdToTasks;
 
     public AgentBatchTask() {
-        this.backendIdToTasks = new HashMap<Long, List<AgentTask>>();
+        if (FeConstants.runningUnitTest) {
+            this.batchId = 1L;

Review Comment:
   I 've found out a better way to do the corresponding mock



-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #18691: [enhancement] make agent batch tasks cancelable in BE

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

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   run buildall


-- 
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


[GitHub] [doris] github-actions[bot] commented on a diff in pull request #18691: [enhancement] make agent batch tasks cancelable in BE

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


##########
be/src/agent/task_worker_pool.cpp:
##########
@@ -592,12 +602,33 @@ void TaskWorkerPool::_alter_tablet_worker_thread_callback() {
         TAgentTaskRequest agent_task_req;
         {
             std::unique_lock<std::mutex> worker_thread_lock(_worker_thread_lock);
+            agent_task_req = _tasks.front();
+            {
+                // check if the task has been removed
+                std::unique_lock<std::mutex> cancel_lock(_cancel_lock);
+                auto it = _cancel_set.find(agent_task_req.batch_id);
+                if (it != _cancel_set.end()) {
+                    _tasks.pop_front();
+                    _remove_task_info(agent_task_req.task_type, agent_task_req.signature);
+                    LOG(INFO) << "alter table task is successfully canceled, signature: "
+                              << agent_task_req.signature;
+                    // because cancel behavior is relatively rare,
+                    // it does no harm that we do this scaning check here
+                    if (std::count_if(_tasks.begin(), _tasks.end(),
+                                      [this](const TAgentTaskRequest& req) {

Review Comment:
   warning: lambda capture 'this' is not used [clang-diagnostic-unused-lambda-capture]
   
   ```suggestion
                                         [](const TAgentTaskRequest& req) {
   ```
   



##########
be/src/agent/task_worker_pool.cpp:
##########
@@ -592,12 +602,33 @@
         TAgentTaskRequest agent_task_req;
         {
             std::unique_lock<std::mutex> worker_thread_lock(_worker_thread_lock);
+            agent_task_req = _tasks.front();
+            {
+                // check if the task has been removed
+                std::unique_lock<std::mutex> cancel_lock(_cancel_lock);
+                auto it = _cancel_set.find(agent_task_req.batch_id);
+                if (it != _cancel_set.end()) {
+                    _tasks.pop_front();
+                    _remove_task_info(agent_task_req.task_type, agent_task_req.signature);
+                    LOG(INFO) << "alter table task is successfully canceled, signature: "
+                              << agent_task_req.signature;
+                    // because cancel behavior is relatively rare,
+                    // it does no harm that we do this scaning check here
+                    if (std::count_if(_tasks.begin(), _tasks.end(),
+                                      [this](const TAgentTaskRequest& req) {
+                                          return req.batch_id == agent_task_req.batch_id;

Review Comment:
   warning: variable 'agent_task_req' cannot be implicitly captured in a lambda with no capture-default specified [clang-diagnostic-error]
   ```cpp
                                             return req.batch_id == agent_task_req.batch_id;
                                                                    ^
   ```
   **be/src/agent/task_worker_pool.cpp:601:** 'agent_task_req' declared here
   ```cpp
           TAgentTaskRequest agent_task_req;
                             ^
   ```
   **be/src/agent/task_worker_pool.cpp:617:** lambda expression begins here
   ```cpp
                                         [this](const TAgentTaskRequest& req) {
                                         ^
   ```
   **be/src/agent/task_worker_pool.cpp:617:** capture 'agent_task_req' by value
   ```cpp
                                         [this](const TAgentTaskRequest& req) {
                                              ^
   ```
   **be/src/agent/task_worker_pool.cpp:617:** capture 'agent_task_req' by reference
   ```cpp
                                         [this](const TAgentTaskRequest& req) {
                                              ^
   ```
   **be/src/agent/task_worker_pool.cpp:617:** default capture by reference
   ```cpp
                                         [this](const TAgentTaskRequest& req) {
                                          ^
   ```
   



-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement] make agent batch tasks cancelable in BE

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

   run buildall


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   run buildall


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement] make agent batch tasks cancelable in BE

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

   run buildall


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement] make agent batch tasks cancelable in BE

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

   run buildall


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   run p1


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   run p0


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   run beut


-- 
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] [enhancement-wip](schema-change) make agent batch tasks cancelable in BE [doris]

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

   We're closing this PR because it hasn't been updated in a while.
   This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
   If you'd like to revive this PR, please reopen it and feel free a maintainer to remove the Stale tag!


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement] make agent batch tasks cancelable in BE

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

   run buildall


-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #18691: [enhancement] make agent batch tasks cancelable in BE

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

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   run clickbench


-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #18691: [enhancement] make agent batch tasks cancelable in BE

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

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   run p0


-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #18691: [enhancement] make agent batch tasks cancelable in BE

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

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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


[GitHub] [doris] github-actions[bot] commented on a diff in pull request #18691: [enhancement] make agent batch tasks cancelable in BE

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


##########
be/src/agent/task_worker_pool.cpp:
##########
@@ -269,6 +274,11 @@ void TaskWorkerPool::notify_thread() {
     VLOG_CRITICAL << "notify task worker pool: " << _name;
 }
 
+void TaskWorkerPool::cancel_batch_task(int64_t batch_id) {
+    std::shared_lock<std::mutex> cancel_lock(_cancel_lock);

Review Comment:
   warning: no matching constructor for initialization of 'std::shared_lock<std::mutex>' [clang-diagnostic-error]
   ```cpp
       std::shared_lock<std::mutex> cancel_lock(_cancel_lock);
                                    ^
   ```
   **/usr/include/c++/11/shared_mutex:724:** candidate constructor not viable: no known conversion from 'std::shared_mutex' to 'std::shared_lock<std::mutex>::mutex_type &' (aka 'std::mutex &') for 1st argument
   ```cpp
         shared_lock(mutex_type& __m)
         ^
   ```
   **/usr/include/c++/11/shared_mutex:755:** candidate constructor not viable: no known conversion from 'std::shared_mutex' to 'const std::shared_lock<std::mutex>' for 1st argument
   ```cpp
         shared_lock(shared_lock const&) = delete;
         ^
   ```
   **/usr/include/c++/11/shared_mutex:758:** candidate constructor not viable: no known conversion from 'std::shared_mutex' to 'std::shared_lock<std::mutex>' for 1st argument
   ```cpp
         shared_lock(shared_lock&& __sl) noexcept : shared_lock()
         ^
   ```
   **/usr/include/c++/11/shared_mutex:721:** candidate constructor not viable: requires 0 arguments, but 1 was provided
   ```cpp
         shared_lock() noexcept : _M_pm(nullptr), _M_owns(false) { }
         ^
   ```
   **/usr/include/c++/11/shared_mutex:728:** candidate constructor not viable: requires 2 arguments, but 1 was provided
   ```cpp
         shared_lock(mutex_type& __m, defer_lock_t) noexcept
         ^
   ```
   **/usr/include/c++/11/shared_mutex:731:** candidate constructor not viable: requires 2 arguments, but 1 was provided
   ```cpp
         shared_lock(mutex_type& __m, try_to_lock_t)
         ^
   ```
   **/usr/include/c++/11/shared_mutex:734:** candidate constructor not viable: requires 2 arguments, but 1 was provided
   ```cpp
         shared_lock(mutex_type& __m, adopt_lock_t)
         ^
   ```
   **/usr/include/c++/11/shared_mutex:738:** candidate constructor template not viable: requires 2 arguments, but 1 was provided
   ```cpp
   	shared_lock(mutex_type& __m,
    ^
   ```
   **/usr/include/c++/11/shared_mutex:744:** candidate constructor template not viable: requires 2 arguments, but 1 was provided
   ```cpp
   	shared_lock(mutex_type& __m,
    ^
   ```
   



##########
be/src/agent/task_worker_pool.cpp:
##########
@@ -597,9 +607,26 @@
             if (!_is_work) {
                 return;
             }
-
             agent_task_req = _tasks.front();
             _tasks.pop_front();
+            // check if the task has been removed
+            std::shared_lock<std::mutex> cancel_lock(_cancel_lock);

Review Comment:
   warning: no matching constructor for initialization of 'std::shared_lock<std::mutex>' [clang-diagnostic-error]
   ```cpp
               std::shared_lock<std::mutex> cancel_lock(_cancel_lock);
                                            ^
   ```
   **/usr/include/c++/11/shared_mutex:724:** candidate constructor not viable: no known conversion from 'std::shared_mutex' to 'std::shared_lock<std::mutex>::mutex_type &' (aka 'std::mutex &') for 1st argument
   ```cpp
         shared_lock(mutex_type& __m)
         ^
   ```
   **/usr/include/c++/11/shared_mutex:755:** candidate constructor not viable: no known conversion from 'std::shared_mutex' to 'const std::shared_lock<std::mutex>' for 1st argument
   ```cpp
         shared_lock(shared_lock const&) = delete;
         ^
   ```
   **/usr/include/c++/11/shared_mutex:758:** candidate constructor not viable: no known conversion from 'std::shared_mutex' to 'std::shared_lock<std::mutex>' for 1st argument
   ```cpp
         shared_lock(shared_lock&& __sl) noexcept : shared_lock()
         ^
   ```
   **/usr/include/c++/11/shared_mutex:721:** candidate constructor not viable: requires 0 arguments, but 1 was provided
   ```cpp
         shared_lock() noexcept : _M_pm(nullptr), _M_owns(false) { }
         ^
   ```
   **/usr/include/c++/11/shared_mutex:728:** candidate constructor not viable: requires 2 arguments, but 1 was provided
   ```cpp
         shared_lock(mutex_type& __m, defer_lock_t) noexcept
         ^
   ```
   **/usr/include/c++/11/shared_mutex:731:** candidate constructor not viable: requires 2 arguments, but 1 was provided
   ```cpp
         shared_lock(mutex_type& __m, try_to_lock_t)
         ^
   ```
   **/usr/include/c++/11/shared_mutex:734:** candidate constructor not viable: requires 2 arguments, but 1 was provided
   ```cpp
         shared_lock(mutex_type& __m, adopt_lock_t)
         ^
   ```
   **/usr/include/c++/11/shared_mutex:738:** candidate constructor template not viable: requires 2 arguments, but 1 was provided
   ```cpp
   	shared_lock(mutex_type& __m,
    ^
   ```
   **/usr/include/c++/11/shared_mutex:744:** candidate constructor template not viable: requires 2 arguments, but 1 was provided
   ```cpp
   	shared_lock(mutex_type& __m,
    ^
   ```
   



-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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


[GitHub] [doris] TangSiyang2001 commented on a diff in pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

Posted by "TangSiyang2001 (via GitHub)" <gi...@apache.org>.
TangSiyang2001 commented on code in PR #18691:
URL: https://github.com/apache/doris/pull/18691#discussion_r1172029988


##########
fe/fe-core/src/main/java/org/apache/doris/task/AgentBatchTask.java:
##########
@@ -50,23 +51,35 @@
 import com.google.common.collect.Lists;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
+import org.apache.thrift.TException;
 
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.function.BiFunction;
 
 /*
  * This class group tasks by backend
  */
 public class AgentBatchTask implements Runnable {
     private static final Logger LOG = LogManager.getLogger(AgentBatchTask.class);
 
+    /**
+     * for tracing this batch task
+     */
+    private final long batchId;
+
     // backendId -> AgentTask List
-    private Map<Long, List<AgentTask>> backendIdToTasks;
+    private final Map<Long, List<AgentTask>> backendIdToTasks;
 
     public AgentBatchTask() {
-        this.backendIdToTasks = new HashMap<Long, List<AgentTask>>();
+        if (FeConstants.runningUnitTest) {
+            this.batchId = 1L;

Review Comment:
   > I wouldn't recommend it if it's just for UT.
   > This can be done by way of mocks without intruding into the code.
   
   Actually BackupJobTest.java encountered exception without this way, it seems to be caused by calling `Env.getCurrentEnv().getNextId();` (failed to init SingletonHolder) in class AgentBatchTask in ut environment, where getCurrentEnv() seems to return null. Is there a way can resolve the problem during mocks?



-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   run arm


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   run p1


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement] make agent batch tasks cancelable in BE

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

   run buildall


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement] make agent batch tasks cancelable in BE

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

   run buildall


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   run p0


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement] make agent batch tasks cancelable in BE

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

   run buildall


-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #18691: [enhancement] make agent batch tasks cancelable in BE

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

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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


[GitHub] [doris] hello-stephen commented on pull request #18691: [enhancement] make agent batch tasks cancelable in BE

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

   TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 32.79 seconds
    stream load tsv:          431 seconds loaded 74807831229 Bytes, about 165 MB/s
    stream load json:         21 seconds loaded 2358488459 Bytes, about 107 MB/s
    stream load orc:          59 seconds loaded 1101869774 Bytes, about 17 MB/s
    stream load parquet:          31 seconds loaded 861443392 Bytes, about 26 MB/s
    https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20230414165745_clickbench_pr_129344.html


-- 
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


[GitHub] [doris] TangSiyang2001 commented on a diff in pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

Posted by "TangSiyang2001 (via GitHub)" <gi...@apache.org>.
TangSiyang2001 commented on code in PR #18691:
URL: https://github.com/apache/doris/pull/18691#discussion_r1172029988


##########
fe/fe-core/src/main/java/org/apache/doris/task/AgentBatchTask.java:
##########
@@ -50,23 +51,35 @@
 import com.google.common.collect.Lists;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
+import org.apache.thrift.TException;
 
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.function.BiFunction;
 
 /*
  * This class group tasks by backend
  */
 public class AgentBatchTask implements Runnable {
     private static final Logger LOG = LogManager.getLogger(AgentBatchTask.class);
 
+    /**
+     * for tracing this batch task
+     */
+    private final long batchId;
+
     // backendId -> AgentTask List
-    private Map<Long, List<AgentTask>> backendIdToTasks;
+    private final Map<Long, List<AgentTask>> backendIdToTasks;
 
     public AgentBatchTask() {
-        this.backendIdToTasks = new HashMap<Long, List<AgentTask>>();
+        if (FeConstants.runningUnitTest) {
+            this.batchId = 1L;

Review Comment:
   Actually BackupJobTest.java encountered exception without this way, it seems to be caused by calling `Env.getCurrentEnv().getNextId();` in ut environment, where getCurrentEnv() seems to return null. Is there a way can resolve the problem during mocks?



-- 
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


[GitHub] [doris] TangSiyang2001 commented on a diff in pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

Posted by "TangSiyang2001 (via GitHub)" <gi...@apache.org>.
TangSiyang2001 commented on code in PR #18691:
URL: https://github.com/apache/doris/pull/18691#discussion_r1172029988


##########
fe/fe-core/src/main/java/org/apache/doris/task/AgentBatchTask.java:
##########
@@ -50,23 +51,35 @@
 import com.google.common.collect.Lists;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
+import org.apache.thrift.TException;
 
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.function.BiFunction;
 
 /*
  * This class group tasks by backend
  */
 public class AgentBatchTask implements Runnable {
     private static final Logger LOG = LogManager.getLogger(AgentBatchTask.class);
 
+    /**
+     * for tracing this batch task
+     */
+    private final long batchId;
+
     // backendId -> AgentTask List
-    private Map<Long, List<AgentTask>> backendIdToTasks;
+    private final Map<Long, List<AgentTask>> backendIdToTasks;
 
     public AgentBatchTask() {
-        this.backendIdToTasks = new HashMap<Long, List<AgentTask>>();
+        if (FeConstants.runningUnitTest) {
+            this.batchId = 1L;

Review Comment:
   > I wouldn't recommend it if it's just for UT.
   > This can be done by way of mocks without intruding into the code.
   
   Actually BackupJobTest.java encountered exception without this way, it seems to be caused by calling `Env.getCurrentEnv().getNextId();` (failed to init SingletonHolder) in class AgentBatchTask in ut environment, where getCurrentEnv() seems to return null. Is there any way can resolve the problem during mocks?



-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #18691: [enhancement] make agent batch tasks cancelable in BE

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

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #18691: [enhancement] make agent batch tasks cancelable in BE

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

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #18691: [enhancement] make agent batch tasks cancelable in BE

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

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #18691: [enhancement] make agent batch tasks cancelable in BE

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

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   run buildall


-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   run p1


-- 
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


[GitHub] [doris] TangSiyang2001 commented on pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

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

   run arm


-- 
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


[GitHub] [doris] TangSiyang2001 commented on a diff in pull request #18691: [enhancement](agent-task/schema-change) make agent batch tasks cancelable in BE

Posted by "TangSiyang2001 (via GitHub)" <gi...@apache.org>.
TangSiyang2001 commented on code in PR #18691:
URL: https://github.com/apache/doris/pull/18691#discussion_r1172029988


##########
fe/fe-core/src/main/java/org/apache/doris/task/AgentBatchTask.java:
##########
@@ -50,23 +51,35 @@
 import com.google.common.collect.Lists;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
+import org.apache.thrift.TException;
 
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.function.BiFunction;
 
 /*
  * This class group tasks by backend
  */
 public class AgentBatchTask implements Runnable {
     private static final Logger LOG = LogManager.getLogger(AgentBatchTask.class);
 
+    /**
+     * for tracing this batch task
+     */
+    private final long batchId;
+
     // backendId -> AgentTask List
-    private Map<Long, List<AgentTask>> backendIdToTasks;
+    private final Map<Long, List<AgentTask>> backendIdToTasks;
 
     public AgentBatchTask() {
-        this.backendIdToTasks = new HashMap<Long, List<AgentTask>>();
+        if (FeConstants.runningUnitTest) {
+            this.batchId = 1L;

Review Comment:
   > I wouldn't recommend it if it's just for UT.
   > This can be done by way of mocks without intruding into the code.
   
   Actually BackupJobTest.java encountered exception without this way, it seems to be caused by calling `Env.getCurrentEnv().getNextId();` (failed to init SingletonHolder) in ut environment, where getCurrentEnv() seems to return null. Is there a way can resolve the problem during mocks?



-- 
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