diff options
| author | tv <tv@krebsco.de> | 2026-10-20 06:04:52 +0200 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-20 06:12:35 +0200 |
| commit | 786f172e7fec1d09cc43fff6b96730132fbfd048 (patch) | |
| tree | dbd21074c61b608518fe6058d243f41382834a50 | |
| parent | ce30784051e0b95a194c980e90b675afbc51d288 (diff) | |
bootstrap: mark node ready only after epoch check
| -rw-r--r-- | src/bootstrap.rs | 4 |
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(()); |
