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 2021/04/29 11:52:01 UTC

[GitHub] [incubator-doris] morningman opened a new pull request #5737: [Compaction] Modify compaction logic

morningman opened a new pull request #5737:
URL: https://github.com/apache/incubator-doris/pull/5737


   ## Proposed changes
   
   1. Add /api/compaction/run_status to show the running compaction tasks.
   2. Support do base and cumulative compaction for one tablet at same time.
   3. Modify some log level.
   4. Add a feedback document.
   
   ## Types of changes
   
   What types of changes does your code introduce to Doris?
   _Put an `x` in the boxes that apply_
   
   - [ ] Bugfix (non-breaking change which fixes an issue)
   - [ ] New feature (non-breaking change which adds functionality)
   - [X] Breaking change (fix or feature that would cause existing functionality to not work as expected)
   - [X] Documentation Update (if none of the other choices apply)
   - [ ] Code refactor (Modify the code structure, format the code, etc...)
   
   ## Checklist
   
   _Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._
   
   - [X] I have created an issue on (Fix #ISSUE) and described the bug/feature there in detail
   - [ ] Compiling and unit tests pass locally with my changes
   - [ ] I have added tests that prove my fix is effective or that my feature works
   - [ ] If these changes need document changes, I have updated the document
   - [ ] Any dependent changes have been merged
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at 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.

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] [incubator-doris] weizuo93 commented on a change in pull request #5737: [Compaction] Modify compaction logic

Posted by GitBox <gi...@apache.org>.
weizuo93 commented on a change in pull request #5737:
URL: https://github.com/apache/incubator-doris/pull/5737#discussion_r623570948



##########
File path: be/src/olap/storage_engine.cpp
##########
@@ -1035,4 +1035,76 @@ void StorageEngine::create_base_compaction(TabletSharedPtr best_tablet,
     base_compaction.reset(new BaseCompaction(best_tablet, tracker_label, _compaction_mem_tracker));
 }
 
+// Return json:
+// {
+//   "CumulativeCompaction": {
+//          "/home/disk1" : [10001, 10002],

Review comment:
       Can we add segment number that be merged in this compaction task for each thread or each disk? Of course, we could add the segment number info in another PR.




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

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] [incubator-doris] morningman commented on a change in pull request #5737: [Compaction] Modify compaction logic

Posted by GitBox <gi...@apache.org>.
morningman commented on a change in pull request #5737:
URL: https://github.com/apache/incubator-doris/pull/5737#discussion_r623572682



##########
File path: be/src/http/action/compaction_action.cpp
##########
@@ -155,59 +154,66 @@ Status CompactionAction::_handle_run_status_compaction(HttpRequest* req, std::st
     Status check_status = _check_param(req, &tablet_id, &schema_hash);
     RETURN_IF_ERROR(check_status);
 
-    // fetch the tablet by tablet_id and schema_hash
-    TabletSharedPtr tablet =
-            StorageEngine::instance()->tablet_manager()->get_tablet(tablet_id, schema_hash);
 
-    if (tablet == nullptr) {
-        LOG(WARNING) << "invalid argument.tablet_id:" << tablet_id
-                     << ", schema_hash:" << schema_hash;
-        return Status::InternalError(
-                strings::Substitute("fail to get $0, $1", tablet_id, schema_hash));
-    }
-
-    std::string json_template = R"({
-        "status" : "Success",
-        "run_status" : $0,
-        "msg" : "$1",
-        "tablet_id" : $2,
-        "schema_hash" : $3,
-        "compact_type" : "$4"
+    if (tablet_id == 0) {
+        // overall compaction status
+        RETURN_IF_ERROR(StorageEngine::instance()->get_compaction_status_json(json_result));
+        return Status::OK();
+    } else {
+        // fetch the tablet by tablet_id and schema_hash
+        TabletSharedPtr tablet =
+                StorageEngine::instance()->tablet_manager()->get_tablet(tablet_id, schema_hash);
+    
+        if (tablet == nullptr) {
+            LOG(WARNING) << "invalid argument.tablet_id:" << tablet_id
+                         << ", schema_hash:" << schema_hash;
+            return Status::InternalError(
+                    strings::Substitute("fail to get $0, $1", tablet_id, schema_hash));
+        }
+    
+        std::string json_template = R"({
+            "status" : "Success",
+            "run_status" : $0,
+            "msg" : "$1",
+            "tablet_id" : $2,
+            "schema_hash" : $3,
+            "compact_type" : "$4"
 })";
