Commit 595a70e
ha-recorder-pg: enable synchronous replication (preferred durability)
A graceful CNPG failover under async replication (maxSyncReplicas=0) drops
the recorder's last unreplicated writes on promotion. HA's in-memory recorder
session then references rows the new primary never received, producing a
sqlalchemy StaleDataError loop that freezes the recorder until HA restarts.
Observed 2026-06-22 22:04 UTC: pg-3 (primary) gracefully restarted for node
maintenance, pg-2 promoted at 22:04:52; last good recorder write was 22:04:05,
47s earlier and not yet replicated -> recorder frozen ~8h, recurrent across
failovers.
synchronous {method: any, number: 1, dataDurability: preferred} makes commits
wait for the standby (RPO 0, lossless failover) while falling back to async if
the standby is down so HA writes never stall. CNPG 1.29.1.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013aFYGqPQhb4JqsnC6USdHQ1 parent 4bf7d76 commit 595a70e
1 file changed
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
60 | 77 | | |
61 | 78 | | |
62 | 79 | | |
| |||
0 commit comments