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

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


The following commit(s) were added to refs/heads/branch-1.2-lts by this push:
     new 0aa81ea8a7 [fix](merge-on-write) fix delete bitmap calculation error 
when clone (#21157)
0aa81ea8a7 is described below

commit 0aa81ea8a7a8a0fbb04a9307cafacaa1743d9c12
Author: Xin Liao <[email protected]>
AuthorDate: Mon Jun 26 10:40:13 2023 +0800

    [fix](merge-on-write) fix delete bitmap calculation error when clone 
(#21157)
---
 be/src/olap/tablet.cpp | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp
index 06c0572d80..ce1b14f8a1 100644
--- a/be/src/olap/tablet.cpp
+++ b/be/src/olap/tablet.cpp
@@ -2089,7 +2089,7 @@ Status Tablet::calc_delete_bitmap(RowsetId rowset_id,
             if (num_read == batch_size && num_read != remaining) {
                 num_read -= 1;
             }
-            for (size_t i = 0; i < num_read; i++) {
+            for (size_t i = 0; i < num_read; i++, row_id++) {
                 Slice key =
                         Slice(index_column->get_data_at(i).data, 
index_column->get_data_at(i).size);
                 RowLocation loc;
@@ -2099,16 +2099,16 @@ Status Tablet::calc_delete_bitmap(RowsetId rowset_id,
                                                         &loc);
                     if (st.ok()) {
                         delete_bitmap->add({rowset_id, loc.segment_id, 0}, 
loc.row_id);
+                        continue;
                     } else if (st.is<ALREADY_EXIST>()) {
                         delete_bitmap->add({rowset_id, seg->id(), 0}, row_id);
+                        continue;
                     } else if (!st.is<NOT_FOUND>()) {
                         // some unexpected error
                         LOG(WARNING) << "some unexpected error happen while 
looking up keys "
                                      << "in pre segments: " << st;
                         return st;
                     }
-                    ++row_id;
-                    continue;
                 }
 
                 if (specified_rowset_ids != nullptr && 
!specified_rowset_ids->empty()) {
@@ -2120,7 +2120,6 @@ Status Tablet::calc_delete_bitmap(RowsetId rowset_id,
                         return st;
                     }
                     if (st.is<NOT_FOUND>()) {
-                        ++row_id;
                         continue;
                     }
 
@@ -2141,7 +2140,6 @@ Status Tablet::calc_delete_bitmap(RowsetId rowset_id,
                     // the real version number later.
                     delete_bitmap->add({loc.rowset_id, loc.segment_id, 0}, 
loc.row_id);
                 }
-                ++row_id;
             }
             remaining -= num_read;
         }


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

Reply via email to