SWJTU-ZhangLei commented on code in PR #51573:
URL: https://github.com/apache/doris/pull/51573#discussion_r2144309262
##########
be/src/cloud/cloud_tablet.cpp:
##########
@@ -63,6 +63,8 @@ bvar::LatencyRecorder
g_cu_compaction_get_delete_bitmap_lock_time_ms(
bvar::LatencyRecorder g_base_compaction_get_delete_bitmap_lock_time_ms(
"base_compaction_get_delete_bitmap_lock_time_ms");
+bvar::Adder<int64_t> g_unused_rowsets_count("unused_rowsets_count");
Review Comment:
done
##########
be/src/cloud/cloud_tablet.cpp:
##########
@@ -342,17 +344,20 @@ 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);
- }
+
+ // add existed rowset to unused_rowsets to remove delete
bitmap and recycle cached data
+
+ std::vector<RowsetSharedPtr> unused_rowsets;
+ 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())
Review Comment:
> add a `if()` to check and log ?
done
##########
be/src/cloud/cloud_tablet.cpp:
##########
@@ -504,19 +504,34 @@ bool CloudTablet::need_remove_unused_rowsets() {
return !_unused_rowsets.empty() || !_unused_delete_bitmap.empty();
}
+void CloudTablet::add_unused_rowsets(const std::vector<RowsetSharedPtr>&
rowsets) {
+ std::lock_guard<std::mutex> lock(_gc_mutex);
+ for (const auto& rowset : rowsets) {
+ _unused_rowsets[rowset->rowset_id()] = rowset;
+ }
+ g_unused_rowsets_count << rowsets.size();
Review Comment:
> also record size in bytes
done
--
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]