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

zhangchen 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 b8fbc7c2a6 [fix](partial-update) transient rowset writer should not 
trigger segcompaction when build rowset (#21751)
b8fbc7c2a6 is described below

commit b8fbc7c2a617ff5393a157f915344c48bb215e88
Author: zhannngchen <48427519+zhannngc...@users.noreply.github.com>
AuthorDate: Wed Jul 12 21:47:07 2023 +0800

    [fix](partial-update) transient rowset writer should not trigger 
segcompaction when build rowset (#21751)
---
 be/src/olap/rowset/beta_rowset_writer.cpp | 38 +++++++++++++++++--------------
 1 file changed, 21 insertions(+), 17 deletions(-)

diff --git a/be/src/olap/rowset/beta_rowset_writer.cpp 
b/be/src/olap/rowset/beta_rowset_writer.cpp
index 6c7d5622a8..cfb9bbc5e4 100644
--- a/be/src/olap/rowset/beta_rowset_writer.cpp
+++ b/be/src/olap/rowset/beta_rowset_writer.cpp
@@ -557,24 +557,28 @@ RowsetSharedPtr BetaRowsetWriter::build() {
         }
     }
     Status status;
-    status = wait_flying_segcompaction();
-    if (!status.ok()) {
-        LOG(WARNING) << "segcompaction failed when build new rowset 1st wait, 
res=" << status;
-        return nullptr;
-    }
-    status = _segcompaction_ramaining_if_necessary();
-    if (!status.ok()) {
-        LOG(WARNING) << "segcompaction failed when build new rowset, res=" << 
status;
-        return nullptr;
-    }
-    status = wait_flying_segcompaction();
-    if (!status.ok()) {
-        LOG(WARNING) << "segcompaction failed when build new rowset 2nd wait, 
res=" << status;
-        return nullptr;
-    }
+    // if _segment_start_id is not zero, that means it's a transient rowset 
writer for
+    // MoW partial update, don't need to do segment compaction.
+    if (_segment_start_id == 0) {
+        status = wait_flying_segcompaction();
+        if (!status.ok()) {
+            LOG(WARNING) << "segcompaction failed when build new rowset 1st 
wait, res=" << status;
+            return nullptr;
+        }
+        status = _segcompaction_ramaining_if_necessary();
+        if (!status.ok()) {
+            LOG(WARNING) << "segcompaction failed when build new rowset, res=" 
<< status;
+            return nullptr;
+        }
+        status = wait_flying_segcompaction();
+        if (!status.ok()) {
+            LOG(WARNING) << "segcompaction failed when build new rowset 2nd 
wait, res=" << status;
+            return nullptr;
+        }
 
-    if (_segcompaction_worker.get_file_writer()) {
-        _segcompaction_worker.get_file_writer()->close();
+        if (_segcompaction_worker.get_file_writer()) {
+            _segcompaction_worker.get_file_writer()->close();
+        }
     }
     // When building a rowset, we must ensure that the current _segment_writer 
has been
     // flushed, that is, the current _segment_writer is nullptr


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

Reply via email to