wyxxxcat commented on code in PR #52709:
URL: https://github.com/apache/doris/pull/52709#discussion_r2189933174
##########
cloud/src/recycler/recycler.cpp:
##########
@@ -2381,23 +2394,31 @@ int InstanceRecycler::recycle_rowsets() {
return 0;
}
if (!rowset.has_type()) {
- if (!rowset.has_resource_id()) [[unlikely]] {
- return 0;
- }
- if (rowset.resource_id().empty()) [[unlikely]] {
+ if (!rowset.has_resource_id() || rowset.resource_id().empty())
[[unlikely]] {
return 0;
}
+ auto rowset_meta = rowset.rowset_meta();
+ metrics_context.total_need_recycle_data_size +=
rowset_meta.total_disk_size();
+ metrics_context.total_recycled_num++;
+ segment_metrics_context_.total_need_recycle_num +=
rowset_meta.num_segments();
+ segment_metrics_context_.total_need_recycle_data_size +=
rowset_meta.total_disk_size();
return 0;
}
- auto* rowset_meta = rowset.mutable_rowset_meta();
- if (!rowset_meta->has_resource_id()) [[unlikely]] {
+ auto rowset_meta = rowset.mutable_rowset_meta();
+ if (!rowset_meta->has_resource_id()) [[unlikely]] { // impossible
if (rowset.type() == RecycleRowsetPB::PREPARE ||
rowset_meta->num_segments() != 0) {
return 0;
}
}
- if (rowset.type() != RecycleRowsetPB::PREPARE) {
- if (rowset_meta->num_segments() > 0) {
- metrics_context.total_need_recycle_num++;
+
+ if (rowset.type() == RecycleRowsetPB::PREPARE) {
Review Comment:
没有 segment 的话,回收的时候是不会统计这部分 rowset 的
```
int64_t num_segments = rs.num_segments();
if (num_segments <= 0) continue;
```
--
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]