From eadf0952260ba4b21e791226cf5ad39e8f079c86 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Dec 2026 01:58:17 +0000 Subject: federation: a node on a set begins anew from another checkpoint its operator pins A pin counted only while the node had no file of its set, so a node behind for longer than the others keep what a checkpoint forgot, or one undoing a move, had to start without its file, and lost what it refused of its own and what its operator had it drop. The file now says which checkpoint was pinned when the set began: with another pinned, and not the one the store is at, the node gathers its set anew from that one, its store refusing what the one in the file refused. A node of both kinds makes its set of its document then, where it finds the pin. --- src/federation/held.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/federation/held.rs') diff --git a/src/federation/held.rs b/src/federation/held.rs index 39d6102..4846266 100644 --- a/src/federation/held.rs +++ b/src/federation/held.rs @@ -140,7 +140,7 @@ pub(crate) struct Voter { /// root; or still to be gathered of its peers, where the node was given neither. pub(crate) enum Begun { Set(Box>), - Start(super::store::passing::Start), + Start(Box>), } /// What carries the store: a document it is read from, or a set of events, which is @@ -397,7 +397,9 @@ impl Holding { let store = store.refusing(&own, &dropped, &writes); // A node of both kinds: the store in a set too, from here on. inner.store = Some(if self.of_a_set { - Carried::Set(Box::new(Set::new(store, self.keeps_forgotten))) + Carried::Set(Box::new( + Set::new(store, self.keeps_forgotten).pinned_at(self.pin), + )) } else { Carried::Store(Box::new(store)) }); @@ -1129,7 +1131,7 @@ impl Holding { ) -> Self { let holding = match begun { Some(Begun::Set(set)) => self.carrying(*set), - Some(Begun::Start(start)) => self.awaiting(start), + Some(Begun::Start(start)) => self.awaiting(*start), None => self, }; match path { -- cgit v1.3.1