OG T
e6f6734f39
CD Pipeline / build-and-deploy (push) Has been cancelled
E2E Health Check / e2e-health (push) Has been cancelled
fix(telegram): Redis Leader Election 解決多 Pod 409 Conflict
問題: 2 個 API Pod 同時 getUpdates → 互相 409 → 兩個都失敗
根本原因: explicit env TELEGRAM_ENABLE_POLLING=false 被 kubectl patch 設入
deployment,覆蓋 ConfigMap 的 true (feedback_k8s_env_precedence.md 違規)
修復步驟:
1. kubectl patch 移除 deployment 的 explicit env override
2. 實作 Redis Leader Election 防止多 Pod 競爭
- 使用 SET NX EX=45 取得 Leader Lock
- _leader_renewer(): 每 20s 續約,確保 Leader 持有 Lock
- _leader_watcher(): 非 Leader Pod 每 30s 嘗試接管
- 409 時主動釋放 Lock,Watcher 競爭接管
結果: 一個 Pod 正常 polling,另一個 Pod 進入 Watcher 待命模式
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 11:04:10 +08:00
..
2026-03-26 16:06:20 +08:00
2026-03-26 16:06:20 +08:00
2026-03-29 21:16:50 +08:00
2026-04-01 11:04:10 +08:00
2026-03-31 16:25:00 +08:00
2026-03-22 18:57:44 +08:00
2026-03-22 18:57:44 +08:00
2026-03-31 14:03:34 +08:00
2026-03-29 15:27:49 +08:00
2026-03-31 13:57:10 +08:00
2026-03-29 17:05:20 +08:00
2026-03-22 18:57:44 +08:00
2026-03-26 00:32:19 +08:00