aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-17 05:18:24 +0000
committertv <tv@krebsco.de>2026-11-17 12:22:03 +0100
commitec76ee904944867556555ff71e8fd0e6503b7c3d (patch)
tree90da0ea9884c991deec2bd739332657251f87b47
parentb57da4e36675541598b69b5763b9d975ee62e7fd (diff)
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.
-rw-r--r--src/federation/held.rs6
1 files changed, 6 insertions, 0 deletions
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 = {