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:04:52 +0200
commitf55a0d983790fb3ec3707c4be73d8a0d70231645 (patch)
treef06886fa2df318d2d47f3b9975ac333a8cbb5202
parentd64dc446e3e4f23c17062ff35eca3e392e263794 (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 6b60845..8a2e6b1 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(());