From 4c9f9fc0b93540c4b78dd6b27a7badf32fb95872 Mon Sep 17 00:00:00 2001 From: Little-Wallace Date: Wed, 15 May 2024 15:32:09 +0800 Subject: [PATCH] fix format Signed-off-by: Little-Wallace --- src/meta/src/hummock/manager/compaction.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/meta/src/hummock/manager/compaction.rs b/src/meta/src/hummock/manager/compaction.rs index 8e313f94e34aa..6fc4300849a48 100644 --- a/src/meta/src/hummock/manager/compaction.rs +++ b/src/meta/src/hummock/manager/compaction.rs @@ -284,8 +284,8 @@ impl HummockManager { for input_ssts in &compact_task.input_ssts { for sst in &input_ssts.table_infos { existing_table_ids.extend(sst.table_ids.iter()); - if !sst.table_ids.is_empty() { - *table_size_info.entry(sst.table_ids[0]).or_default() += + for table_id in &sst.table_ids { + *table_size_info.entry(*table_id).or_default() += sst.file_size / (sst.table_ids.len() as u64); } } @@ -302,6 +302,7 @@ impl HummockManager { 1, params.checkpoint_frequency() * barrier_interval_ms / 1000, ); + // check latest write throughput let history_table_throughput = self.history_table_throughput.read(); for (table_id, compact_table_size) in table_size_info { let write_throughput = history_table_throughput @@ -317,6 +318,7 @@ impl HummockManager { || (compact_table_size > compaction_config.target_file_size_base && write_throughput > self.env.opts.table_write_throughput_threshold) { + // partition for large write throughput table. compact_task .table_vnode_partition .insert(table_id, hybrid_vnode_count);