Skip to content

Commit ee1d43b

Browse files
committed
Remove excess logging
1 parent c8c9e94 commit ee1d43b

File tree

4 files changed

+6
-135
lines changed

4 files changed

+6
-135
lines changed

oxcache/src/device.rs

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,6 @@ fn check_first_evict_bench() {
216216
}
217217

218218
fn trigger_eviction(eviction_channel: Sender<EvictorMessage>) -> io::Result<()> {
219-
tracing::info!(
220-
"[trigger_eviction] Thread {:?} triggering eviction and BLOCKING for response",
221-
std::thread::current().id()
222-
);
223219
let (resp_tx, resp_rx) = flume::bounded(1);
224220
if let Err(e) = eviction_channel.send(EvictorMessage { sender: resp_tx }) {
225221
tracing::error!("[append] Failed to send eviction message: {}", e);
@@ -229,18 +225,9 @@ fn trigger_eviction(eviction_channel: Sender<EvictorMessage>) -> io::Result<()>
229225
));
230226
};
231227

232-
tracing::info!(
233-
"[trigger_eviction] Thread {:?} WAITING for eviction response...",
234-
std::thread::current().id()
235-
);
236228
match resp_rx.recv() {
237229
Ok(result) => match result {
238-
Ok(_) => {
239-
tracing::info!(
240-
"[trigger_eviction] Thread {:?} eviction completed successfully, UNBLOCKING",
241-
std::thread::current().id()
242-
);
243-
}
230+
Ok(_) => { }
244231
Err(e) => {
245232
tracing::error!(
246233
"[trigger_eviction] Thread {:?} eviction FAILED: {}",
@@ -292,21 +279,13 @@ impl Zoned {
292279
},
293280
Err(error) => match error {
294281
ZoneObtainFailure::EvictNow => {
295-
tracing::warn!("[get_free_zone] Thread {:?} got EvictNow (is_eviction={})",
296-
std::thread::current().id(), is_eviction);
297282
Err(io::Error::new(ErrorKind::StorageFull, "Cache is full"))
298283
}
299284
ZoneObtainFailure::Wait => {
300-
tracing::info!("[get_free_zone] Thread {:?} entering condvar wait (is_eviction={}, free={}, open={})",
301-
std::thread::current().id(), is_eviction, zone_list.free_zones.len(), zone_list.open_zones.len());
302285
loop {
303286
zone_list = wait_notify.wait(zone_list).unwrap();
304-
tracing::info!("[get_free_zone] Thread {:?} woke up from condvar (is_eviction={}, free={}, open={})",
305-
std::thread::current().id(), is_eviction, zone_list.free_zones.len(), zone_list.open_zones.len());
306287
match zone_list.remove_with_eviction_bypass(is_eviction) {
307288
Ok(idx) => {
308-
tracing::info!("[get_free_zone] Thread {:?} got zone {} after wait",
309-
std::thread::current().id(), idx);
310289
return Ok(idx);
311290
},
312291
Err(err) => match err {
@@ -316,8 +295,6 @@ impl Zoned {
316295
return Err(io::Error::new(ErrorKind::Other, "Cache is full"));
317296
}
318297
ZoneObtainFailure::Wait => {
319-
tracing::info!("[get_free_zone] Thread {:?} needs to wait again",
320-
std::thread::current().id());
321298
continue;
322299
},
323300
},
@@ -342,12 +319,7 @@ impl Zoned {
342319
// come and try to open a new zone if needed.
343320
// Skip notification during eviction batch writes to avoid race condition
344321
if !suppress_notify {
345-
tracing::info!("[complete_write] Zone {} finished, notifying ALL waiters (free={}, open={})",
346-
zone_idx, zone_list.free_zones.len(), zone_list.open_zones.len());
347322
notify.notify_all();
348-
} else {
349-
tracing::info!("[complete_write] Zone {} finished during eviction, SUPPRESSING notify (free={}, open={})",
350-
zone_idx, zone_list.free_zones.len(), zone_list.open_zones.len());
351323
}
352324

353325
Ok(())
@@ -735,7 +707,6 @@ impl Device for Zoned {
735707
// Remove from open_zones so no new chunks can be allocated from this zone
736708
zones.open_zones.retain(|z| z != zone);
737709
}
738-
tracing::info!("[Evict:Chunk] Locked {} zones for cleaning", clean_locations.len());
739710
}
740711

741712
// Cleaning
@@ -791,12 +762,6 @@ impl Device for Zoned {
791762
// Writer callback
792763
|payloads: Vec<(CacheKey, bytes::Bytes)>| {
793764
async move {
794-
tracing::info!(
795-
"[evict:Chunk] Starting zone {} cleaning, {} valid chunks to relocate",
796-
zone,
797-
payloads.len()
798-
);
799-
800765
// Remove old LRU entries FIRST, before reset_zone makes the zone available again
801766
// This prevents relocated chunks from being accidentaly added then removed
802767
{
@@ -813,11 +778,7 @@ impl Device for Zoned {
813778
.unwrap();
814779
let (zone_mtx, cv) = &*self_clone.zones;
815780
let mut zones = zone_mtx.lock().unwrap();
816-
tracing::info!("[evict:Chunk] Resetting zone {} (free={}, open={} before reset)",
817-
zone, zones.free_zones.len(), zones.open_zones.len());
818781
zones.reset_zone(*zone, &*self_clone)?;
819-
tracing::info!("[evict:Chunk] Zone {} reset complete (free={}, open={} after reset)",
820-
zone, zones.free_zones.len(), zones.open_zones.len());
821782
cv
822783
}; // Drop the mutex, so we don't have to put it in an await
823784

@@ -827,17 +788,13 @@ impl Device for Zoned {
827788
let data_vec: Vec<_> =
828789
payloads.iter().map(|(_, data)| data.clone()).collect();
829790

830-
// Used to verify no RACE, TODO: Remove!
831-
// tokio::time::sleep(Duration::from_secs(5)).await;
832-
833791
let (batch_tx, batch_rx) = flume::bounded(1);
834792

835793
let batch_request = BatchWriteRequest {
836794
data: data_vec,
837795
responder: batch_tx,
838796
};
839797

840-
tracing::info!("[evict:Chunk] Sending batch write for zone {} with {} chunks", zone, batch_request.data.len());
841798
writer_pool.send_priority_batch(batch_request).await?;
842799

843800
let batch_response =
@@ -866,12 +823,6 @@ impl Device for Zoned {
866823

867824
let write_results = write_results?;
868825

869-
tracing::info!(
870-
"[evict:Chunk] Batch write completed for zone {}, {} chunks written, notifying ALL waiters",
871-
zone,
872-
write_results.len()
873-
);
874-
875826
// Notify waiting writers AFTER batch write completes successfully
876827
cv.notify_all();
877828

oxcache/src/eviction.rs

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ impl EvictionPolicy for ChunkEvictionPolicy {
298298
);
299299

300300
if !always_evict && lru_len < high_water_mark {
301-
tracing::info!("[ChunkPolicy] Below high water mark, no eviction needed");
302301
return vec![];
303302
}
304303

@@ -310,7 +309,6 @@ impl EvictionPolicy for ChunkEvictionPolicy {
310309
}
311310

312311
let count_to_evict = lru_len - low_water_mark;
313-
tracing::info!("[ChunkPolicy] Will evict {} chunks", count_to_evict);
314312

315313
let mut targets = Vec::with_capacity(count_to_evict as usize);
316314
let mut zone_counts = std::collections::HashMap::new();
@@ -331,12 +329,6 @@ impl EvictionPolicy for ChunkEvictionPolicy {
331329
self.pq.modify_priority(zone, count);
332330
}
333331

334-
tracing::info!(
335-
"[ChunkPolicy] Evicted {} chunks, LRU now has {} entries",
336-
targets.len(),
337-
self.lru.len()
338-
);
339-
340332
#[cfg(feature = "eviction-metrics")]
341333
if let Some(ref metrics) = self.metrics {
342334
metrics.record_chunk_evictions(&targets);
@@ -346,37 +338,24 @@ impl EvictionPolicy for ChunkEvictionPolicy {
346338
}
347339

348340
fn get_clean_targets(&mut self, _force_clean: bool) -> Self::CleanTarget {
349-
// Always use threshold-based cleaning (simpler, no force mode needed)
350-
let clean_targets = self.pq.remove_if_thresh_met(false);
341+
let clean_targets = self.pq.remove_if_thresh_met();
351342

352343
if clean_targets.is_empty() {
353-
tracing::info!("[ChunkPolicy] No zones meet cleaning threshold");
354344
return clean_targets;
355345
}
356346

357-
tracing::info!(
358-
"[ChunkPolicy] Will clean {} zones based on priority queue",
359-
clean_targets.len()
360-
);
361-
362347
clean_targets
363348
}
364349
}
365350

366351
impl ChunkEvictionPolicy {
367352
/// Remove old LRU entries after chunks are relocated during zone cleaning.
368-
/// Note: New entries are automatically added by writer pool calling write_update()
369353
pub fn chunks_relocated(&mut self, old_locations: &[ChunkLocation]) {
370354
for old_loc in old_locations {
371355
// Remove stale entry from LRU
372356
// The relocated chunk's new location is already in LRU via write_update()
373357
self.lru.remove(old_loc);
374358
}
375-
376-
tracing::debug!(
377-
"[ChunkPolicy] Removed {} old LRU entries after relocation",
378-
old_locations.len()
379-
);
380359
}
381360
}
382361

@@ -427,9 +406,7 @@ impl Evictor {
427406
}
428407
};
429408

430-
tracing::info!("[Evictor] Starting eviction (always_evict={})", always_evict);
431409
let device_clone = device_clone.clone();
432-
let eviction_start = std::time::Instant::now();
433410
let result = match device_clone.evict(
434411
cache_clone.clone(),
435412
writer_pool.clone(),
@@ -445,8 +422,6 @@ impl Evictor {
445422
Ok(())
446423
},
447424
};
448-
let eviction_duration = eviction_start.elapsed();
449-
tracing::info!("[Evictor] Total eviction took {:?}", eviction_duration);
450425

451426
if let Some(sender) = sender {
452427
tracing::debug!("Sending eviction response to sender: {:?}", result);

oxcache/src/writerpool.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ impl Writer {
116116
}
117117
fn receive_priority(&self) {
118118
while let Ok(batch_msg) = self.priority_receiver.recv() {
119-
tracing::info!("[WriterPool] Priority-only writer {} received batch request", self.id);
120119
self.process_batch_request(batch_msg);
121120
}
122121
}
@@ -184,20 +183,12 @@ impl Writer {
184183

185184
fn process_batch_request(&self, batch_req: BatchWriteRequest) {
186185
let data_len = batch_req.data.len(); // Store length before moving
187-
tracing::info!("[WriterPool] Priority writer {} starting batch of {} chunks", self.id, data_len);
188186
let mut locations = Vec::with_capacity(data_len);
189187

190188
for (i, data) in batch_req.data.into_iter().enumerate() {
191-
tracing::info!("[WriterPool] Priority writer {} processing chunk {}/{}", self.id, i+1, data_len);
192189
// Use eviction bypass for priority batch requests (eviction writes)
193190
let result = self.device.append_with_eviction_bypass(data, true);
194191

195-
if let Err(ref e) = result {
196-
tracing::error!("[WriterPool] Priority writer {} chunk {}/{} FAILED: {}", self.id, i+1, data_len, e);
197-
} else {
198-
tracing::info!("[WriterPool] Priority writer {} chunk {}/{} succeeded", self.id, i+1, data_len);
199-
}
200-
201192
if let Ok(ref loc) = result {
202193
let mtx = Arc::clone(&self.eviction);
203194
let policy = mtx.lock().unwrap();
@@ -235,12 +226,9 @@ impl Writer {
235226
}
236227

237228
let resp = BatchWriteResponse { locations };
238-
tracing::info!("[WriterPool] Priority writer {} completed batch, sending response", self.id);
239229
let snd = batch_req.responder.send(resp);
240230
if snd.is_err() {
241231
tracing::error!("Failed to send batch response from writer");
242-
} else {
243-
tracing::info!("[WriterPool] Priority writer {} batch response sent successfully", self.id);
244232
}
245233
}
246234
}

oxcache/src/zone_state/zone_priority_queue.rs

Lines changed: 4 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -37,57 +37,14 @@ impl ZonePriorityQueue {
3737

3838
// If above high watermark, clean until strictly below low watermark
3939
// If force_all=true, clean ALL zones with invalid chunks (desperate/always_evict mode)
40-
pub fn remove_if_thresh_met(&mut self, force_all: bool) -> Vec<ZoneIndex> {
40+
pub fn remove_if_thresh_met(&mut self) -> Vec<ZoneIndex> {
4141
let mut zones = Vec::new();
4242

43-
// Count how many zones have invalid chunks
44-
let zones_with_invalids = self.invalid_queue.iter().filter(|(_, p)| **p > 0).count();
45-
46-
tracing::info!(
47-
"[PriorityQueue] remove_if_thresh_met called: invalid_count={}, low_water_thresh={}, force_all={}, zones_with_invalids={}, will_clean={}",
48-
self.invalid_count,
49-
self.low_water_thresh,
50-
force_all,
51-
zones_with_invalids,
52-
force_all || self.invalid_count >= self.low_water_thresh
53-
);
54-
55-
if force_all && zones_with_invalids > 0 {
56-
// Desperate mode: clean ALL zones with invalid chunks
57-
tracing::warn!(
58-
"[PriorityQueue] ⚠️ FORCE CLEANING all {} zones with invalid chunks (always_evict=true)!",
59-
zones_with_invalids
60-
);
61-
while let Some((zone, prio)) = self.invalid_queue.peek() {
62-
if *prio == 0 {
63-
break; // No more zones with invalid chunks
64-
}
65-
tracing::info!(
66-
"[PriorityQueue] Force cleaning zone {} with {} invalid chunks",
67-
zone, prio
68-
);
69-
zones.push(self.pop_reset());
70-
}
71-
} else {
72-
// Normal mode: clean until below threshold
73-
while self.invalid_count >= self.low_water_thresh {
74-
let (zone, prio) = self.invalid_queue.peek().unwrap();
75-
tracing::info!(
76-
"[PriorityQueue] Cleaning zone {} with {} invalid chunks (invalid_count={} >= thresh={})",
77-
zone, prio, self.invalid_count, self.low_water_thresh
78-
);
79-
zones.push(self.pop_reset());
80-
}
43+
// Clean until below threshold
44+
while self.invalid_count >= self.low_water_thresh {
45+
zones.push(self.pop_reset());
8146
}
8247

83-
let zones_with_invalids_after = self.invalid_queue.iter().filter(|(_, p)| **p > 0).count();
84-
tracing::info!(
85-
"[PriorityQueue] After cleaning: returning {} zones, invalid_count={}, {} zones still have invalid chunks",
86-
zones.len(),
87-
self.invalid_count,
88-
zones_with_invalids_after
89-
);
90-
9148
zones
9249
}
9350

0 commit comments

Comments
 (0)