This is an automated email from the ASF dual-hosted git repository.
zhangchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new c3110f8153 [fix](merge-on-write) fix that the query result has
duplicate keys when load with sequence column (#16587)
c3110f8153 is described below
commit c3110f8153885c8a48f22d44c513fa27291f864e
Author: Xin Liao <[email protected]>
AuthorDate: Fri Feb 10 22:31:05 2023 +0800
[fix](merge-on-write) fix that the query result has duplicate keys when
load with sequence column (#16587)
---
be/src/olap/tablet.cpp | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp
index 32c0cc3d98..60f7a193ff 100644
--- a/be/src/olap/tablet.cpp
+++ b/be/src/olap/tablet.cpp
@@ -2168,8 +2168,15 @@ Status Tablet::calc_delete_bitmap(RowsetId rowset_id,
loc.row_id = row_id;
}
- delete_bitmap->add({loc.rowset_id, loc.segment_id,
dummy_version.first},
- loc.row_id);
+ // 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.
+ delete_bitmap->add({loc.rowset_id, loc.segment_id, 0},
loc.row_id);
}
++row_id;
}
@@ -2236,6 +2243,11 @@ Status Tablet::update_delete_bitmap_without_lock(const
RowsetSharedPtr& rowset)
int ret = _tablet_meta->delete_bitmap().set(
{std::get<0>(iter->first), std::get<1>(iter->first),
cur_version}, iter->second);
DCHECK(ret == 1);
+ if (ret != 1) {
+ LOG(INFO) << "failed to set delete bimap, key is: |" <<
std::get<0>(iter->first) << "|"
+ << std::get<1>(iter->first) << "|" << cur_version;
+ return Status::InternalError("failed to set delete bimap");
+ }
}
return Status::OK();
@@ -2281,6 +2293,11 @@ Status Tablet::update_delete_bitmap(const
RowsetSharedPtr& rowset, DeleteBitmapP
int ret = _tablet_meta->delete_bitmap().set(
{std::get<0>(iter->first), std::get<1>(iter->first),
cur_version}, iter->second);
DCHECK(ret == 1);
+ if (ret != 1) {
+ LOG(INFO) << "failed to set delete bimap, key is: |" <<
std::get<0>(iter->first) << "|"
+ << std::get<1>(iter->first) << "|" << cur_version;
+ return Status::InternalError("failed to set delete bimap");
+ }
}
return Status::OK();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]