From c17ad44ab8cb97433e68b5593f67d8672da0db4d Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 20 Oct 2026 03:09:21 +0200 Subject: replace snapshots by quarantine & replay --- src/peer.rs | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'src/peer.rs') diff --git a/src/peer.rs b/src/peer.rs index 50460b0..54ba0a4 100644 --- a/src/peer.rs +++ b/src/peer.rs @@ -537,13 +537,22 @@ async fn observe_peer_epoch(state: &AppState, peer: &str, remote: Epoch) -> bool .send(SyncEvent::PeerNeedsSync(peer.to_owned())); } } - other => { + // Expected after a compaction: either side switches or catches up. + EpochRelation::PeerAhead | EpochRelation::PeerBehind => { + info!( + peer = %peer, + local_epoch = %local, + peer_epoch = %remote, + relation = ?relation, + "Peer is on another epoch; not syncing with it until both are on the same" + ); + } + EpochRelation::Diverged => { warn!( peer = %peer, local_epoch = %local, peer_epoch = %remote, - relation = ?other, - "Peer is on a different epoch; not syncing with it" + "Peer is on a different epoch of the same generation; not syncing with it" ); } } @@ -663,17 +672,6 @@ pub(crate) async fn handle_message( let local = local_keepalive(state).await; heal_if_diverged(state, &peer, &local, &remote).await; } - transport::ParsedMessage::SnapshotRequest(request) => { - // Saving a large document takes a while; don't stall the inbox. - tokio::spawn(crate::compaction::serve_snapshot( - state.clone(), - peer.clone(), - request, - )); - } - transport::ParsedMessage::SnapshotReply(reply) => { - crate::compaction::receive_snapshot_reply(state, &peer, reply); - } } Ok(()) -- cgit v1.3.1