From 8a29efed857991417d12b8e21884dbbcb53ff4a0 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Nov 2026 02:48:25 +0000 Subject: document: the writers a node wrote under are the document's, not a remake's The actors a node writes or wrote with in its current document (document::own::OwnWriters, AppState::own_writers) were kept by the remake state, which signing, the document file, sync and a dropped change read them from. They are the engine's: a document of a kind without writers of this sort has none, and needs no remake state for them. --- src/remake/catchup.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/remake/catchup.rs') diff --git a/src/remake/catchup.rs b/src/remake/catchup.rs index b8dc1b9..685385a 100644 --- a/src/remake/catchup.rs +++ b/src/remake/catchup.rs @@ -279,7 +279,7 @@ async fn start(host: &H, local: Epoch, target: Epoch, attempts: u32) { })); let actor = ActorId::random(); - host.remake().add_own_actor(actor.clone()); + host.own_writers().add(actor.clone()); // At once: the fresh document takes no writes until the rejoin is done; a ready // node's document so far answers reads, marked stale, and takes its writes // meanwhile (`Host::begin_rejoin`). @@ -386,7 +386,7 @@ async fn finish(host: &H) { // meanwhile, and those after `began` are replayed under the lock in the end. let copy = host.read_doc(|doc| doc.clone()).await; let kept = host.rejoin_document().await; - let own = host.remake().own_actors(); + let own = host.own_writers().all(); let now = host.now_millis(); #[cfg(feature = "federation")] let (holding, store) = (host.holding(), host.store_id()); @@ -560,7 +560,7 @@ async fn finish(host: &H) { ); host.remake().set_catch_up(None); let actor = host.read_doc(|doc| doc.get_actor().clone()).await; - host.remake().reset_own_actors(actor); + host.own_writers().reset(actor); info!( from = %previous, @@ -578,7 +578,7 @@ async fn finish(host: &H) { /// Verifies the synced document `copy` and decides about the old document's own /// changes: those up to `began` (when the rejoin began) by the replay window, those /// after it (made during the rejoin) whatever it says. `own`: this node's actors -/// (`RemakeState::own_actors`); the old document's own actor counts in any case. +/// (`document::own::OwnWriters`); the old document's own actor counts in any case. /// `now`: Unix milliseconds, by the node's clock. fn prepare( copy: &Document, -- cgit v1.3.1