Skip to content

Commit

Permalink
Missed a case
Browse files Browse the repository at this point in the history
  • Loading branch information
ylow committed Jan 24, 2025
1 parent 4917063 commit 3e6b92c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion data/src/clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ impl Cleaner {

// check the fragmentation state and if it is pretty fragmented
// we skip dedupe
let mut forced_nodedupe = false;
if let Some((n_deduped, _)) = dedupe_query {
if let Some(chunks_per_range) = tracking_info.rolling_chunks_per_range() {
if chunks_per_range < MIN_N_CHUNKS_PER_RANGE {
Expand All @@ -507,6 +508,7 @@ impl Cleaner {
// the chunks per range and so we skip it.
if (n_deduped as f32) < chunks_per_range {
dedupe_query = None;
forced_nodedupe = true;
}
}
}
Expand Down Expand Up @@ -548,7 +550,8 @@ impl Cleaner {
// This is new data.
let add_new_data;

if let Some(idx) = tracking_info.current_cas_block_hashes.get(&chunk.hash) {
if tracking_info.current_cas_block_hashes.get(&chunk.hash).is_some() && !forced_nodedupe {
let idx = tracking_info.current_cas_block_hashes.get(&chunk.hash).unwrap();
let idx = *idx;
// This chunk will get the CAS hash updated when the local CAS block
// is full and registered.
Expand Down

0 comments on commit 3e6b92c

Please sign in to comment.