From 54ce203c679b43485f25bf0165cad15178a5c3cf Mon Sep 17 00:00:00 2001 From: Mikhail Date: Fri, 15 May 2026 20:49:24 +0300 Subject: [PATCH] Allow clean route feedback to clear stale fences --- backend/internal/modules/cluster/postgres_store.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/internal/modules/cluster/postgres_store.go b/backend/internal/modules/cluster/postgres_store.go index 27f2c9e..7b4fc50 100644 --- a/backend/internal/modules/cluster/postgres_store.go +++ b/backend/internal/modules/cluster/postgres_store.go @@ -2130,6 +2130,13 @@ func (s *PostgresStore) RecordFabricServiceChannelRouteFeedback(ctx context.Cont EXCLUDED.feedback_status = 'healthy' AND fabric_service_channel_route_feedback_latest.feedback_status IN ('degraded', 'fenced') AND fabric_service_channel_route_feedback_latest.expires_at > EXCLUDED.observed_at + AND NOT ( + EXCLUDED.consecutive_failures = 0 + AND EXCLUDED.stall_count = 0 + AND COALESCE(NULLIF(EXCLUDED.payload->>'quality_window_failure_count', '')::int, 0) = 0 + AND COALESCE(NULLIF(EXCLUDED.payload->>'quality_window_drop_count', '')::int, 0) = 0 + AND COALESCE(NULLIF(EXCLUDED.payload->>'quality_window_slow_count', '')::int, 0) = 0 + ) ) `, item.ClusterID, item.ReporterNodeID, item.RouteID, item.ID, item.ServiceClass, item.FeedbackStatus, item.ScoreAdjustment, item.Reasons, item.LastError, item.ConsecutiveFailures, item.StallCount, item.LastSendDurationMs, []byte(item.Payload), item.ObservedAt, item.ExpiresAt); err != nil {