summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
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,