summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-20 01:36:34 +0200
committertv <tv@krebsco.de>2026-10-20 01:36:34 +0200
commit01f1d19d6b0b456991017022547e8c86bc8305ae (patch)
tree076bf95a3b05e939678d29bc72231a5d99ea98d0 /src/main.rs
parentcdbcd5d0bb0799c1ea3402718e2af6a6244b4fd0 (diff)
add epoch catch-up / snapshots
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index 16558f0..4e44cfc 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,