feat: Deploy HA auto-failover with database promotion

- Enhanced DNS failover monitor on secondary (72.62.39.24)
- Auto-promotes database: pg_ctl promote on failover
- Creates DEMOTED flag on primary via SSH (split-brain protection)
- Telegram notifications with database promotion status
- Startup safety script ready (integration pending)
- 90-second automatic recovery vs 10-30 min manual
- Zero-cost 95% enterprise HA benefit

Status: DEPLOYED and MONITORING (14:52 CET)
Next: Controlled failover test during maintenance
This commit is contained in:
mindesbunister
2025-12-12 15:54:03 +01:00
parent 7ff5c5b3a4
commit d637aac2d7
25 changed files with 1071 additions and 170 deletions

View File

@@ -1307,6 +1307,7 @@ docker logs -f trading-bot-v4 | grep "expected log message from fix"
- [ ] Compare Position Manager tracked size to actual Drift position size
- [ ] Check exit reason matches actual trigger (TP1/TP2/SL/trailing)
- [ ] **VERIFY VIA DRIFT API** before declaring anything "working" or "closed"
- [ ] Close confirmation timeouts (TransactionExpiredTimeoutError / 30s confirm delay) now set `needsVerification=true` in `closePosition()`. Position Manager must keep the trade in monitoring and you must run `/api/trading/sync-positions` before removing tracking so DB and Drift stay aligned.
**Exit Logic Changes (TP/SL/Trailing):**
- [ ] Log EXPECTED values (TP1 price, SL price after breakeven, trailing stop distance)