@@ -228,6 +228,7 @@ async fn get_log_from_handle_with_mutex_held<'a>(
228
228
mark_dirty : MarkDirty ,
229
229
) -> Result < LogRef < ' a > , wal3:: Error > {
230
230
if active. log . is_some ( ) {
231
+ // TODO(rescrv): Magic constant.
231
232
active. keep_alive ( Duration :: from_secs ( 60 ) ) ;
232
233
}
233
234
if let Some ( log) = active. log . as_ref ( ) {
@@ -245,6 +246,7 @@ async fn get_log_from_handle_with_mutex_held<'a>(
245
246
mark_dirty. clone ( ) ,
246
247
)
247
248
. await ?;
249
+ // TODO(rescrv): Magic constant.
248
250
active. keep_alive ( Duration :: from_secs ( 60 ) ) ;
249
251
tracing:: info!( "Opened log at {}" , prefix) ;
250
252
let opened = Arc :: new ( opened) ;
@@ -336,7 +338,7 @@ impl RollupPerCollection {
336
338
self . reinsert_count = std:: cmp:: max ( self . reinsert_count , reinsert_count) ;
337
339
// Consider the most recent initial insertion time so if we've compacted earlier we drop.
338
340
self . initial_insertion_epoch_us =
339
- std:: cmp:: max ( self . initial_insertion_epoch_us , initial_insertion_epoch_us) ;
341
+ std:: cmp:: min ( self . initial_insertion_epoch_us , initial_insertion_epoch_us) ;
340
342
}
341
343
342
344
fn witness_cursor ( & mut self , witness : Option < & Witness > ) {
@@ -569,6 +571,7 @@ impl LogServer {
569
571
) ) ;
570
572
}
571
573
tracing:: info!( "scouted {collection_id} start={start} limit={limit}" ) ;
574
+ // TODO(rescrv): Magic constant.
572
575
const STEP : u64 = 100 ;
573
576
let num_steps = ( limit. saturating_sub ( start) + STEP - 1 ) / STEP ;
574
577
let actual_steps = ( 0 ..num_steps)
@@ -708,6 +711,7 @@ impl LogServer {
708
711
. await ?
709
712
. into_inner ( ) ;
710
713
if resp. log_is_sealed {
714
+ // TODO(rescrv): Magic constant.
711
715
self . effectuate_log_transfer ( collection_id, proxy. clone ( ) , 3 )
712
716
. await ?;
713
717
Box :: pin ( self . push_logs ( Request :: new ( request) ) ) . await
@@ -817,7 +821,7 @@ impl LogServer {
817
821
epoch_us : SystemTime :: now ( )
818
822
. duration_since ( SystemTime :: UNIX_EPOCH )
819
823
. map_err ( |_| wal3:: Error :: Internal )
820
- . unwrap ( )
824
+ . expect ( "time should never move to before UNIX epoch" )
821
825
. as_micros ( ) as u64 ,
822
826
writer : "TODO" . to_string ( ) ,
823
827
} ;
@@ -856,6 +860,7 @@ impl LogServer {
856
860
request : GetAllCollectionInfoToCompactRequest ,
857
861
) -> Result < Response < GetAllCollectionInfoToCompactResponse > , Status > {
858
862
// TODO(rescrv): Realistically we could make this configurable.
863
+ // TODO(rescrv): Magic constant.
859
864
const MAX_COLLECTION_INFO_NUMBER : usize = 10000 ;
860
865
let mut selected_rollups = Vec :: with_capacity ( MAX_COLLECTION_INFO_NUMBER ) ;
861
866
// Do a non-allocating pass here.
@@ -984,6 +989,7 @@ impl LogServer {
984
989
if dirty_fragments. is_empty ( ) {
985
990
return Ok ( ( witness, cursor, vec ! [ ] ) ) ;
986
991
}
992
+ // TODO(rescrv): Magic constant.
987
993
if dirty_fragments. len ( ) >= 1_000 {
988
994
tracing:: error!( "Too many dirty fragments: {}" , dirty_fragments. len( ) ) ;
989
995
}
@@ -1541,6 +1547,7 @@ impl LogServer {
1541
1547
let dirty_fragments = reader
1542
1548
. scan (
1543
1549
cursor. position ,
1550
+ // TODO(rescrv): Magic constant.
1544
1551
Limits {
1545
1552
max_files : Some ( 1_000_000 ) ,
1546
1553
max_bytes : Some ( 1_000_000_000 ) ,
0 commit comments