github-actions[bot] commented on code in PR #68005:
URL: https://github.com/apache/doris/pull/68005#discussion_r4358095850
##########
cloud/src/recycler/recycler.cpp:
##########
@@ -6585,6 +6833,14 @@ int InstanceRecycler::recycle_rowset_meta_and_data(const
RowsetDeleteTask& task)
LOG_WARNING("failed to recycle rowset meta and data").tag("err",
err);
return -1;
}
+ if (ref_count == 1) {
+ segment_metrics_context_.recycled_num +=
rowset_meta.num_segments();
+ g_bvar_recycler_instance_recycle_total_num_since_started.put(
+ {instance_id_, "recycle_segment"},
rowset_meta.num_segments());
+ segment_metrics_context_.recycled_bytes += recycled_bytes;
Review Comment:
[P2] Count packed storage only when its object is deleted
For an expired versioned rowset with ref_count=1 whose segment is packed
together with a live rowset, delete_rowset_data(rowset_meta) only marks its
slice deleted. The packed object retains another live slice, and
add_file_to_delete_if_not_packed leaves the standalone deletion list empty;
S3Accessor::delete_files(empty) returns success without deleting an object.
These new additions nevertheless charge the full num_segments/total_disk_size
to recycle_segment, including instance_current_round_recycled_object_bytes and
cumulative bytes. This occurs on the ordinary versioned-rowset path with every
transaction succeeding, separately from the existing
dropped-tablet/shared-rowset thread. Carry actual physical deletion results out
of the helpers and account packed bytes when the packed object is removed.
##########
cloud/src/recycler/recycler_operation_log.cpp:
##########
@@ -833,8 +833,9 @@ int InstanceRecycler::recycle_operation_logs() {
recycled_operation_logs++;
recycled_operation_log_data_size += value_size;
- metrics_context.total_recycled_num++;
- metrics_context.total_recycled_data_size += value_size;
+ metrics_context.kv_recycled_num++;
Review Comment:
[P2] Preserve recycled-byte publication for operation logs
After successfully recycling a nonempty operation log, this branch now
updates only the number metrics. Previously total_recycled_data_size plus
report()/finish_report() published last-round and cumulative recycled bytes.
RecyclerMetricsContext no longer has a byte field or byte publisher, and the
only remaining last-round byte publisher is the tablet/segment resource
context. Thus the still-declared and documented recycle_operation_logs byte
series stop appearing/advancing despite successful deletion; the local
recycled_operation_log_data_size is only logged. Preserve both byte series
using the already collected successful-log sizes, including successes before a
later error.
##########
cloud/src/recycler/recycler.cpp:
##########
@@ -2690,6 +2796,10 @@ int InstanceRecycler::recycle_ref_rowsets(bool*
has_unrecycled_rowsets) {
// Phase 1: Scan to collect all tablet_ids that have rowset ref counts
std::set<int64_t> tablets_with_refs;
int64_t num_scanned = 0;
+ RecyclerMetricsContext metrics_context(instance_id_, task_name);
Review Comment:
[P2] Publish referenced-rowset task progress and cleanup outcomes
For a deleted snapshot-enabled instance, a scanned load/compact rowset with
ref_count=1 can be deleted by recycle_versioned_tablet() and have its ref-count
KV removed by cleanup_rowset_metadata(), but this new task context never
receives an expired/recycled increment or cumulative task-number update. Its
only assignment sets kv_scanned_num in the exit defer, and finish() resets
current metrics without publishing that value. Consequently all three new
current-round recycle_ref_rowsets gauges remain zero even while reference KVs
are successfully cleaned up. Carry eligible and committed ref-key outcomes into
this context and publish at completed boundaries, keeping the units as ref KVs
rather than tablets or shared-reference decrements.
--
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]