upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/sync/algorithms.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-01-09 14:12:24 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-01-09 14:12:24 +0000
commit93a1684f068603b354ba3c05957a25459c73de05 (patch)
tree324e6d0e2a6a34fd4804ef94133cd35233081bb9 /src/sync/algorithms.rs
parentc34492069abacae67482af4c8356241958a524f7 (diff)
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)'.
Diffstat (limited to 'src/sync/algorithms.rs')
-rw-r--r--src/sync/algorithms.rs2
1 files changed, 2 insertions, 0 deletions
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 {
405 requested_event_ids: None, 405 requested_event_ids: None,
406 received_event_ids: None, 406 received_event_ids: None,
407 retry_count: 0, 407 retry_count: 0,
408 failed: false,
408 }], 409 }],
409 ); 410 );
410 411
@@ -520,6 +521,7 @@ mod tests {
520 requested_event_ids: None, 521 requested_event_ids: None,
521 received_event_ids: None, 522 received_event_ids: None,
522 retry_count: 0, 523 retry_count: 0,
524 failed: false,
523 }], 525 }],
524 ); 526 );
525 527