Skip to content

Commit

Permalink
fix score
Browse files Browse the repository at this point in the history
Signed-off-by: Little-Wallace <[email protected]>
  • Loading branch information
Little-Wallace committed Oct 25, 2023
1 parent dc4445f commit 199038a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,6 @@ impl LevelCompactionPicker {
level_handlers: &[LevelHandler],
stats: &mut LocalPickerStatistic,
) -> Option<CompactionInput> {
if l0.sub_levels.len() < 1 || l0.sub_levels[0].vnode_partition_count < vnode_partition_count
{
return None;
}

let overlap_strategy = create_overlap_strategy(self.config.compaction_mode());
let min_compaction_bytes = self.config.sub_level_max_compaction_bytes;
let non_overlap_sub_level_picker = NonOverlapSubLevelPicker::new(
Expand Down
13 changes: 12 additions & 1 deletion src/meta/src/hummock/compaction/selector/level_selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,18 @@ impl DynamicLevelSelectorCore {
// range at each level, so the number of levels is the most important factor affecting
// the read performance. At the same time, the size factor is also added to the score
// calculation rule to avoid unbalanced compact task due to large size.
let total_size = levels.l0.as_ref().unwrap().total_file_size
let total_size = levels
.l0
.as_ref()
.unwrap()
.sub_levels
.iter()
.filter(|level| {
level.vnode_partition_count == levels.vnode_partition_count
&& level.level_type() == LevelType::Nonoverlapping
})
.map(|level| level.total_file_size)
.sum::<u64>()
- handlers[0].get_pending_output_file_size(ctx.base_level as u32);
let base_level_size = levels.get_level(ctx.base_level).total_file_size;
let base_level_sst_count = levels.get_level(ctx.base_level).table_infos.len() as u64;
Expand Down

0 comments on commit 199038a

Please sign in to comment.