diff options
| -rw-r--r-- | src/federation/held.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/federation/held.rs b/src/federation/held.rs index 7f68424..985ff45 100644 --- a/src/federation/held.rs +++ b/src/federation/held.rs @@ -906,19 +906,19 @@ 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. + // Read from the document under its lock; taken without it. A rejoin's + // document isn't the node's until it follows the epoch (`Holding::follows`) + // and the rejoin ends, which makes it writable again, in the lock of the + // swap: nothing of it is read, nor written on it, till then. let unread = { let replica = doc.blocking_read(); + if !replica.writable { + return (false, Vec::new(), Vec::new()); + } holding.unread(&replica.doc, replica.epoch_seq) }; + holding.look(&refused); if let Some(unread) = unread { holding.read(unread); } |
