From 46071c615c9d346d1088f6f26beba086aecfbbaa Mon Sep 17 00:00:00 2001 From: Gavin Chou Date: Mon, 23 Dec 2024 21:21:23 +0800 Subject: [PATCH] [opt](log) Optimize compaction log to match output version (#44375) --- be/src/cloud/cloud_base_compaction.cpp | 7 ++++--- be/src/cloud/cloud_cumulative_compaction.cpp | 8 +++++--- be/src/cloud/cloud_tablet.cpp | 3 +++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/be/src/cloud/cloud_base_compaction.cpp b/be/src/cloud/cloud_base_compaction.cpp index 398cdb48d1c509..965361c12a35c9 100644 --- a/be/src/cloud/cloud_base_compaction.cpp +++ b/be/src/cloud/cloud_base_compaction.cpp @@ -268,8 +268,9 @@ Status CloudBaseCompaction::execute_compact() { << ", output_version=" << _output_version; return res; } - LOG_INFO("finish CloudBaseCompaction, tablet_id={}, cost={}ms", _tablet->tablet_id(), - duration_cast(steady_clock::now() - start).count()) + LOG_INFO("finish CloudBaseCompaction, tablet_id={}, cost={}ms range=[{}-{}]", + _tablet->tablet_id(), duration_cast(steady_clock::now() - start).count(), + _input_rowsets.front()->start_version(), _input_rowsets.back()->end_version()) .tag("job_id", _uuid) .tag("input_rowsets", _input_rowsets.size()) .tag("input_rows", _input_row_num) @@ -343,7 +344,7 @@ Status CloudBaseCompaction::modify_rowsets() { .tag("input_rowsets", _input_rowsets.size()) .tag("input_rows", _input_row_num) .tag("input_segments", _input_segments) - .tag("update_bitmap_size", output_rowset_delete_bitmap->delete_bitmap.size()); + .tag("num_output_delete_bitmap", output_rowset_delete_bitmap->delete_bitmap.size()); compaction_job->set_delete_bitmap_lock_initiator(initiator); } diff --git a/be/src/cloud/cloud_cumulative_compaction.cpp b/be/src/cloud/cloud_cumulative_compaction.cpp index 0807ebca43466c..8eb043b1fed4cc 100644 --- a/be/src/cloud/cloud_cumulative_compaction.cpp +++ b/be/src/cloud/cloud_cumulative_compaction.cpp @@ -204,8 +204,9 @@ Status CloudCumulativeCompaction::execute_compact() { << ", output_version=" << _output_version; return res; } - LOG_INFO("finish CloudCumulativeCompaction, tablet_id={}, cost={}ms", _tablet->tablet_id(), - duration_cast(steady_clock::now() - start).count()) + LOG_INFO("finish CloudCumulativeCompaction, tablet_id={}, cost={}ms, range=[{}-{}]", + _tablet->tablet_id(), duration_cast(steady_clock::now() - start).count(), + _input_rowsets.front()->start_version(), _input_rowsets.back()->end_version()) .tag("job_id", _uuid) .tag("input_rowsets", _input_rowsets.size()) .tag("input_rows", _input_row_num) @@ -299,7 +300,8 @@ Status CloudCumulativeCompaction::modify_rowsets() { .tag("input_rowsets", _input_rowsets.size()) .tag("input_rows", _input_row_num) .tag("input_segments", _input_segments) - .tag("update_bitmap_size", output_rowset_delete_bitmap->delete_bitmap.size()); + .tag("number_output_delete_bitmap", + output_rowset_delete_bitmap->delete_bitmap.size()); compaction_job->set_delete_bitmap_lock_initiator(initiator); } diff --git a/be/src/cloud/cloud_tablet.cpp b/be/src/cloud/cloud_tablet.cpp index 76cb9042af415d..b8ce83d1edb736 100644 --- a/be/src/cloud/cloud_tablet.cpp +++ b/be/src/cloud/cloud_tablet.cpp @@ -408,6 +408,9 @@ uint64_t CloudTablet::delete_expired_stale_rowsets() { auto rs_it = _stale_rs_version_map.find(v_ts->version()); if (rs_it != _stale_rs_version_map.end()) { expired_rowsets.push_back(rs_it->second); + LOG(INFO) << "erase stale rowset, tablet_id=" << tablet_id() + << " rowset_id=" << rs_it->second->rowset_id().to_string() + << " version=" << rs_it->first.to_string(); _stale_rs_version_map.erase(rs_it); } else { LOG(WARNING) << "cannot find stale rowset " << v_ts->version() << " in tablet "