ZhangYu0123 commented on a change in pull request #4312: URL: https://github.com/apache/incubator-doris/pull/4312#discussion_r468437588
########## File path: be/src/http/action/compaction_action.h ########## @@ -41,8 +52,25 @@ class CompactionAction : public HttpHandler { private: Status _handle_show_compaction(HttpRequest *req, std::string* json_result); + /// execute compaction request to run compaction task + /// param compact_type in req to distinguish the task type, base or cumulative + Status _handle_run_compaction(HttpRequest *req, std::string* json_result); + + /// thread callback function for the tablet to do compaction + OLAPStatus _execute_compaction_callback(TabletSharedPtr tablet, const std::string& compaction_type); + + /// fetch compaction running status + Status _handle_run_status_compaction(HttpRequest* req, std::string* json_result); + private: CompactionActionType _type; + + /// running check mutex + static std::mutex _compaction_running_mutex; + /// whether there is manual compaction running + static bool _is_compaction_running; Review comment: Only use atomic<bool> can not cover this scenes, becouse atomic<bool> do not have test and set operation. ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org