SWJTU-ZhangLei commented on code in PR #50973:
URL: https://github.com/apache/doris/pull/50973#discussion_r2131741712
##########
be/src/cloud/cloud_tablet.cpp:
##########
@@ -342,6 +342,17 @@ void CloudTablet::add_rowsets(std::vector<RowsetSharedPtr>
to_add, bool version_
// replace existed rowset with `to_add` rowset. This may occur
when:
// 1. schema change converts rowsets which have been double
written to new tablet
// 2. cumu compaction picks single overlapping input rowset
to perform compaction
+ if (keys_type() == UNIQUE_KEYS &&
enable_unique_key_merge_on_write()) {
+ // add existed rowset to unused_rowsets to remove delete
bitmap
+ if (auto find_it = _rs_version_map.find(rs->version());
+ find_it != _rs_version_map.end()) {
+ DCHECK(find_it->second->rowset_id() != rs->rowset_id())
+ << "tablet_id=" << tablet_id()
+ << ", rowset_id=" <<
rs->rowset_id().to_string()
+ << ", existed rowset=" <<
find_it->second->rowset_id().to_string();
+ _unused_rowsets.emplace(find_it->second->rowset_id(),
find_it->second);
Review Comment:
does here need std::lock_guard < std::mutex > lock(_gc_mutex);?
--
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]