-
-    std::string msg = "this tablet_id is not running";
-    std::string compaction_type = "";
-    bool run_status = 0;
-
-    {
-        // use try lock to check this tablet is running cumulative compaction
-        MutexLock lock_cumulative(tablet->get_cumulative_lock(), TRY_LOCK);
-        if (!lock_cumulative.own_lock()) {
-            msg = "this tablet_id is running";
-            compaction_type = "cumulative";
-            run_status = 1;
-            *json_result = strings::Substitute(json_template, run_status, msg, tablet_id,
-                                               schema_hash, compaction_type);
-            return Status::OK();
+    
+        std::string msg = "this tablet_id is not running";

Review comment:
       ok




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

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] [incubator-doris] morningman commented on a change in pull request #5737: [Compaction] Modify compaction logic

Posted by GitBox <gi...@apache.org>.
morningman commented on a change in pull request #5737:
URL: https://github.com/apache/incubator-doris/pull/5737#discussion_r623570794



##########
File path: be/src/common/config.h
##########
@@ -283,8 +281,7 @@ CONF_mInt32(cumulative_compaction_skip_window_seconds, "30");
 CONF_mInt64(min_compaction_failure_interval_sec, "600"); // 10 min
 
 // This config can be set to limit thread number in compaction thread pool.
-CONF_mInt32(min_compaction_threads, "10");
-CONF_mInt32(max_compaction_threads, "10");
+CONF_Int32(max_compaction_threads, "10");

Review comment:
       It's OK for me~
   But I think the `min_compaction_threads` is meaning less for user, we should reduce unnecessary configuration items as much as possible




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

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] [incubator-doris] weizuo93 removed a comment on pull request #5737: [Compaction] Modify compaction logic

Posted by GitBox <gi...@apache.org>.
weizuo93 removed a comment on pull request #5737:
URL: https://github.com/apache/incubator-doris/pull/5737#issuecomment-829782926


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

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] [incubator-doris] weizuo93 commented on a change in pull request #5737: [Compaction] Modify compaction logic

Posted by GitBox <gi...@apache.org>.
weizuo93 commented on a change in pull request #5737:
URL: https://github.com/apache/incubator-doris/pull/5737#discussion_r623561076



##########
File path: be/src/http/action/compaction_action.cpp
##########
@@ -155,59 +154,66 @@ Status CompactionAction::_handle_run_status_compaction(HttpRequest* req, std::st
     Status check_status = _check_param(req, &tablet_id, &schema_hash);
     RETURN_IF_ERROR(check_status);
 
-    // fetch the tablet by tablet_id and schema_hash
-    TabletSharedPtr tablet =
-            StorageEngine::instance()->tablet_manager()->get_tablet(tablet_id, schema_hash);
 
-    if (tablet == nullptr) {
-        LOG(WARNING) << "invalid argument.tablet_id:" << tablet_id
-                     << ", schema_hash:" << schema_hash;
-        return Status::InternalError(
-                strings::Substitute("fail to get $0, $1", tablet_id, schema_hash));
-    }
-
-    std::string json_template = R"({
-        "status" : "Success",
-        "run_status" : $0,
-        "msg" : "$1",
-        "tablet_id" : $2,
-        "schema_hash" : $3,
-        "compact_type" : "$4"
+    if (tablet_id == 0) {
+        // overall compaction status
+        RETURN_IF_ERROR(StorageEngine::instance()->get_compaction_status_json(json_result));
+        return Status::OK();
+    } else {
+        // fetch the tablet by tablet_id and schema_hash
+        TabletSharedPtr tablet =
+                StorageEngine::instance()->tablet_manager()->get_tablet(tablet_id, schema_hash);
+    
+        if (tablet == nullptr) {
+            LOG(WARNING) << "invalid argument.tablet_id:" << tablet_id
+                         << ", schema_hash:" << schema_hash;
+            return Status::InternalError(
+                    strings::Substitute("fail to get $0, $1", tablet_id, schema_hash));
+        }
+    
+        std::string json_template = R"({
+            "status" : "Success",
+            "run_status" : $0,
+            "msg" : "$1",
+            "tablet_id" : $2,
+            "schema_hash" : $3,
+            "compact_type" : "$4"
 })";
