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

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 5240e90298 [fix](segcompaction) disable segcompaction when calculating 
delete bitmap (#23975)
5240e90298 is described below

commit 5240e90298eb2c115fd2f2c217420ad5020afc90
Author: zhengyu <[email protected]>
AuthorDate: Wed Sep 6 20:25:25 2023 +0800

    [fix](segcompaction) disable segcompaction when calculating delete bitmap 
(#23975)
    
    Calc delete bitmap may generate segments and, as a result, may
    trigger segcompaction. But the BetaRowsetWriter is a transient
    one and in Publishing context, which is bug-prone and hard to
    rollback. So let us disable the triggering in the delete bitmap
    calc code path.
---
 be/src/olap/rowset/beta_rowset_writer.cpp  | 2 +-
 be/src/olap/rowset/rowset_writer_context.h | 2 ++
 be/src/olap/tablet.cpp                     | 3 ++-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/be/src/olap/rowset/beta_rowset_writer.cpp 
b/be/src/olap/rowset/beta_rowset_writer.cpp
index 5c66182381..1414847959 100644
--- a/be/src/olap/rowset/beta_rowset_writer.cpp
+++ b/be/src/olap/rowset/beta_rowset_writer.cpp
@@ -335,7 +335,7 @@ bool 
BetaRowsetWriter::_check_and_set_is_doing_segcompaction() {
 
 Status BetaRowsetWriter::_segcompaction_if_necessary() {
     Status status = Status::OK();
-    if (!config::enable_segcompaction || 
_context.tablet_schema->is_dynamic_schema() ||
+    if (!config::enable_segcompaction || !_context.enable_segcompaction ||
         !_check_and_set_is_doing_segcompaction()) {
         return status;
     }
diff --git a/be/src/olap/rowset/rowset_writer_context.h 
b/be/src/olap/rowset/rowset_writer_context.h
index 904966d8e3..32925e617c 100644
--- a/be/src/olap/rowset/rowset_writer_context.h
+++ b/be/src/olap/rowset/rowset_writer_context.h
@@ -90,6 +90,8 @@ struct RowsetWriterContext {
             nullptr;
 
     std::shared_ptr<MowContext> mow_context;
+    // segcompaction for this RowsetWriter, disable it for some transient 
writers
+    bool enable_segcompaction = true;
 };
 
 } // namespace doris
diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp
index 24e8747740..494c44ac20 100644
--- a/be/src/olap/tablet.cpp
+++ b/be/src/olap/tablet.cpp
@@ -1983,6 +1983,7 @@ Status 
Tablet::create_transient_rowset_writer(RowsetSharedPtr rowset_ptr,
     context.tablet_schema->set_partial_update_info(false, 
std::set<std::string>());
     context.newest_write_timestamp = UnixSeconds();
     context.tablet_id = table_id();
+    context.enable_segcompaction = false;
     // ATTN: context.tablet is a shared_ptr, can't simply set it's value to 
`this`. We should
     // get the shared_ptr from tablet_manager.
     context.tablet = 
StorageEngine::instance()->tablet_manager()->get_tablet(tablet_id());
@@ -2538,7 +2539,7 @@ void Tablet::remove_unused_remote_files() {
                 if (UNLIKELY(end == std::string::npos)) {
                     return false;
                 }
-                return !!cooldowned_rowsets.count(path_str.substr(0, end)); 
+                return !!cooldowned_rowsets.count(path_str.substr(0, end));
             }
             if (StringPiece(path_str).ends_with(".idx")) {
                 // extract rowset id. filename format: 
{rowset_id}_{segment_num}_{index_id}.idx


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to