This is an automated email from the ASF dual-hosted git repository.
morningman 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 e5b34036f8 [fix](merge-on-write) fix that the version of delete bitmap
is incorrect when calculate delete bitmap between segments (#17095)
e5b34036f8 is described below
commit e5b34036f8a1b0afd9712484634b435b4ebf80d0
Author: Xin Liao <[email protected]>
AuthorDate: Mon Feb 27 17:17:25 2023 +0800
[fix](merge-on-write) fix that the version of delete bitmap is incorrect
when calculate delete bitmap between segments (#17095)
Different version numbers are used to calculate the delete bitmap between
segments and rowsets, resulting in the failure of the last update of the delete
bitmap.
---
be/src/olap/tablet.cpp | 14 ++++++--------
be/src/olap/tablet.h | 4 ++--
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp
index 255c22cce7..2b096d5abb 100644
--- a/be/src/olap/tablet.cpp
+++ b/be/src/olap/tablet.cpp
@@ -2047,15 +2047,14 @@ Status Tablet::calc_delete_bitmap(RowsetId rowset_id,
RowLocation loc;
// first check if exist in pre segment
if (check_pre_segments) {
- auto st = _check_pk_in_pre_segments(rowset_id,
pre_segments, key, dummy_version,
- delete_bitmap, &loc);
+ auto st = _check_pk_in_pre_segments(rowset_id,
pre_segments, key, delete_bitmap,
+ &loc);
if (st.ok()) {
- delete_bitmap->add({rowset_id, loc.segment_id,
dummy_version.first},
- loc.row_id);
+ delete_bitmap->add({rowset_id, loc.segment_id, 0},
loc.row_id);
++row_id;
continue;
} else if (st.is_already_exist()) {
- delete_bitmap->add({rowset_id, seg->id(),
dummy_version.first}, row_id);
+ delete_bitmap->add({rowset_id, seg->id(), 0}, row_id);
++row_id;
continue;
}
@@ -2104,15 +2103,14 @@ Status Tablet::calc_delete_bitmap(RowsetId rowset_id,
Status Tablet::_check_pk_in_pre_segments(
RowsetId rowset_id, const std::vector<segment_v2::SegmentSharedPtr>&
pre_segments,
- const Slice& key, const Version& version, DeleteBitmapPtr
delete_bitmap, RowLocation* loc) {
+ const Slice& key, 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({rowset_id, loc->segment_id,
version.first},
- loc->row_id)) {
+ delete_bitmap->contains({rowset_id, loc->segment_id, 0},
loc->row_id)) {
// if has sequence col, we continue to compare the sequence_id of
// all segments, util we find an existing key.
continue;
diff --git a/be/src/olap/tablet.h b/be/src/olap/tablet.h
index 5bf005865e..b56862df59 100644
--- a/be/src/olap/tablet.h
+++ b/be/src/olap/tablet.h
@@ -408,8 +408,8 @@ private:
Status _check_pk_in_pre_segments(RowsetId rowset_id,
const
std::vector<segment_v2::SegmentSharedPtr>& pre_segments,
- const Slice& key, const Version& version,
- DeleteBitmapPtr delete_bitmap,
RowLocation* loc);
+ const Slice& key, DeleteBitmapPtr
delete_bitmap,
+ RowLocation* loc);
void _rowset_ids_difference(const RowsetIdUnorderedSet& cur, const
RowsetIdUnorderedSet& pre,
RowsetIdUnorderedSet* to_add,
RowsetIdUnorderedSet* to_del);
Status _load_rowset_segments(const RowsetSharedPtr& rowset,
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]