You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2023/04/19 13:34:55 UTC

[doris] 29/36: [Fix](vertical compaction) Preserve _segment_num_rows during final segment flush (#18779)

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

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

commit 588e3623f1ff93e84174230d428487fe920a8d47
Author: airborne12 <ai...@gmail.com>
AuthorDate: Tue Apr 18 20:58:23 2023 +0800

    [Fix](vertical compaction) Preserve _segment_num_rows during final segment flush (#18779)
---
 be/src/olap/rowset/vertical_beta_rowset_writer.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/be/src/olap/rowset/vertical_beta_rowset_writer.cpp b/be/src/olap/rowset/vertical_beta_rowset_writer.cpp
index 769be401e9..e1e3ab46de 100644
--- a/be/src/olap/rowset/vertical_beta_rowset_writer.cpp
+++ b/be/src/olap/rowset/vertical_beta_rowset_writer.cpp
@@ -67,9 +67,6 @@ Status VerticalBetaRowsetWriter::add_columns(const vectorized::Block* block,
             // segment is full, need flush columns and create new segment writer
             RETURN_IF_ERROR(_flush_columns(&_segment_writers[_cur_writer_idx], true));
 
-            _segment_num_rows.resize(_cur_writer_idx + 1);
-            _segment_num_rows[_cur_writer_idx] = _segment_writers[_cur_writer_idx]->row_count();
-
             std::unique_ptr<segment_v2::SegmentWriter> writer;
             RETURN_IF_ERROR(_create_segment_writer(col_ids, is_key, &writer));
             _segment_writers.emplace_back(std::move(writer));
@@ -116,6 +113,8 @@ Status VerticalBetaRowsetWriter::_flush_columns(
         key_bounds.set_min_key(min_key.to_string());
         key_bounds.set_max_key(max_key.to_string());
         _segments_encoded_key_bounds.emplace_back(key_bounds);
+        _segment_num_rows.resize(_cur_writer_idx + 1);
+        _segment_num_rows[_cur_writer_idx] = _segment_writers[_cur_writer_idx]->row_count();
     }
     _total_index_size += static_cast<int64_t>(index_size);
     return Status::OK();


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