I have a HAProxy + Patroni setup with split reads and writes.
The problem is, when both my replicas go down, only my writes are supported, the reads stop because both replicas are down.
How is this problem generally handled in this setup? Is there a way to have HAProxy direct the read traffic to the master in case no read servers are available?
Best Answer
This pattern of defining a frontend will use the replica as the main target, but if the read service is dead, then it will route traffic to the write servers - users should use 5911 for connecting to the read replica service.