Skip to content

Commit

Permalink
revert some changes
Browse files Browse the repository at this point in the history
Signed-off-by: Little-Wallace <[email protected]>
  • Loading branch information
Little-Wallace committed May 28, 2024
1 parent e79e071 commit a99f3fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ impl CompactionTaskValidationRule for BaseCompactionTaskValidationRule {
return true;
}

if input.select_input_size < 2 * input.target_input_size {
if input.select_input_size < input.target_input_size {
stats.skip_by_write_amp_limit += 1;
return false;
}
Expand Down
31 changes: 11 additions & 20 deletions src/meta/src/hummock/manager/compaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1507,27 +1507,18 @@ impl HummockManager {
compact_task
.table_vnode_partition
.insert(table_id, default_partition_count);
} else if (compact_table_size > compact_task_table_size_partition_threshold_low
|| (write_throughput > self.env.opts.table_write_throughput_threshold
&& compact_table_size > compaction_config.target_file_size_base))
&& hybrid_vnode_count > 0
{
// partition for large write throughput table. But we also need to make sure that it can not be too small.
compact_task
.table_vnode_partition
.insert(table_id, hybrid_vnode_count);
} else if compact_table_size > compaction_config.target_file_size_base {
if write_throughput > self.env.opts.table_write_throughput_threshold
&& compact_table_size > compact_task_table_size_partition_threshold_low
&& compact_task.base_level == compact_task.target_level
&& default_partition_count > 0
{
// Because the task to base level may be small, we shall partition it if the write throughput is high.
compact_task
.table_vnode_partition
.insert(table_id, default_partition_count);
} else if write_throughput > self.env.opts.table_write_throughput_threshold
|| compact_table_size > compact_task_table_size_partition_threshold_low
{
// partition for large write throughput table. But we also need to make sure that it can not be too small.
compact_task
.table_vnode_partition
.insert(table_id, hybrid_vnode_count);
} else {
// partition for small table
compact_task.table_vnode_partition.insert(table_id, 1);
}
// partition for small table
compact_task.table_vnode_partition.insert(table_id, 1);
}
}
compact_task
Expand Down

0 comments on commit a99f3fa

Please sign in to comment.