This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch compaction_opt
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/compaction_opt by this push:
     new 09055818ad [improvement](compaction) add ordered data compaction 
trigger (#14324)
09055818ad is described below

commit 09055818ad59324877792115d00c77609f848563
Author: yixiutt <102007456+yixi...@users.noreply.github.com>
AuthorDate: Wed Nov 16 17:18:52 2022 +0800

    [improvement](compaction) add ordered data compaction trigger (#14324)
---
 be/src/common/config.h     | 2 ++
 be/src/olap/compaction.cpp | 8 ++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/be/src/common/config.h b/be/src/common/config.h
index 712efc1e39..a05fd24723 100644
--- a/be/src/common/config.h
+++ b/be/src/common/config.h
@@ -240,6 +240,8 @@ CONF_Bool(enable_vectorized_compaction, "true");
 CONF_Bool(enable_vectorized_alter_table, "true");
 // whether enable vertical compaction
 CONF_mBool(enable_vertical_compaction, "false");
+// whether enable ordered data compaction
+CONF_mBool(enable_ordered_data_compaction, "false");
 // In vertical compaction, column number for every group
 CONF_mInt32(vertical_compaction_num_columns_per_group, "5");
 // In vertical compaction, max memory usage for row_source_buffer
diff --git a/be/src/olap/compaction.cpp b/be/src/olap/compaction.cpp
index 0283e1e76c..a79ef6ed56 100644
--- a/be/src/olap/compaction.cpp
+++ b/be/src/olap/compaction.cpp
@@ -130,10 +130,11 @@ bool Compaction::is_rowset_tidy(std::string& pre_max_key, 
const RowsetSharedPtr&
 }
 
 Status Compaction::do_compact_ordered_rowsets() {
-    LOG(INFO) << "start to do ordered data compaction, tablet=" << 
_tablet->full_name()
-              << ", output_version=" << _output_version;
     build_basic_info();
     RETURN_NOT_OK(construct_output_rowset_writer());
+
+    LOG(INFO) << "start to do ordered data compaction, tablet=" << 
_tablet->full_name()
+              << ", output_version=" << _output_version;
     // link data to new rowset
     auto seg_id = 0;
     std::vector<KeyBoundsPB> segment_key_bounds;
@@ -187,6 +188,9 @@ void Compaction::build_basic_info() {
 }
 
 bool Compaction::handle_ordered_data_compaction() {
+    if (!config::enable_ordered_data_compaction) {
+        return false;
+    }
     // check delete version: if compaction type is base compaction and
     // has a delete version, use original compaction
     if (compaction_type() == ReaderType::READER_BASE_COMPACTION) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to