aboutsummaryrefslogtreecommitdiffstats
path: root/src/state/host.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-01 13:34:26 +0100
committertv <tv@krebsco.de>2026-11-01 13:34:26 +0100
commitefbc9899ab92c34db607f26c0e1b676e1e9d1c81 (patch)
tree3c84f3ab6755228c25033e477959ac4904db841b /src/state/host.rs
parent484efbe2d62dbad445b0b9b771a3532c8566f024 (diff)
state: drop epoch_tx
The stamp is the only lock-free epoch label.
Diffstat (limited to 'src/state/host.rs')
-rw-r--r--src/state/host.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/state/host.rs b/src/state/host.rs
index 6bb9d3b..7c3e165 100644
--- a/src/state/host.rs
+++ b/src/state/host.rs
@@ -283,10 +283,10 @@ impl Host for AppState {
replica.epoch = epoch;
replica.epoch_seq += 1;
replica.writable = writable;
+ // Publishes the epoch with the heads (`Replica::stamps`), under the
+ // same lock, so it never disagrees with the document for anyone
+ // holding the lock.
replica.refresh_heads();
- // Updated under the same lock, so the cached epoch never disagrees
- // with the document for anyone holding the lock.
- state.epoch_tx.send_replace(epoch);
// Reset every peer's sync state before the lock is released, so no
// message is generated from or applied to a state that describes the
// old document. (Lock order doc -> peer, as in sync generation.)