-
-    std::string msg = "this tablet_id is not running";
-    std::string compaction_type = "";
-    bool run_status = 0;
-
-    {
-        // use try lock to check this tablet is running cumulative compaction
-        MutexLock lock_cumulative(tablet->get_cumulative_lock(), TRY_LOCK);
-        if (!lock_cumulative.own_lock()) {
-            msg = "this tablet_id is running";
-            compaction_type = "cumulative";
-            run_status = 1;
-            *json_result = strings::Substitute(json_template, run_status, msg, tablet_id,
-                                               schema_hash, compaction_type);
-            return Status::OK();
+    
+        std::string msg = "this tablet_id is not running";

Review comment:
       I think `compaction task for this tablet_id is not running` may be better, and `this tablet_id is not running`may be misunderstood to mean that this tablet is unhealthy.




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

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] [incubator-doris] morningman merged pull request #5737: [Compaction] Modify compaction logic

Posted by GitBox <gi...@apache.org>.
morningman merged pull request #5737:
URL: https://github.com/apache/incubator-doris/pull/5737


   


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

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] [incubator-doris] weizuo93 commented on pull request #5737: [Compaction] Modify compaction logic

Posted by GitBox <gi...@apache.org>.
weizuo93 commented on pull request #5737:
URL: https://github.com/apache/incubator-doris/pull/5737#issuecomment-829782926


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

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] [incubator-doris] morningman commented on a change in pull request #5737: [Compaction] Modify compaction logic

Posted by GitBox <gi...@apache.org>.
morningman commented on a change in pull request #5737:
URL: https://github.com/apache/incubator-doris/pull/5737#discussion_r623586814



##########
File path: be/src/olap/storage_engine.cpp
##########
@@ -1035,4 +1035,76 @@ void StorageEngine::create_base_compaction(TabletSharedPtr best_tablet,
     base_compaction.reset(new BaseCompaction(best_tablet, tracker_label, _compaction_mem_tracker));
 }
 
+// Return json:
+// {
+//   "CumulativeCompaction": {
+//          "/home/disk1" : [10001, 10002],

Review comment:
       It's OK, but since we already have metrics to show the max version number of compaction task, I think it is enough for us to monitor the segment number. And if we want to see the number of a certain compaction task, we can just dive into the be.INFO.




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

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] [incubator-doris] weizuo93 commented on a change in pull request #5737: [Compaction] Modify compaction logic

Posted by GitBox <gi...@apache.org>.
weizuo93 commented on a change in pull request #5737:
URL: https://github.com/apache/incubator-doris/pull/5737#discussion_r623563305



##########
File path: be/src/http/action/compaction_action.cpp
##########
@@ -155,59 +154,66 @@ Status CompactionAction::_handle_run_status_compaction(HttpRequest* req, std::st
     Status check_status = _check_param(req, &tablet_id, &schema_hash);
     RETURN_IF_ERROR(check_status);
 
-    // fetch the tablet by tablet_id and schema_hash
-    TabletSharedPtr tablet =
-            StorageEngine::instance()->tablet_manager()->get_tablet(tablet_id, schema_hash);
 
-    if (tablet == nullptr) {
-        LOG(WARNING) << "invalid argument.tablet_id:" << tablet_id
-                     << ", schema_hash:" << schema_hash;
-        return Status::InternalError(
-                strings::Substitute("fail to get $0, $1", tablet_id, schema_hash));
-    }
-
-    std::string json_template = R"({
-        "status" : "Success",
-        "run_status" : $0,
-        "msg" : "$1",
-        "tablet_id" : $2,
-        "schema_hash" : $3,
-        "compact_type" : "$4"
+    if (tablet_id == 0) {
+        // overall compaction status
+        RETURN_IF_ERROR(StorageEngine::instance()->get_compaction_status_json(json_result));
+        return Status::OK();
+    } else {
+        // fetch the tablet by tablet_id and schema_hash
+        TabletSharedPtr tablet =
+                StorageEngine::instance()->tablet_manager()->get_tablet(tablet_id, schema_hash);
+    
+        if (tablet == nullptr) {
+            LOG(WARNING) << "invalid argument.tablet_id:" << tablet_id
+                         << ", schema_hash:" << schema_hash;
+            return Status::InternalError(
+                    strings::Substitute("fail to get $0, $1", tablet_id, schema_hash));
+        }
+    
+        std::string json_template = R"({
+            "status" : "Success",
+            "run_status" : $0,
+            "msg" : "$1",
+            "tablet_id" : $2,
+            "schema_hash" : $3,
+            "compact_type" : "$4"
 })";
