From ec76ee904944867556555ff71e8fd0e6503b7c3d Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 17 Nov 2026 05:18:24 +0000 Subject: held: nothing of a rejoin's document is read before the node follows it While a node rejoins, its document is that of the epoch it tries, which it follows only once it checks it (`Holding::follows`). The store's worker reads nothing of it, and writes nothing, while the node rejoins: else the store, starting there from the snapshot's checkpoint, would take one the node neither builds nor has pinned, and keep it should the node give up the rejoin. --- src/federation/held.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/federation') diff --git a/src/federation/held.rs b/src/federation/held.rs index 856a2f6..7f68424 100644 --- a/src/federation/held.rs +++ b/src/federation/held.rs @@ -906,7 +906,13 @@ pub(crate) async fn run_worker(state: crate::state::AppState) { } else { Vec::new() }; + // A rejoin's document isn't the node's until it follows the epoch + // (`Holding::follows`): nothing of it is read, nor written on it, till then. + let rejoining = state.remake.is_rejoining(); let read = tokio::task::spawn_blocking(move || { + if rejoining { + return (false, Vec::new(), Vec::new()); + } holding.look(&refused); // Read from the document under its lock; taken without it. let unread = { -- cgit v1.3.1