diff options
| author | tv <tv@krebsco.de> | 2026-12-01 03:23:21 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-12-01 03:45:00 +0000 |
| commit | b6743899468db6304173aca4c7b32d05ea8d92c9 (patch) | |
| tree | 96036989bc0bba94364cdf1b6a3aba73c3e8ae28 /src/swarm/peer | |
| parent | 80a1075951bdf70a4e9fb68e4a4228cfe0d27ba8 (diff) | |
remake: the switch worker looks when something changed, not every second
It read the remake records and its peers' epochs once a second, whatever
happened. It now looks when the records change, within a second of a
peer saying another epoch than this node's, and when a vote is due; and
by itself, once a second, only while something waits on time: a remake
of this epoch open or committed, a rejoin, a catch-up, a member on
another epoch. What it keeps for a time, an archived document or a
remake's content, it wakes for when that is due.
Diffstat (limited to 'src/swarm/peer')
| -rw-r--r-- | src/swarm/peer/epoch.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/swarm/peer/epoch.rs b/src/swarm/peer/epoch.rs index d00a903..f276727 100644 --- a/src/swarm/peer/epoch.rs +++ b/src/swarm/peer/epoch.rs @@ -60,6 +60,11 @@ pub(super) async fn observe_peer_epoch( previous }; + // The remake worker looks whether to follow it, each time it says so. + if relation != EpochRelation::Same { + state.remake_wake.notify_one(); + } + // Log transitions only, not every keepalive. if previous != Some(remote) { match relation { |
