Skip to content

Commit

Permalink
add log info
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 8, 2024
1 parent 557ad22 commit 2b27cf3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,17 +257,18 @@ impl LevelCompactionPicker {
ValidationRuleType::ToBase,
stats,
) {
if l0.total_file_size > target_level.total_file_size * 8 {
if l0.total_file_size > target_level.total_file_size * 4 {
let log_counter = LOG_COUNTER.with_borrow_mut(|counter| {
*counter += 1;
*counter
});

// reduce log
if log_counter % 100 == 0 {
tracing::warn!("skip task with level count: {}, file count: {}, select size: {}, target size: {}, target level size: {}",
if log_counter % 2 == 0 && result.input_levels.len() > 0 {
tracing::warn!("skip task with level count: {}, file count: {}, first level size: {}, select size, target size: {}, target level size: {}",
result.input_levels.len(),
result.total_file_count,
result.input_levels[0].table_infos.iter().map(|sst|sst.file_size).sum::<u64>(),
result.select_input_size,
result.target_input_size,
target_level.total_file_size,
Expand Down
12 changes: 7 additions & 5 deletions src/storage/src/hummock/sstable/multi_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,15 @@ where
// default
self.largest_vnode_in_current_partition = VirtualNode::MAX.to_index();
}
} else if let Some(builder) = self.current_builder.as_ref()
&& builder.approximate_len() > MIN_SST_SIZE
{
self.split_weight_by_vnode = 0;
} else {
self.last_table_id = user_key.table_id.table_id;
self.split_weight_by_vnode = 0;
self.largest_vnode_in_current_partition = VirtualNode::MAX.to_index();
switch_builder = true;
if let Some(builder) = self.current_builder.as_ref()
&& builder.approximate_len() > MIN_SST_SIZE
{
switch_builder = true;
}
}
}
if self.largest_vnode_in_current_partition != VirtualNode::MAX.to_index() {
Expand Down

0 comments on commit 2b27cf3

Please sign in to comment.