diff --git a/components/raftstore/src/store/config.rs b/components/raftstore/src/store/config.rs index 311936d6e7f..b9befedc04f 100644 --- a/components/raftstore/src/store/config.rs +++ b/components/raftstore/src/store/config.rs @@ -155,7 +155,7 @@ pub struct Config { #[doc(hidden)] #[online_config(skip)] - pub region_worker_tick_interval: u64, + pub region_worker_tick_interval: ReadableDuration, #[doc(hidden)] #[online_config(skip)] @@ -354,8 +354,12 @@ impl Default for Config { leader_transfer_max_log_lag: 128, snap_apply_batch_size: ReadableSize::mb(10), snap_handle_pool_size: 2, - region_worker_tick_interval: PENDING_APPLY_CHECK_INTERVAL, - clean_stale_tick_max: STALE_PEER_CHECK_TICK, + region_worker_tick_interval: if cfg!(feature = "test") { + ReadableDuration::millis(200) + } else { + ReadableDuration::millis(1000) + }, + clean_stale_tick_max: if cfg!(feature = "test") { 1 } else { 10 }, lock_cf_compact_interval: ReadableDuration::minutes(10), lock_cf_compact_bytes_threshold: ReadableSize::mb(256), // Disable consistency check by default as it will hurt performance. diff --git a/components/raftstore/src/store/fsm/store.rs b/components/raftstore/src/store/fsm/store.rs index 0d6b42106f0..a88332a429f 100644 --- a/components/raftstore/src/store/fsm/store.rs +++ b/components/raftstore/src/store/fsm/store.rs @@ -1447,7 +1447,7 @@ impl RaftBatchSystem { engines.kv.clone(), mgr.clone(), cfg.value().snap_apply_batch_size.0 as usize, - cfg.value().region_worker_tick_interval, + cfg.value().region_worker_tick_interval.as_millis(), cfg.value().clean_stale_tick_max, cfg.value().use_delete_range, cfg.value().snap_generator_pool_size,