aboutsummaryrefslogtreecommitdiffstats
path: root/src/remake/local.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-01 13:32:35 +0100
committertv <tv@krebsco.de>2026-11-01 13:32:35 +0100
commit484efbe2d62dbad445b0b9b771a3532c8566f024 (patch)
treecf75a2eafb747ca2848496d913ab1e081a191033 /src/remake/local.rs
parentf68e417555a714bec27fcb877c07bc83cc13fe20 (diff)
remake: log expired and missed votes
Diffstat (limited to 'src/remake/local.rs')
-rw-r--r--src/remake/local.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/remake/local.rs b/src/remake/local.rs
index e94657c..e8fc9eb 100644
--- a/src/remake/local.rs
+++ b/src/remake/local.rs
@@ -60,6 +60,9 @@ struct Inner {
coordinating: HashSet<String>,
/// The remake this node is about to vote for, and when (`vote_due`).
vote_due: Option<(String, UnixMillis)>,
+ /// Remakes this node could have voted for but saw expire first (`vote::cast`), each
+ /// logged once.
+ missed: HashSet<String>,
/// The actors this node writes or wrote with in the current document: this run's,
/// and those of earlier runs it knows of (`--document-file`). Its own writes, for a
/// rejoin. A switch or rejoin starts the list over with the new document's actor, so
@@ -215,6 +218,12 @@ impl RemakeState {
}
}
+ /// Notes that this node saw `remake` expire without having voted for it: true the
+ /// first time.
+ pub(crate) fn missed(&self, remake: &str) -> bool {
+ self.lock().missed.insert(remake.to_owned())
+ }
+
fn lock(&self) -> MutexGuard<'_, Inner> {
self.inner.lock_or_recover()
}