File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,10 @@ use std::{
1212        Hasher , 
1313    } , 
1414    sync:: Arc , 
15-     time:: Duration , 
15+     time:: { 
16+         Duration , 
17+         Instant , 
18+     } , 
1619} ; 
1720
1821use  anyhow:: Context ; 
@@ -723,6 +726,7 @@ impl<RT: Runtime> LeaderRetentionManager<RT> {
723726        all_indexes :  & BTreeMap < IndexId ,  ( GenericIndexName < TabletId > ,  IndexedFields ) > , 
724727        retention_validator :  Arc < dyn  RetentionValidator > , 
725728    )  -> anyhow:: Result < ( ) >  { 
729+         let  mut  last_logged = Instant :: now ( ) ; 
726730        while  cursor_ts. succ ( ) ? < * min_snapshot_ts { 
727731            let  ( new_cursor_ts,  _)  = Self :: delete ( 
728732                min_snapshot_ts, 
@@ -732,10 +736,16 @@ impl<RT: Runtime> LeaderRetentionManager<RT> {
732736                retention_validator. clone ( ) , 
733737            ) 
734738            . await ?; 
739+             let  now = Instant :: now ( ) ; 
740+             let  duration = now. saturating_duration_since ( last_logged) . as_secs_f64 ( ) ; 
741+             let  catchup_rate = new_cursor_ts. secs_since_f64 ( * cursor_ts)  / duration; 
742+             let  lag = min_snapshot_ts. secs_since_f64 ( * new_cursor_ts) ; 
735743            tracing:: info!( 
736-                 "custom index retention completed between ts {cursor_ts} and {new_cursor_ts}" 
744+                 "custom index retention completed between ts {cursor_ts} and {new_cursor_ts}; \  
745+                   catchup rate: {catchup_rate:.1}s/s, {lag:.1}s behind snapshot"
737746            ) ; 
738747            cursor_ts = new_cursor_ts; 
748+             last_logged = now; 
739749        } 
740750        Ok ( ( ) ) 
741751    } 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments