File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -340,10 +340,11 @@ pub static TRANSACTION_WARN_READ_SET_INTERVALS: LazyLock<usize> =
340
340
LazyLock :: new ( || env_config ( "TRANSACTION_WARN_READ_SET_INTERVALS" , 3072 ) ) ;
341
341
342
342
/// Write max_repeatable_ts if there have been no commits for this duration.
343
+ /// The actual period is jittered between 1x and 2x this value.
343
344
pub static MAX_REPEATABLE_TIMESTAMP_IDLE_FREQUENCY : LazyLock < Duration > = LazyLock :: new ( || {
344
345
Duration :: from_secs ( env_config (
345
346
"MAX_REPEATABLE_TIMESTAMP_IDLE_FREQUENCY" ,
346
- 100 * 60 ,
347
+ 60 * 60 ,
347
348
) )
348
349
} ) ;
349
350
Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ use futures::{
87
87
use indexing:: index_registry:: IndexRegistry ;
88
88
use parking_lot:: Mutex ;
89
89
use prometheus:: VMHistogram ;
90
+ use rand:: Rng ;
90
91
use tokio:: sync:: {
91
92
mpsc:: {
92
93
self ,
@@ -299,7 +300,10 @@ impl<RT: Runtime> Committer<RT> {
299
300
let span = committer_span. as_ref( ) . map( |root| Span :: enter_with_parent( "publish_max_repeatable_ts" , root) ) . unwrap_or_else( Span :: noop) ;
300
301
span. set_local_parent( ) ;
301
302
self . publish_max_repeatable_ts( new_max_repeatable) ?;
302
- next_bump_wait = Some ( * MAX_REPEATABLE_TIMESTAMP_IDLE_FREQUENCY ) ;
303
+ let base_period = * MAX_REPEATABLE_TIMESTAMP_IDLE_FREQUENCY ;
304
+ next_bump_wait = Some (
305
+ self . runtime. rng( ) . random_range( base_period..base_period * 2 ) ,
306
+ ) ;
303
307
let _ = result. send( new_max_repeatable) ;
304
308
drop( timer) ;
305
309
} ,
You can’t perform that action at this time.
0 commit comments