Skip to content

Commit

Permalink
only check block count
Browse files Browse the repository at this point in the history
Signed-off-by: Little-Wallace <[email protected]>
  • Loading branch information
Little-Wallace committed Jun 19, 2023
1 parent b82ee1c commit 5212c20
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/storage/src/hummock/event_handler/cache_refill_policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,15 @@ impl CacheRefillPolicy {
ssts.extend(level_delta.inserted_table_infos.clone());
}
}

if hit_count > 0 || is_l0_compact {
for sst in &ssts {
flatten_reqs.push(self.sstable_store.sstable(sst, &mut stats));
}
}

if is_l0_compact && is_base_level_compact && hit_count > 0 {
ssts.retain(|sst| self.sstable_store.lookup_sstable(&sst.object_id).is_none());
let mut sstable_iters = vec![];
for d in &group_delta.group_deltas {
if let Some(group_delta::DeltaType::IntraLevel(level_delta)) =
Expand Down Expand Up @@ -146,7 +148,7 @@ async fn preload_l1_data(
}
}

const MIN_OVERLAP_HOT_BLOCK_COUNT: usize = 4;
const MIN_OVERLAP_HOT_BLOCK_COUNT: usize = 32;
for sst in insert_ssts {
let key_range = sst.key_range.as_ref().unwrap();
let mut replace_hot_block = 0;
Expand Down Expand Up @@ -192,13 +194,6 @@ async fn preload_l1_data(
continue;
}
let sstable = sstable_store.sstable(&sst, &mut stats).await?;
if replace_hot_block < sstable.value().meta.block_metas.len() / 20 {
info!(
"skip prefetch for sst-{} hot blocks: {}",
sst.sst_id, replace_hot_block
);
continue;
}
let mut smallest_key = sstable.value().meta.largest_key.clone();
let mut largest_key = sstable.value().meta.smallest_key.clone();
for info in &removed_sstables {
Expand Down

0 comments on commit 5212c20

Please sign in to comment.