summaryrefslogtreecommitdiffstats
path: root/src/compaction/switch.rs
diff options
context:
space:
mode:
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 4093e7d..24bcee0 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,
},
);