From 786f172e7fec1d09cc43fff6b96730132fbfd048 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 20 Oct 2026 06:04:52 +0200 Subject: bootstrap: mark node ready only after epoch check --- src/bootstrap.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bootstrap.rs b/src/bootstrap.rs index 470ca67..d3ac94d 100644 --- a/src/bootstrap.rs +++ b/src/bootstrap.rs @@ -52,7 +52,9 @@ pub(crate) async fn bootstrap(state: &AppState, seeds: &[String]) -> Result<()> let deadline = tokio::time::Instant::now() + BOOTSTRAP_TIMEOUT; loop { if let Some(cluster_id) = state.cluster_id().await { - if state.initial_sync_done.load(Ordering::Acquire) { + // A node joining a compacted cluster rejoins the newer epoch first; it is + // ready only once that rejoin verified the epoch. + if state.initial_sync_done.load(Ordering::Acquire) && !state.compaction.is_rejoining() { state.mark_ready(cluster_id.clone()).await?; info!(cluster_id = %cluster_id, "Node is ready"); return Ok(()); -- cgit v1.3.1