diff --git a/src/meta/src/hummock/manager/commit_epoch.rs b/src/meta/src/hummock/manager/commit_epoch.rs index 8d872813989ed..cc06f65ffc8b1 100644 --- a/src/meta/src/hummock/manager/commit_epoch.rs +++ b/src/meta/src/hummock/manager/commit_epoch.rs @@ -18,7 +18,7 @@ use std::sync::Arc; use risingwave_common::catalog::TableId; use risingwave_hummock_sdk::change_log::ChangeLogDelta; -use risingwave_hummock_sdk::compaction_group::group_split::split_sst; +use risingwave_hummock_sdk::compaction_group::group_split::{self, split_sst}; use risingwave_hummock_sdk::sstable_info::SstableInfo; use risingwave_hummock_sdk::table_stats::{ add_prost_table_stats_map, purge_prost_table_stats, to_prost_table_stats_map, PbTableStatsMap, @@ -477,7 +477,9 @@ impl HummockManager { for (mut sst, group_table_ids) in sst_to_cg_vec { for (group_id, match_ids) in group_table_ids { let group_members_table_ids = group_members_table_ids.get(&group_id).unwrap(); - if match_ids + if sst + .sst_info + .table_ids .iter() .all(|id| group_members_table_ids.contains(&TableId::new(*id))) { @@ -504,7 +506,6 @@ impl HummockManager { split_key, origin_sst_size - new_sst_size, new_sst_size, - // match_ids, ); commit_sstables diff --git a/src/meta/src/hummock/manager/compaction/compaction_group_schedule.rs b/src/meta/src/hummock/manager/compaction/compaction_group_schedule.rs index 9f14bfc54e560..391b0431a25c3 100644 --- a/src/meta/src/hummock/manager/compaction/compaction_group_schedule.rs +++ b/src/meta/src/hummock/manager/compaction/compaction_group_schedule.rs @@ -824,9 +824,11 @@ pub fn is_table_low_write_throughput( if let Some(history) = table_write_throughput.get(&table_id) { // Determine if 2/3 of the values in the interval below the threshold. let mut low_write_throughput_count = 0; - for throughput in history.iter().skip(history.len() - window_size) { - if *throughput / checkpoint_secs < threshold { - low_write_throughput_count += 1; + if history.len() >= window_size { + for throughput in history.iter().skip(history.len() - window_size) { + if *throughput / checkpoint_secs < threshold { + low_write_throughput_count += 1; + } } }