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 2020/11/24 14:58:02 UTC
[GitHub] [incubator-doris] morningman commented on a change in pull request #4891: [Refactor] Execute 'pick rowsets' before applying for permits for a compaction task
morningman commented on a change in pull request #4891:
URL: https://github.com/apache/incubator-doris/pull/4891#discussion_r529607540
##########
File path: be/src/olap/base_compaction.cpp
##########
@@ -43,9 +50,26 @@ OLAPStatus BaseCompaction::compact() {
RETURN_NOT_OK(pick_rowsets_to_compact());
TRACE("rowsets picked");
TRACE_COUNTER_INCREMENT("input_rowsets_count", _input_rowsets.size());
+ _tablet->set_clone_occurred(false);
+
+ return OLAP_SUCCESS;
+}
+
+OLAPStatus BaseCompaction::execute_compact() {
+ MutexLock lock(_tablet->get_base_lock(), TRY_LOCK);
+ if (!lock.own_lock()) {
+ LOG(WARNING) << "another base compaction is running. tablet=" << _tablet->full_name();
+ return OLAP_ERR_BE_TRY_BE_LOCK_ERROR;
+ }
+ TRACE("got base compaction lock");
+
+ if (_tablet->get_clone_occurred()) {
+ _tablet->set_clone_occurred(false);
Review comment:
Add comment to explain why setting clone occurred here.
##########
File path: be/src/olap/base_compaction.cpp
##########
@@ -28,6 +28,13 @@ BaseCompaction::BaseCompaction(TabletSharedPtr tablet, const std::string& label,
BaseCompaction::~BaseCompaction() { }
OLAPStatus BaseCompaction::compact() {
+ RETURN_NOT_OK(prepare_compact());
Review comment:
Who will call `BaseCompaction::compact()` now?
----------------------------------------------------------------
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