From 3ff904be13de1471537d6faca0644e0a695cc0a5 Mon Sep 17 00:00:00 2001 From: csun5285 Date: Mon, 18 Nov 2024 20:17:23 +0800 Subject: [PATCH] fix --- be/src/cloud/cloud_base_compaction.cpp | 1 + cloud/src/meta-service/meta_service_tablet_stats.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/be/src/cloud/cloud_base_compaction.cpp b/be/src/cloud/cloud_base_compaction.cpp index 850cf1acbb1d405..9742e57dcf9d34d 100644 --- a/be/src/cloud/cloud_base_compaction.cpp +++ b/be/src/cloud/cloud_base_compaction.cpp @@ -125,6 +125,7 @@ Status CloudBaseCompaction::prepare_compact() { _input_row_num += rs->num_rows(); _input_segments += rs->num_segments(); _input_rowsets_data_size += rs->data_disk_size(); + _input_rowsets_index_size += rs->index_disk_size(); _input_rowsets_total_size += rs->total_disk_size(); } LOG_INFO("start CloudBaseCompaction, tablet_id={}, range=[{}-{}]", _tablet->tablet_id(), diff --git a/cloud/src/meta-service/meta_service_tablet_stats.cpp b/cloud/src/meta-service/meta_service_tablet_stats.cpp index db753a864cceab9..4cbf629c9a31854 100644 --- a/cloud/src/meta-service/meta_service_tablet_stats.cpp +++ b/cloud/src/meta-service/meta_service_tablet_stats.cpp @@ -260,14 +260,20 @@ MetaServiceResponseStatus fix_tablet_stats_internal( return st; } int64_t total_disk_size = 0; + int64_t index_disk_size = 0; + int64_t data_disk_size = 0; for (const auto& rs_meta : resp.rowset_meta()) { total_disk_size += rs_meta.total_disk_size(); + index_disk_size += rs_meta.index_disk_size(); + data_disk_size += rs_meta.data_disk_size(); } // set new disk size to tabletPB and write it back TabletStatsPB tablet_stat; tablet_stat.CopyFrom(*tablet_stat_ptr); tablet_stat.set_data_size(total_disk_size); + tablet_stat.set_index_size(index_disk_size); + tablet_stat.set_segment_size(data_disk_size); // record tablet stats batch tablet_stat_shared_ptr_vec_batch.emplace_back(std::make_shared(tablet_stat)); std::string tablet_stat_key;