nextdreamblue commented on code in PR #14995:
URL: https://github.com/apache/doris/pull/14995#discussion_r1045575499
##########
be/src/olap/tablet.cpp:
##########
@@ -2044,19 +2048,26 @@ Status Tablet::calc_delete_bitmap(RowsetId rowset_id,
}
Status Tablet::_check_pk_in_pre_segments(
- const std::vector<segment_v2::SegmentSharedPtr>& pre_segments, const
Slice& key,
- const Version& version, DeleteBitmapPtr delete_bitmap, RowLocation*
loc) {
+ RowsetId rowset_id, const std::vector<segment_v2::SegmentSharedPtr>&
pre_segments,
+ const Slice& key, const Version& version, DeleteBitmapPtr
delete_bitmap, RowLocation* loc) {
for (auto it = pre_segments.rbegin(); it != pre_segments.rend(); ++it) {
auto st = (*it)->lookup_row_key(key, loc);
CHECK(st.ok() || st.is<NOT_FOUND>() || st.is<ALREADY_EXIST>());
if (st.is<NOT_FOUND>()) {
continue;
} else if (st.ok() && _schema->has_sequence_col() &&
- delete_bitmap->contains({loc->rowset_id, loc->segment_id,
version.first},
+ delete_bitmap->contains({rowset_id, loc->segment_id,
version.first},
loc->row_id)) {
// if has sequence col, we continue to compare the sequence_id of
// all segments, util we find an existing key.
continue;
+ } else if (st.ok() && !_schema->has_sequence_col()) {
+ // delete all rows with same key in all pre segments
+ if (!delete_bitmap->contains({rowset_id, loc->segment_id,
version.first},
+ loc->row_id)) {
+ delete_bitmap->add({rowset_id, loc->segment_id,
version.first}, loc->row_id);
+ }
+ continue;
Review Comment:
that's rigth, i fix it
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]