From a30499ffedb76dc08ba7e9c9b2ed4eb3f921a5df Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 20 Oct 2026 00:51:39 +0200 Subject: add epoch switch --- src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 8e128f0..1127cd8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -157,6 +157,7 @@ async fn main() -> Result<()> { initial_sync_done: Arc::new(AtomicBool::new(false)), change_events, timing: Timing::from_keepalive(Duration::from_secs(args.keepalive_secs)), + compaction: Arc::new(compaction::Compaction::default()), }; info!("Application state initialized"); @@ -195,6 +196,9 @@ async fn main() -> Result<()> { let publisher_state = state.clone(); tokio::spawn(async move { sync::run_change_publisher(publisher_state).await }); + // Switches to committed epochs. Runs only once the node is Ready. + tokio::spawn(compaction::run_worker(state.clone())); + info!( cluster_id = ?state.cluster_id().await, ready = state.is_ready().await, -- cgit v1.3.1