You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2022/05/26 07:05:56 UTC

[incubator-doris] branch master updated: [bugfix] fix correctness for vectorized compaction (#9773)

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

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 24631915ed [bugfix] fix correctness for vectorized compaction (#9773)
24631915ed is described below

commit 24631915edc605c8280792b0626ac3e689581612
Author: Gabriel <ga...@gmail.com>
AuthorDate: Thu May 26 15:05:50 2022 +0800

    [bugfix] fix correctness for vectorized compaction (#9773)
---
 be/src/olap/rowset/segment_v2/segment_writer.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/be/src/olap/rowset/segment_v2/segment_writer.cpp b/be/src/olap/rowset/segment_v2/segment_writer.cpp
index 707e152902..4db2549683 100644
--- a/be/src/olap/rowset/segment_v2/segment_writer.cpp
+++ b/be/src/olap/rowset/segment_v2/segment_writer.cpp
@@ -118,7 +118,11 @@ Status SegmentWriter::append_block(const vectorized::Block* block, size_t row_po
 
     // find all row pos for short key indexes
     std::vector<size_t> short_key_pos;
-    if (UNLIKELY(_short_key_row_pos == 0)) {
+    // We build a short key index every `_opts.num_rows_per_block` rows. Specifically, we
+    // build a short key index using 1st rows for first block and `_short_key_row_pos - _row_count`
+    // for next blocks.
+    // Ensure we build a short key index using 1st rows only for the first block (ISSUE-9766).
+    if (UNLIKELY(_short_key_row_pos == 0 && _row_count == 0)) {
         short_key_pos.push_back(0);
     }
     while (_short_key_row_pos + _opts.num_rows_per_block < _row_count + num_rows) {


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