Skip to content

Commit 4d24268

Browse files
committed
Revert "remove logging"
This reverts commit a2cacfe.
1 parent 4c25201 commit 4d24268

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

turbopack/crates/turbo-persistence/src/compaction/selector.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,11 @@ mod tests {
283283

284284
for _ in 0..100 {
285285
let coverage = total_coverage(&containers, (0, 10000));
286+
println!(
287+
"{containers:#?} coverage: {}, items: {}",
288+
coverage,
289+
containers.len()
290+
);
286291

287292
if coverage > 10.0 {
288293
let config = CompactConfig {
@@ -291,9 +296,13 @@ mod tests {
291296
};
292297
let jobs = get_compaction_jobs(&containers, &config);
293298
if !jobs.is_empty() {
299+
println!("{jobs:?}");
300+
294301
do_compact(&mut containers, jobs);
295302
number_of_compactions += 1;
296303
}
304+
} else {
305+
println!("No compaction needed");
297306
}
298307

299308
// Modify warm keys
@@ -306,6 +315,7 @@ mod tests {
306315
swap(&mut warm_keys[i], &mut keys[j]);
307316
}
308317
}
318+
println!("Number of compactions: {}", number_of_compactions);
309319

310320
assert!(containers.len() < 40);
311321
let coverage = total_coverage(&containers, (0, 10000));

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ impl<K: StoreKey + Send + Sync, const FAMILIES: usize> WriteBatch<K, FAMILIES> {
174174
let mut new_blob_files = Vec::new();
175175
let shared_error = Mutex::new(Ok(()));
176176

177+
println!("finish write batch");
178+
177179
// First, we flush all thread local collectors to the global collectors.
178180
scope(|scope| {
179181
let mut collectors = [const { Vec::new() }; FAMILIES];
@@ -203,6 +205,8 @@ impl<K: StoreKey + Send + Sync, const FAMILIES: usize> WriteBatch<K, FAMILIES> {
203205
}
204206
});
205207

208+
println!("flushed thread local collectors");
209+
206210
// Now we reduce the global collectors in parallel
207211
let shared_new_sst_files = Mutex::new(&mut new_sst_files);
208212

@@ -231,6 +235,8 @@ impl<K: StoreKey + Send + Sync, const FAMILIES: usize> WriteBatch<K, FAMILIES> {
231235
anyhow::Ok(())
232236
})?;
233237

238+
println!("flushed collectors");
239+
234240
shared_error.into_inner()?;
235241
let seq = self.current_sequence_number.load(Ordering::SeqCst);
236242
new_sst_files.sort_by_key(|(seq, _)| *seq);

0 commit comments

Comments
 (0)