aboutsummaryrefslogtreecommitdiffstats
path: root/src/remake
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-17 11:39:08 +0000
committertv <tv@krebsco.de>2026-11-17 12:39:50 +0100
commit7e751818b9db5161d717920c045942dad1b40a8b (patch)
treeefa3a3c34d4cfbdbd138c703231b750d3191c362 /src/remake
parent0bc965cfa3ad42b5ef9850388d856eb18f2ab5d9 (diff)
remake: a failed simulation's dump shows each node's catch-up
Its target, attempts, whether the node rejoins now, and why the last try failed, before the lines of the remake records.
Diffstat (limited to 'src/remake')
-rw-r--r--src/remake/api.rs20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/remake/api.rs b/src/remake/api.rs
index f2330e7..9ccd582 100644
--- a/src/remake/api.rs
+++ b/src/remake/api.rs
@@ -1083,8 +1083,8 @@ pub(crate) mod testing {
Some(serde_json::to_value(report).expect("report"))
}
- /// One line per remake record, for test failures: phase, timing (relative to now),
- /// decision and tally.
+ /// For test failures: the catch-up, if any, and one line per remake record: phase,
+ /// timing (relative to now), decision and tally.
pub(crate) async fn describe<H: Host>(host: &H) -> Vec<String> {
let (all, register) = host
.read_doc(|doc| (records::load_all(doc), records::load_register(doc)))
@@ -1092,8 +1092,18 @@ pub(crate) mod testing {
let now = host.now_millis();
let grace = host.dormant_after().as_millis() as u64;
let relative = |at: UnixMillis| at.0 as i64 - now.0 as i64;
- all.iter()
- .map(|(id, record)| {
+ let catch_up = host.remake().catch_up().map(|catch_up| {
+ format!(
+ "catch-up: target={} attempts={} rejoining={} error={:?}",
+ catch_up.target,
+ catch_up.attempts,
+ host.remake().is_rejoining(),
+ catch_up.error,
+ )
+ });
+ catch_up
+ .into_iter()
+ .chain(all.iter().map(|(id, record)| {
let proposal = &record.proposal;
format!(
"remake {id}: phase={:?} coordinator={} from={:?} proposed_at={}ms \
@@ -1109,7 +1119,7 @@ pub(crate) mod testing {
record.abort_requested.is_some(),
record.contested,
)
- })
+ }))
.collect()
}
}