-
-    std::string msg = "this tablet_id is not running";
-    std::string compaction_type = "";
-    bool run_status = 0;
-
-    {
-        // use try lock to check this tablet is running cumulative compaction
-        MutexLock lock_cumulative(tablet->get_cumulative_lock(), TRY_LOCK);
-        if (!lock_cumulative.own_lock()) {
-            msg = "this tablet_id is running";
-            compaction_type = "cumulative";
-            run_status = 1;
-            *json_result = strings::Substitute(json_template, run_status, msg, tablet_id,
-                                               schema_hash, compaction_type);
-            return Status::OK();
+    
+        std::string msg = "this tablet_id is not running";
+        std::string compaction_type = "";
+        bool run_status = 0;
+    
+        {
+            // use try lock to check this tablet is running cumulative compaction
+            MutexLock lock_cumulative(tablet->get_cumulative_lock(), TRY_LOCK);
+            if (!lock_cumulative.own_lock()) {
+                msg = "this tablet_id is running";

Review comment:
       `this tablet_id is running compaction task`?




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

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] [incubator-doris] weizuo93 commented on a change in pull request #5737: [Compaction] Modify compaction logic

Posted by GitBox <gi...@apache.org>.
weizuo93 commented on a change in pull request #5737:
URL: https://github.com/apache/incubator-doris/pull/5737#discussion_r623563757



##########
File path: be/src/http/action/compaction_action.cpp
##########
@@ -155,59 +154,66 @@ Status CompactionAction::_handle_run_status_compaction(HttpRequest* req, std::st
     Status check_status = _check_param(req, &tablet_id, &schema_hash);
     RETURN_IF_ERROR(check_status);
 
-    // fetch the tablet by tablet_id and schema_hash
-    TabletSharedPtr tablet =
-            StorageEngine::instance()->tablet_manager()->get_tablet(tablet_id, schema_hash);
 
-    if (tablet == nullptr) {
-        LOG(WARNING) << "invalid argument.tablet_id:" << tablet_id
-                     << ", schema_hash:" << schema_hash;
-        return Status::InternalError(
-                strings::Substitute("fail to get $0, $1", tablet_id, schema_hash));
-    }
-
-    std::string json_template = R"({
-        "status" : "Success",
-        "run_status" : $0,
-        "msg" : "$1",
-        "tablet_id" : $2,
-        "schema_hash" : $3,
-        "compact_type" : "$4"
+    if (tablet_id == 0) {
+        // overall compaction status
+        RETURN_IF_ERROR(StorageEngine::instance()->get_compaction_status_json(json_result));
+        return Status::OK();
+    } else {
+        // fetch the tablet by tablet_id and schema_hash
+        TabletSharedPtr tablet =
+                StorageEngine::instance()->tablet_manager()->get_tablet(tablet_id, schema_hash);
+    
+        if (tablet == nullptr) {
+            LOG(WARNING) << "invalid argument.tablet_id:" << tablet_id
+                         << ", schema_hash:" << schema_hash;
+            return Status::InternalError(
+                    strings::Substitute("fail to get $0, $1", tablet_id, schema_hash));
+        }
+    
+        std::string json_template = R"({
+            "status" : "Success",
+            "run_status" : $0,
+            "msg" : "$1",
+            "tablet_id" : $2,
+            "schema_hash" : $3,
+            "compact_type" : "$4"
 })";
-
-    std::string msg = "this tablet_id is not running";
-    std::string compaction_type = "";
-    bool run_status = 0;
-
-    {
-        // use try lock to check this tablet is running cumulative compaction
-        MutexLock lock_cumulative(tablet->get_cumulative_lock(), TRY_LOCK);
-        if (!lock_cumulative.own_lock()) {
-            msg = "this tablet_id is running";
-            compaction_type = "cumulative";
-            run_status = 1;
-            *json_result = strings::Substitute(json_template, run_status, msg, tablet_id,
-                                               schema_hash, compaction_type);
-            return Status::OK();
+    
+        std::string msg = "this tablet_id is not running";
+        std::string compaction_type = "";
+        bool run_status = 0;
+    
+        {
+            // use try lock to check this tablet is running cumulative compaction
+            MutexLock lock_cumulative(tablet->get_cumulative_lock(), TRY_LOCK);
+            if (!lock_cumulative.own_lock()) {
+                msg = "this tablet_id is running";
+                compaction_type = "cumulative";
+                run_status = 1;
+                *json_result = strings::Substitute(json_template, run_status, msg, tablet_id,
+                                                   schema_hash, compaction_type);
+                return Status::OK();
+            }
         }
-    }
-
-    {
-        // use try lock to check this tablet is running base compaction
-        MutexLock lock_base(tablet->get_base_lock(), TRY_LOCK);
-        if (!lock_base.own_lock()) {
-            msg = "this tablet_id is running";
-            compaction_type = "base";
-            run_status = 1;
-            *json_result = strings::Substitute(json_template, run_status, msg, tablet_id,
-                                               schema_hash, compaction_type);
-            return Status::OK();
+    
+        {
+            // use try lock to check this tablet is running base compaction
+            MutexLock lock_base(tablet->get_base_lock(), TRY_LOCK);
+            if (!lock_base.own_lock()) {
+                msg = "this tablet_id is running";

Review comment:
       `this tablet_id is running compaction task`?




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

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] [incubator-doris] weizuo93 commented on a change in pull request #5737: [Compaction] Modify compaction logic

Posted by GitBox <gi...@apache.org>.
weizuo93 commented on a change in pull request #5737:
URL: https://github.com/apache/incubator-doris/pull/5737#discussion_r623563305



##########
File path: be/src/http/action/compaction_action.cpp
##########
@@ -155,59 +154,66 @@ Status CompactionAction::_handle_run_status_compaction(HttpRequest* req, std::st
     Status check_status = _check_param(req, &tablet_id, &schema_hash);
     RETURN_IF_ERROR(check_status);
 
-    // fetch the tablet by tablet_id and schema_hash
-    TabletSharedPtr tablet =
-            StorageEngine::instance()->tablet_manager()->get_tablet(tablet_id, schema_hash);
 
-    if (tablet == nullptr) {
-        LOG(WARNING) << "invalid argument.tablet_id:" << tablet_id
-                     << ", schema_hash:" << schema_hash;
-        return Status::InternalError(
-                strings::Substitute("fail to get $0, $1", tablet_id, schema_hash));
-    }
-
-    std::string json_template = R"({
-        "status" : "Success",
-        "run_status" : $0,
-        "msg" : "$1",
-        "tablet_id" : $2,
-        "schema_hash" : $3,
-        "compact_type" : "$4"
+    if (tablet_id == 0) {
+        // overall compaction status
+        RETURN_IF_ERROR(StorageEngine::instance()->get_compaction_status_json(json_result));
+        return Status::OK();
+    } else {
+        // fetch the tablet by tablet_id and schema_hash
+        TabletSharedPtr tablet =
+                StorageEngine::instance()->tablet_manager()->get_tablet(tablet_id, schema_hash);
+    
+        if (tablet == nullptr) {
+            LOG(WARNING) << "invalid argument.tablet_id:" << tablet_id
+                         << ", schema_hash:" << schema_hash;
+            return Status::InternalError(
+                    strings::Substitute("fail to get $0, $1", tablet_id, schema_hash));
+        }
+    
+        std::string json_template = R"({
+            "status" : "Success",
+            "run_status" : $0,
+            "msg" : "$1",
+            "tablet_id" : $2,
+            "schema_hash" : $3,
+            "compact_type" : "$4"
 })";
-
-    std::string msg = "this tablet_id is not running";
-    std::string compaction_type = "";
-    bool run_status = 0;
-
-    {
-        // use try lock to check this tablet is running cumulative compaction
-        MutexLock lock_cumulative(tablet->get_cumulative_lock(), TRY_LOCK);
-        if (!lock_cumulative.own_lock()) {
-            msg = "this tablet_id is running";
-            compaction_type = "cumulative";
-            run_status = 1;
-            *json_result = strings::Substitute(json_template, run_status, msg, tablet_id,
-                                               schema_hash, compaction_type);
-            return Status::OK();
+    
+        std::string msg = "this tablet_id is not running";
+        std::string compaction_type = "";
+        bool run_status = 0;
+    
+        {
+            // use try lock to check this tablet is running cumulative compaction
+            MutexLock lock_cumulative(tablet->get_cumulative_lock(), TRY_LOCK);
+            if (!lock_cumulative.own_lock()) {
+                msg = "this tablet_id is running";

Review comment:
       `this tablet_id is running compaction task`




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

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] [incubator-doris] weizuo93 commented on a change in pull request #5737: [Compaction] Modify compaction logic

Posted by GitBox <gi...@apache.org>.
weizuo93 commented on a change in pull request #5737:
URL: https://github.com/apache/incubator-doris/pull/5737#discussion_r623570948



##########
File path: be/src/olap/storage_engine.cpp
##########
@@ -1035,4 +1035,76 @@ void StorageEngine::create_base_compaction(TabletSharedPtr best_tablet,
     base_compaction.reset(new BaseCompaction(best_tablet, tracker_label, _compaction_mem_tracker));
 }
 
+// Return json:
+// {
+//   "CumulativeCompaction": {
+//          "/home/disk1" : [10001, 10002],

Review comment:
       Can we add segment number that be merged in this compaction task for each thread? Of course, we could add the segment number info in another PR.




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

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] [incubator-doris] weizuo93 commented on a change in pull request #5737: [Compaction] Modify compaction logic

Posted by GitBox <gi...@apache.org>.
weizuo93 commented on a change in pull request #5737:
URL: https://github.com/apache/incubator-doris/pull/5737#discussion_r623584530



##########
File path: be/src/common/config.h
##########
@@ -283,8 +281,7 @@ CONF_mInt32(cumulative_compaction_skip_window_seconds, "30");
 CONF_mInt64(min_compaction_failure_interval_sec, "600"); // 10 min
 
 // This config can be set to limit thread number in compaction thread pool.
-CONF_mInt32(min_compaction_threads, "10");
-CONF_mInt32(max_compaction_threads, "10");
+CONF_Int32(max_compaction_threads, "10");

Review comment:
       > It's OK for me~
   > But I think the `min_compaction_threads` is meaning less for user, we should reduce unnecessary configuration items as much as possible
   
   OK.




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

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] [incubator-doris] weizuo93 commented on a change in pull request #5737: [Compaction] Modify compaction logic

Posted by GitBox <gi...@apache.org>.
weizuo93 commented on a change in pull request #5737:
URL: https://github.com/apache/incubator-doris/pull/5737#discussion_r623550148



##########
File path: be/src/common/config.h
##########
@@ -283,8 +281,7 @@ CONF_mInt32(cumulative_compaction_skip_window_seconds, "30");
 CONF_mInt64(min_compaction_failure_interval_sec, "600"); // 10 min
 
 // This config can be set to limit thread number in compaction thread pool.
-CONF_mInt32(min_compaction_threads, "10");
-CONF_mInt32(max_compaction_threads, "10");
+CONF_Int32(max_compaction_threads, "10");

Review comment:
       Now, `max_threads` and `min_threads`of Thread Pool can not be adjusted dynamically. Recently, I am looking into the implementation of the ThreadPool, and I consider supporting dynamic adjustment of `max_threads` and `min_threads`for thread pool later. How do you like it?




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

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