summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-20 06:04:52 +0200
committertv <tv@krebsco.de>2026-10-20 06:12:35 +0200
commit786f172e7fec1d09cc43fff6b96730132fbfd048 (patch)
treedbd21074c61b608518fe6058d243f41382834a50
parentce30784051e0b95a194c980e90b675afbc51d288 (diff)
bootstrap: mark node ready only after epoch check
-rw-r--r--src/bootstrap.rs4
1 files changed, 3 insertions, 1 deletions
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(());