From 6432e4777032af5fd652b3674276148f3e80273b Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 3 Jun 2026 08:08:24 +0800 Subject: [PATCH] fix(ops): stabilize api rollout source correlation smoke --- apps/api/src/services/platform_operator_service.py | 6 +++++- k8s/awoooi-prod/06-deployment-api.yaml | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/api/src/services/platform_operator_service.py b/apps/api/src/services/platform_operator_service.py index 94f9bcf7..bf934d2e 100644 --- a/apps/api/src/services/platform_operator_service.py +++ b/apps/api/src/services/platform_operator_service.py @@ -3459,9 +3459,13 @@ async def _fetch_source_correlation_summary( WHERE project_id = :project_id AND {provider_sql} IN ('sentry', 'signoz') AND LOWER(COALESCE(source_envelope->>'stage', '')) = 'heartbeat' + AND received_at >= :window_start GROUP BY {provider_sql} """), - {"project_id": safe_project_id}, + { + "project_id": safe_project_id, + "window_start": window_start, + }, ) heartbeat_rows = list(heartbeat_result.mappings().all()) diff --git a/k8s/awoooi-prod/06-deployment-api.yaml b/k8s/awoooi-prod/06-deployment-api.yaml index c1d0b7f9..d6f155ce 100644 --- a/k8s/awoooi-prod/06-deployment-api.yaml +++ b/k8s/awoooi-prod/06-deployment-api.yaml @@ -176,7 +176,9 @@ spec: periodSeconds: 5 timeoutSeconds: 3 failureThreshold: 3 - # Phase K0.5: Startup Probe (允許最多 60 秒啟動時間) + # 2026-06-03 Codex: DB bootstrap DDL + background worker wiring can exceed + # 60s during rolling deploys. Keep liveness strict after startup, but allow + # cold-start to finish instead of killing the pod mid-bootstrap. startupProbe: httpGet: path: /api/v1/health/live @@ -184,7 +186,7 @@ spec: initialDelaySeconds: 5 periodSeconds: 5 timeoutSeconds: 5 - failureThreshold: 12 + failureThreshold: 60 # 反親和性 - 分散到不同節點 affinity: podAntiAffinity: