Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin-j97 committed Sep 13, 2024
1 parent 05c1ff2 commit dc041d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/value_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ impl<C: Compressor + Clone> ValueLog<C> {
report.total_bytes += total_bytes;
report.total_blobs += total_items;

if size_map.contains_key(&id) {
if counter.item_count > 0 {
let used_size = counter.size;
let alive_item_count = counter.item_count;

Expand All @@ -417,13 +417,13 @@ impl<C: Compressor + Clone> ValueLog<C> {
log::debug!(
"Blob file #{id} has no incoming references - can be dropped, freeing {} KiB on disk (userdata={} MiB)",
segment.meta.compressed_bytes / 1_024,
segment.meta.total_uncompressed_bytes / 1_024/ 1_024
total_bytes / 1_024/ 1_024
);
self.mark_as_stale(&[id]);

report.stale_segment_count += 1;
report.stale_bytes += segment.meta.total_uncompressed_bytes;
report.stale_blobs += segment.meta.item_count;
report.stale_bytes += total_bytes;
report.stale_blobs += total_items;
}
}

Expand Down

0 comments on commit dc041d1

Please sign in to comment.