@@ -402,6 +402,7 @@ impl<const LEAF_FANOUT: usize> ObjectCache<LEAF_FANOUT> {
402402 ) -> io:: Result < ( ) > {
403403 let mut ca = self . cache_advisor . borrow_mut ( ) ;
404404 let to_evict = ca. accessed_reuse_buffer ( * object_id, size) ;
405+ let mut not_found = 0 ;
405406 for ( node_to_evict, _rough_size) in to_evict {
406407 let object_id =
407408 if let Some ( object_id) = ObjectId :: new ( * node_to_evict) {
@@ -412,18 +413,11 @@ impl<const LEAF_FANOUT: usize> ObjectCache<LEAF_FANOUT> {
412413
413414 let node = if let Some ( n) = self . object_id_index . get ( & object_id) {
414415 if * n. object_id != * node_to_evict {
415- log:: debug!(
416- "during cache eviction, node to evict did not match current occupant for {:?}" ,
417- node_to_evict
418- ) ;
419416 continue ;
420417 }
421418 n
422419 } else {
423- log:: debug!(
424- "during cache eviction, unable to find node to evict for {:?}" ,
425- node_to_evict
426- ) ;
420+ not_found += 1 ;
427421 continue ;
428422 } ;
429423
@@ -456,6 +450,13 @@ impl<const LEAF_FANOUT: usize> ObjectCache<LEAF_FANOUT> {
456450 }
457451 }
458452
453+ if not_found > 0 {
454+ log:: trace!(
455+ "during cache eviction, did not find {} nodes that we were trying to evict" ,
456+ not_found
457+ ) ;
458+ }
459+
459460 Ok ( ( ) )
460461 }
461462
@@ -701,9 +702,14 @@ impl<const LEAF_FANOUT: usize> ObjectCache<LEAF_FANOUT> {
701702 self . event_verifier . print_debug_history_for_object (
702703 dirty_object_id,
703704 ) ;
704-
705705 unreachable ! (
706- "a leaf was expected to be cooperatively serialized but it was not available"
706+ "a leaf was expected to be cooperatively serialized but it was not available. \
707+ violation of flush responsibility for second read \
708+ of expected cooperative serialization. leaf in question's \
709+ dirty_flush_epoch is {:?}, our expected key was {:?}. node.deleted: {:?}",
710+ leaf_ref. dirty_flush_epoch,
711+ ( dirty_epoch, dirty_object_id) ,
712+ leaf_ref. deleted,
707713 ) ;
708714 }
709715 } ;
@@ -736,16 +742,16 @@ impl<const LEAF_FANOUT: usize> ObjectCache<LEAF_FANOUT> {
736742 let before_compute_defrag = Instant :: now ( ) ;
737743
738744 if cfg ! ( not( feature = "monotonic-behavior" ) ) {
745+ let mut object_not_found = 0 ;
746+
739747 for fragmented_object_id in objects_to_defrag {
740748 let object_opt =
741749 self . object_id_index . get ( & fragmented_object_id) ;
742750
743751 let object = if let Some ( object) = object_opt {
744752 object
745753 } else {
746- log:: debug!(
747- "defragmenting object not found in object_id_index: {fragmented_object_id:?}"
748- ) ;
754+ object_not_found += 1 ;
749755 continue ;
750756 } ;
751757
@@ -781,6 +787,13 @@ impl<const LEAF_FANOUT: usize> ObjectCache<LEAF_FANOUT> {
781787 data,
782788 } ) ;
783789 }
790+
791+ if object_not_found > 0 {
792+ log:: debug!(
793+ "{} objects not found while defragmenting" ,
794+ object_not_found
795+ ) ;
796+ }
784797 }
785798
786799 let compute_defrag_latency = before_compute_defrag. elapsed ( ) ;
0 commit comments