Skip to content

Commit a803940

Browse files
committed
review fixes
1 parent bb28321 commit a803940

File tree

2 files changed

+5
-2
lines changed
  • turbopack/crates
    • turbo-persistence-tools/src
    • turbo-persistence/src

2 files changed

+5
-2
lines changed

turbopack/crates/turbo-persistence-tools/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ fn main() -> Result<()> {
4040
} in meta_file.entries
4141
{
4242
println!(
43-
" SST {sequence_number:08}.sst: {} {min_hash:016x} - {max_hash:016x} (p = 1/{})",
44-
flags,
43+
" SST {sequence_number:08}.sst: {flags} {min_hash:016x} - {max_hash:016x} (p = \
44+
1/{})",
4545
u64::MAX / (max_hash - min_hash + 1)
4646
);
4747
println!(" AMQF {amqf_entries} entries = {} KiB", amqf_size / 1024);

turbopack/crates/turbo-persistence/src/db.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,8 @@ impl<S: ParallelScheduler, const FAMILIES: usize> TurboPersistence<S, FAMILIES>
846846
}
847847

848848
fn category(&self) -> u8 {
849+
// Cold and non-cold files are placed separately so we pass different category
850+
// values to ensure they are not merged together.
849851
if self.flags.cold() { 1 } else { 0 }
850852
}
851853
}
@@ -1335,6 +1337,7 @@ impl<S: ParallelScheduler, const FAMILIES: usize> TurboPersistence<S, FAMILIES>
13351337
/// Get a value from the database. Returns None if the key is not found. The returned value
13361338
/// might hold onto a block of the database and it should not be hold long-term.
13371339
pub fn get<K: QueryKey>(&self, family: usize, key: &K) -> Result<Option<ArcSlice<u8>>> {
1340+
debug_assert!(family < FAMILIES, "Family index out of bounds");
13381341
let hash = hash_key(key);
13391342
let inner = self.inner.read();
13401343
for meta in inner.meta_files.iter().rev() {

0 commit comments

Comments
 (0)