zhannngchen commented on code in PR #21773:
URL: https://github.com/apache/doris/pull/21773#discussion_r1323027168


##########
be/src/olap/tablet.cpp:
##########
@@ -2951,42 +2953,50 @@ Status 
Tablet::calc_segment_delete_bitmap(RowsetSharedPtr rowset,
             if (st.is<KEY_NOT_FOUND>()) {
                 continue;
             }
-
-            // sequence id smaller than the previous one, so delete current row
-            if (st.is<KEY_ALREADY_EXISTS>()) {
-                delete_bitmap->add({rowset_id, seg->id(), 
DeleteBitmap::TEMP_VERSION_COMMON},
-                                   row_id);
-                continue;
-            } else if (is_partial_update && rowset_writer != nullptr) {
-                // In publish version, record rows to be deleted for 
concurrent update
-                // For example, if version 5 and 6 update a row, but version 6 
only see
-                // version 4 when write, and when publish version, version 5's 
value will
-                // be marked as deleted and it's update is losed.
-                // So here we should read version 5's columns and build a new 
row, which is
-                // consists of version 6's update columns and version 5's 
origin columns
-                // here we build 2 read plan for ori values and update values
-                prepare_to_read(loc, pos, &read_plan_ori);
-                prepare_to_read(RowLocation {rowset_id, seg->id(), row_id}, 
pos, &read_plan_update);
-                rsid_to_rowset[rowset_find->rowset_id()] = rowset_find;
-                ++pos;
-                // delete bitmap will be calculate when memtable flush and
-                // publish. The two stages may see different versions.
-                // When there is sequence column, the currently imported data
-                // of rowset may be marked for deletion at memtablet flush or
-                // publish because the seq column is smaller than the previous
-                // rowset.
-                // just set 0 as a unified temporary version number, and 
update to
-                // the real version number later.
+            if (UNLIKELY(is_unique_key_ignore_mode)) {
+                if (st.is<OK>() || st.is<KEY_ALREADY_EXISTS>()) {

Review Comment:
   lookup_row_key will return KEY_ALREADY_EXISTS only when the table has seq 
column. You should ignore seq column if `is_unique_key_ignore_mode` is true 
(set the second parameter of `lookup_row_key` as false)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to