You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/10/09 09:01:36 UTC

[GitHub] [doris] yixiutt opened a new pull request, #13219: [compaction](http_action) enable be run manual compaction concurrently

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

   In some case, we need to run manual compaction via http interface concurrently, we remove the mutex and tablet's compaction lock is enough to prevent concurrent compaction in tablet.
   
   # Proposed changes
   
   Issue Number: close #xxx
   
   ## Problem summary
   
   Describe your changes.
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: 
       - [ ] Yes
       - [ ] No
       - [ ] I don't know
   2. Has unit tests been added:
       - [ ] Yes
       - [ ] No
       - [ ] No Need
   3. Has document been added or modified:
       - [ ] Yes
       - [ ] No
       - [ ] No Need
   4. Does it need to update dependencies:
       - [ ] Yes
       - [ ] No
   5. Are there any changes that cannot be rolled back:
       - [ ] Yes (If Yes, please explain WHY)
       - [ ] No
   
   ## 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] github-actions[bot] commented on pull request #13219: [compaction](http_action) enable be run manual compaction concurrently

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #13219:
URL: https://github.com/apache/doris/pull/13219#issuecomment-1272494429

   PR approved by at least one committer and no changes requested.


-- 
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] yiguolei merged pull request #13219: [compaction](http_action) enable be run manual compaction concurrently

Posted by GitBox <gi...@apache.org>.
yiguolei merged PR #13219:
URL: https://github.com/apache/doris/pull/13219


-- 
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] yixiutt commented on a diff in pull request #13219: [compaction](http_action) enable be run manual compaction concurrently

Posted by GitBox <gi...@apache.org>.
yixiutt commented on code in PR #13219:
URL: https://github.com/apache/doris/pull/13219#discussion_r990763061


##########
be/src/http/action/compaction_action.cpp:
##########
@@ -94,18 +91,7 @@ Status CompactionAction::_handle_run_compaction(HttpRequest* req, std::string* j
         return _execute_compaction_callback(tablet, compaction_type);
     });
     std::future<Status> future_obj = task.get_future();
-
-    {
-        // 3.1 check is there compaction running
-        std::lock_guard<std::mutex> lock(_compaction_running_mutex);
-        if (_is_compaction_running) {
-            return Status::TooManyTasks("Manual compaction task is running");
-        } else {
-            // 3.2 execute the compaction task and set compaction task running
-            _is_compaction_running = true;
-            std::thread(std::move(task)).detach();
-        }
-    }
+    std::thread(std::move(task)).detach();

Review Comment:
   Parallel run case may fail if we add a limit here。 And this interface should not expose to users but we use it internal, so, it's controllable。



-- 
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] zhannngchen commented on pull request #13219: [compaction](http_action) enable be run manual compaction concurrently

Posted by GitBox <gi...@apache.org>.
zhannngchen commented on PR #13219:
URL: https://github.com/apache/doris/pull/13219#issuecomment-1272503022

   use `_push_tablet_into_submitted_compaction` and `_pop_tablet_into_submitted_compaction` instead? Is there any problem if we allow many compaction task of same type for same tablet running at the same time? Note that `_cumulative_compaction_lock` is hold separately during prepare phase and execute phase


-- 
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 #13219: [compaction](http_action) enable be run manual compaction concurrently

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #13219:
URL: https://github.com/apache/doris/pull/13219#issuecomment-1272494436

   PR approved by anyone and no changes requested.


-- 
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] gavinchou commented on a diff in pull request #13219: [compaction](http_action) enable be run manual compaction concurrently

Posted by GitBox <gi...@apache.org>.
gavinchou commented on code in PR #13219:
URL: https://github.com/apache/doris/pull/13219#discussion_r990761883


##########
be/src/http/action/compaction_action.cpp:
##########
@@ -94,18 +91,7 @@ Status CompactionAction::_handle_run_compaction(HttpRequest* req, std::string* j
         return _execute_compaction_callback(tablet, compaction_type);
     });
     std::future<Status> future_obj = task.get_future();
-
-    {
-        // 3.1 check is there compaction running
-        std::lock_guard<std::mutex> lock(_compaction_running_mutex);
-        if (_is_compaction_running) {
-            return Status::TooManyTasks("Manual compaction task is running");
-        } else {
-            // 3.2 execute the compaction task and set compaction task running
-            _is_compaction_running = true;
-            std::thread(std::move(task)).detach();
-        }
-    }
+    std::thread(std::move(task)).detach();

Review Comment:
   Should we set a limit to it? e.g. count the number of running compaction, and limit with it.
   ```
       std::packaged_task<Status()> task([this, tablet, compaction_type]() {
           ++static_cnt;
           std::shared_ptr<void> defer_cnt(nullptr, [](...) { --static_cnt; });
           return _execute_compaction_callback(tablet, compaction_type);
       });
   ```



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