Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(ci): ignore me #11630

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,13 @@ pub mod default {
pub fn level0_max_compact_file_number() -> u64 {
DEFAULT_MAX_COMPACTION_FILE_COUNT
}

pub fn large_group_max_bytes_for_level_base() -> u64 {
DEFAULT_MAX_BYTES_FOR_LEVEL_BASE * 4
}
pub fn large_group_sub_level_max_compaction_bytes() -> u64 {
DEFAULT_MIN_COMPACTION_BYTES * 3
}
}

pub mod s3_objstore_config {
Expand Down Expand Up @@ -1347,6 +1354,11 @@ pub struct CompactionConfig {
pub max_space_reclaim_bytes: u64,
#[serde(default = "default::compaction_config::level0_max_compact_file_number")]
pub level0_max_compact_file_number: u64,

#[serde(default = "default::compaction_config::large_group_max_bytes_for_level_base")]
pub large_group_max_bytes_for_level_base: u64,
#[serde(default = "default::compaction_config::large_group_sub_level_max_compaction_bytes")]
pub large_group_sub_level_max_compaction_bytes: u64,
}

#[cfg(test)]
Expand Down
2 changes: 2 additions & 0 deletions src/config/example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ level0_sub_level_compact_level_count = 3
level0_overlapping_sub_level_compact_level_count = 6
max_space_reclaim_bytes = 536870912
level0_max_compact_file_number = 96
large_group_max_bytes_for_level_base = 2147483648
large_group_sub_level_max_compaction_bytes = 402653184

[batch]
enable_barrier_read = true
Expand Down
2 changes: 1 addition & 1 deletion src/meta/src/hummock/compaction/level_selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ impl DynamicLevelSelectorCore {
.count() as u64;
let non_overlapping_level_score = non_overlapping_level_count * SCORE_BASE
/ std::cmp::max(
base_level_sst_count / 16,
base_level_sst_count / 8,
self.config.level0_sub_level_compact_level_count as u64,
);

Expand Down
6 changes: 0 additions & 6 deletions src/meta/src/hummock/compaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,6 @@ pub fn create_compaction_task(
) -> CompactionTask {
let target_file_size = if input.target_level == 0 {
compaction_config.target_file_size_base
} else if input.target_level == base_level {
// This is just a temporary optimization measure. We hope to reduce the size of SST as much
// as possible to reduce the amount of data blocked by a single task during compaction,
// but too many files will increase computing overhead.
// TODO: remove it after can reduce configuration `target_file_size_base`.
compaction_config.target_file_size_base / 4
} else {
assert!(input.target_level >= base_level);
let step = (input.target_level - base_level) / 2;
Expand Down
32 changes: 21 additions & 11 deletions src/meta/src/hummock/compaction/overlap_strategy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ pub trait OverlapInfo {
fn check_overlap(&self, a: &SstableInfo) -> bool;
fn check_multiple_overlap(&self, others: &[SstableInfo]) -> Range<usize>;
fn check_multiple_include(&self, others: &[SstableInfo]) -> Range<usize>;
fn update(&mut self, table: &SstableInfo);
fn update(&mut self, table: &SstableInfo) {
let other = table.key_range.as_ref().unwrap();
self.update_key_range(other);
}
fn update_key_range(&mut self, table: &KeyRange);
}

pub trait OverlapStrategy: Send + Sync {
Expand All @@ -45,6 +49,7 @@ pub trait OverlapStrategy: Send + Sync {
others[range].to_vec()
}
}

fn check_overlap_with_tables(
&self,
tables: &[SstableInfo],
Expand Down Expand Up @@ -112,19 +117,25 @@ impl OverlapInfo for RangeOverlapInfo {
fn check_multiple_include(&self, others: &[SstableInfo]) -> Range<usize> {
match self.target_range.as_ref() {
Some(key_range) => {
let overlap_begin = others.partition_point(|table_status| {
KeyComparator::compare_encoded_full_key(
&table_status.key_range.as_ref().unwrap().left,
&key_range.left,
) == cmp::Ordering::Less
let overlap_begin = others.partition_point(|sst| {
let ord = if key_range.left.is_empty() {
cmp::Ordering::Greater
} else {
KeyComparator::compare_encoded_full_key(
&sst.key_range.as_ref().unwrap().left,
&key_range.left,
)
};
ord == cmp::Ordering::Less
});
if overlap_begin >= others.len() {
return overlap_begin..overlap_begin;
}
let mut overlap_end = overlap_begin;
for table in &others[overlap_begin..] {
if key_range.compare_right_with(&table.key_range.as_ref().unwrap().right)
== cmp::Ordering::Less
for sst in &others[overlap_begin..] {
if !key_range.right.is_empty()
&& key_range.compare_right_with(&sst.key_range.as_ref().unwrap().right)
== cmp::Ordering::Less
{
break;
}
Expand All @@ -136,8 +147,7 @@ impl OverlapInfo for RangeOverlapInfo {
}
}

fn update(&mut self, table: &SstableInfo) {
let other = table.key_range.as_ref().unwrap();
fn update_key_range(&mut self, other: &KeyRange) {
if let Some(range) = self.target_range.as_mut() {
range.full_key_extend(other);
return;
Expand Down
Loading