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
commit3acbbd6cd6b64c6c39408dd254cc2dbcab1b3e65 (patch)
treeafaf883aeb949cdd79d7ef360ba9ee197072e368 /src/main.rs
parent31dddb08e4f36392ed9b033f78efd00c243c46bb (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 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,