aboutsummaryrefslogtreecommitdiffstats
path: root/src/remake/catchup.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/remake/catchup.rs')
-rw-r--r--src/remake/catchup.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/remake/catchup.rs b/src/remake/catchup.rs
index 43cc390..2da8540 100644
--- a/src/remake/catchup.rs
+++ b/src/remake/catchup.rs
@@ -233,16 +233,17 @@ async fn start<H: Host>(host: &H, local: Epoch, target: Epoch, attempts: u32) {
}));
// Keep answering reads, from a copy of the current document marked stale, before
- // the node stops being ready: no window in which reads get 503.
- if host.is_node_ready().await {
- let copy = host.read_doc(|doc| doc.clone()).await;
+ // the node stops being ready: no window in which reads get 503. Taken as writes
+ // stop, so it holds every write answered.
+ if let Some(copy) = host.refuse_writes(host.is_node_ready().await).await {
host.set_stale_view(Some((local, copy)));
}
let was_ready = host.suspend().await;
let actor = ActorId::random();
host.remake().add_own_actor(actor.clone());
- // The fresh document takes no writes until the rejoin is done: one checked as
- // ready just before the suspension above would land in it (`Replica::writable`).
+ // The fresh document takes no writes either until the rejoin is done
+ // (`Replica::writable`): one checked as ready before the suspension above would
+ // land in it.
let old = match host
.switch_epoch(target, false, move |_live| {
Ok::<_, Infallible>(Document::new().with_actor(actor))