From 208ea60836cfc98857cf3359a73d8874ed5d935a Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 9 Jan 2026 14:23:44 +0000 Subject: refactor(sync): rename ConnectedDegraded to ConnectedHistoricSyncFailures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/sync/mod.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/sync/mod.rs') 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 { Syncing, /// Successfully connected, historic sync completed Connected, - /// Successfully connected, historic sync failed but live sync active - ConnectedDegraded, + /// Successfully connected, historic sync had failures but live sync active + ConnectedHistoricSyncFailures, } impl ConnectionStatus { @@ -103,7 +103,7 @@ impl ConnectionStatus { pub fn is_live_sync_active(&self) -> bool { matches!( self, - ConnectionStatus::Syncing | ConnectionStatus::Connected | ConnectionStatus::ConnectedDegraded + ConnectionStatus::Syncing | ConnectionStatus::Connected | ConnectionStatus::ConnectedHistoricSyncFailures ) } } @@ -877,7 +877,7 @@ impl SyncManager { tracing::warn!( relay = %relay_url, batch_id = batch_id, - "Batch failed - will transition to ConnectedDegraded instead of Connected" + "Batch failed - will transition to ConnectedHistoricSyncFailures instead of Connected" ); } @@ -963,7 +963,7 @@ impl SyncManager { if state.connection_status == ConnectionStatus::Syncing { // Check if any batches failed during historic sync let new_status = if state.historic_sync_had_failures { - ConnectionStatus::ConnectedDegraded + ConnectionStatus::ConnectedHistoricSyncFailures } else { ConnectionStatus::Connected }; @@ -979,7 +979,7 @@ impl SyncManager { had_failures = state.historic_sync_had_failures, status = ?new_status, "Historic sync complete - transitioned to {} status", - if state.historic_sync_had_failures { "ConnectedDegraded" } else { "Connected" } + if state.historic_sync_had_failures { "ConnectedHistoricSyncFailures" } else { "Connected" } ); // Update metrics -- cgit v1.2.3