upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/sync/mod.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-01-09 14:23:44 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-01-09 14:23:44 +0000
commit208ea60836cfc98857cf3359a73d8874ed5d935a (patch)
treee653189912f8e749170ef6645a85f9d6c907b3e6 /src/sync/mod.rs
parent93a1684f068603b354ba3c05957a25459c73de05 (diff)
refactor(sync): rename ConnectedDegraded to ConnectedHistoricSyncFailures
Resolves naming conflict with RelayHealthState::Degraded by using a more explicit name that clearly indicates the connection status relates to historic sync failures, not connection health degradation. Changes: - ConnectionStatus::ConnectedDegraded → ConnectedHistoricSyncFailures - Updated all documentation and comments - Updated Prometheus metric descriptions - Metric value remains 4 for backward compatibility This makes it clear that: - ConnectedHistoricSyncFailures = connection lifecycle (missing historic data) - RelayHealthState::Degraded = connection health (reliability issues) These are orthogonal concerns - a relay can be ConnectedHistoricSyncFailures but Healthy, or Connected but Degraded.
Diffstat (limited to 'src/sync/mod.rs')
-rw-r--r--src/sync/mod.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/sync/mod.rs b/src/sync/mod.rs
index 2031ef4..0e5b9bb 100644
--- a/src/sync/mod.rs
+++ b/src/sync/mod.rs
@@ -94,8 +94,8 @@ pub enum ConnectionStatus {
94 Syncing, 94 Syncing,
95 /// Successfully connected, historic sync completed 95 /// Successfully connected, historic sync completed
96 Connected, 96 Connected,
97 /// Successfully connected, historic sync failed but live sync active 97 /// Successfully connected, historic sync had failures but live sync active
98 ConnectedDegraded, 98 ConnectedHistoricSyncFailures,
99} 99}
100 100
101impl ConnectionStatus { 101impl ConnectionStatus {
@@ -103,7 +103,7 @@ impl ConnectionStatus {
103 pub fn is_live_sync_active(&self) -> bool { 103 pub fn is_live_sync_active(&self) -> bool {
104 matches!( 104 matches!(
105 self, 105 self,
106 ConnectionStatus::Syncing | ConnectionStatus::Connected | ConnectionStatus::ConnectedDegraded 106 ConnectionStatus::Syncing | ConnectionStatus::Connected | ConnectionStatus::ConnectedHistoricSyncFailures
107 ) 107 )
108 } 108 }
109} 109}
@@ -877,7 +877,7 @@ impl SyncManager {
877 tracing::warn!( 877 tracing::warn!(
878 relay = %relay_url, 878 relay = %relay_url,
879 batch_id = batch_id, 879 batch_id = batch_id,
880 "Batch failed - will transition to ConnectedDegraded instead of Connected" 880 "Batch failed - will transition to ConnectedHistoricSyncFailures instead of Connected"
881 ); 881 );
882 } 882 }
883 883
@@ -963,7 +963,7 @@ impl SyncManager {
963 if state.connection_status == ConnectionStatus::Syncing { 963 if state.connection_status == ConnectionStatus::Syncing {
964 // Check if any batches failed during historic sync 964 // Check if any batches failed during historic sync
965 let new_status = if state.historic_sync_had_failures { 965 let new_status = if state.historic_sync_had_failures {
966 ConnectionStatus::ConnectedDegraded 966 ConnectionStatus::ConnectedHistoricSyncFailures
967 } else { 967 } else {
968 ConnectionStatus::Connected 968 ConnectionStatus::Connected
969 }; 969 };
@@ -979,7 +979,7 @@ impl SyncManager {
979 had_failures = state.historic_sync_had_failures, 979 had_failures = state.historic_sync_had_failures,
980 status = ?new_status, 980 status = ?new_status,
981 "Historic sync complete - transitioned to {} status", 981 "Historic sync complete - transitioned to {} status",
982 if state.historic_sync_had_failures { "ConnectedDegraded" } else { "Connected" } 982 if state.historic_sync_had_failures { "ConnectedHistoricSyncFailures" } else { "Connected" }
983 ); 983 );
984 984
985 // Update metrics 985 // Update metrics