From 3acbbd6cd6b64c6c39408dd254cc2dbcab1b3e65 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 20 Oct 2026 01:36:34 +0200 Subject: add epoch catch-up / snapshots --- src/main.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 1127cd8..f5cec55 100644 --- a/src/main.rs +++ b/src/main.rs @@ -187,6 +187,12 @@ async fn main() -> Result<()> { }); info!("Peer worker task spawned"); + // Switches to committed epochs and catches up with newer ones. Starts before + // bootstrapping: a node joining a compacted cluster can only finish its initial sync + // after fetching the current epoch from a peer. + tokio::spawn(compaction::run_worker(state.clone())); + info!("Compaction worker task spawned"); + bootstrap::bootstrap(&state, &seeds) .await .context("Joining cluster")?; @@ -196,9 +202,6 @@ 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