@@ -82,8 +82,9 @@ pub const BACKFILL_SCHEDULE_IN_SLOT: [(u32, u32); 3] = [
82
82
( 4 , 5 ) ,
83
83
] ;
84
84
85
- /// Trigger reconstruction if we are this many seconds into the current slot
86
- pub const RECONSTRUCTION_DEADLINE : Duration = Duration :: from_millis ( 3000 ) ;
85
+ /// Fraction of slot duration after which column reconstruction is triggered, makes it easier for
86
+ /// different slot timings to have a generalised deadline
87
+ pub const RECONSTRUCTION_DEADLINE : f64 = 0.25 ;
87
88
88
89
/// Messages that the scheduler can receive.
89
90
#[ derive( AsRefStr ) ]
@@ -754,13 +755,17 @@ impl<S: SlotClock> ReprocessQueue<S> {
754
755
}
755
756
InboundEvent :: Msg ( DelayColumnReconstruction ( request) ) => {
756
757
let mut reconstruction_delay = QUEUED_RECONSTRUCTION_DELAY ;
758
+ let slot_duration = self . slot_clock . slot_duration ( ) . as_millis ( ) as f64 ;
759
+ let reconstruction_deadline_millis =
760
+ ( slot_duration * RECONSTRUCTION_DEADLINE ) . floor ( ) as u64 ;
761
+ let reconstruction_deadline = Duration :: from_millis ( reconstruction_deadline_millis) ;
757
762
if let Some ( seconds_from_current_slot) =
758
763
self . slot_clock . seconds_from_current_slot_start ( )
759
764
&& let Some ( current_slot) = self . slot_clock . now ( )
760
- && seconds_from_current_slot >= RECONSTRUCTION_DEADLINE
765
+ && seconds_from_current_slot >= reconstruction_deadline
761
766
&& current_slot == request. slot
762
767
{
763
- // If we are at least `RECONSTRUCTION_DEADLINE ` seconds into the current slot,
768
+ // If we are at least `reconstruction_deadline ` seconds into the current slot,
764
769
// and the reconstruction request is for the current slot, process reconstruction immediately.
765
770
reconstruction_delay = Duration :: from_secs ( 0 ) ;
766
771
}
0 commit comments