summaryrefslogtreecommitdiffstats
path: root/src/compaction/switch.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-20 03:09:21 +0200
committertv <tv@krebsco.de>2026-10-20 03:09:21 +0200
commite411c9e993f6936ad2787f53ac00fae9f0a6b0f9 (patch)
treebee97b809a854c99006673a5a0bf0b5c34340184 /src/compaction/switch.rs
parentc8d04d733b8d01e23ccd959ea4a839d22b70229b (diff)
replace snapshots by quarantine & replay
Diffstat (limited to 'src/compaction/switch.rs')
-rw-r--r--src/compaction/switch.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/compaction/switch.rs b/src/compaction/switch.rs
index b13e9f2..9a0603e 100644
--- a/src/compaction/switch.rs
+++ b/src/compaction/switch.rs
@@ -16,7 +16,7 @@
//! during steps 1-2.
//!
//! A node whose build doesn't match the committed epoch, or that never saw the commit,
-//! fetches the new epoch from a peer instead (`catchup`).
+//! rejoins the new epoch from peers instead (`catchup`).
use std::time::Duration;
@@ -70,6 +70,12 @@ async fn check<H: Host>(host: &H) {
let local = host.current_epoch();
host.compaction().prune_archive(local.generation);
+ // While rejoining, the document is being filled from peers: its records are not
+ // complete enough to act on.
+ if host.compaction().is_rejoining() {
+ return catchup::check(host).await;
+ }
+
let all = host.read_doc(records::load_all).await;
let local_record = EpochRecord::from(local);
@@ -116,6 +122,7 @@ async fn check<H: Host>(host: &H) {
switched_at: Some(unix_millis()),
replayed_paths: Some(stats.replayed),
failed_paths: Some(stats.failed),
+ quarantine: None,
error: None,
},
);