From 93a1684f068603b354ba3c05957a25459c73de05 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 9 Jan 2026 14:12:24 +0000 Subject: feat(sync): add ConnectedDegraded status for failed historic sync - Add ConnectionStatus::ConnectedDegraded (status=4 in metrics) - Track batch failures via PendingBatch.failed field - Track relay-level failures via RelayState.historic_sync_had_failures - Transition to ConnectedDegraded when any batch fails during historic sync - Add is_live_sync_active() helper for cleaner match patterns - Update state machine diagram with ConnectedDegraded transitions - Update metrics docs with status=4 and example queries Fixes issue where relays with failed negentropy retries would incorrectly transition to Connected status despite missing data. Now operators can distinguish 'fully synced' vs 'degraded (partial data)'. --- src/sync/algorithms.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/sync/algorithms.rs') diff --git a/src/sync/algorithms.rs b/src/sync/algorithms.rs index e083dc8..7536f41 100644 --- a/src/sync/algorithms.rs +++ b/src/sync/algorithms.rs @@ -405,6 +405,7 @@ mod tests { requested_event_ids: None, received_event_ids: None, retry_count: 0, + failed: false, }], ); @@ -520,6 +521,7 @@ mod tests { requested_event_ids: None, received_event_ids: None, retry_count: 0, + failed: false, }], ); -- cgit v1.2.3