Hello. I have the simple configuration with 2 postgresql servers in backend.
HAProxy version 2.4.12-1ppa1~focal 2022/01/11
defaults
timeout connect 5000
timeout client 50000
timeout server 50000
listen pg_read2
bind 10.1.107.182:55432
mode tcp
option tcplog
balance leastconn
option pgsql-check user check_user
default-server inter 3s fall 3 rise 3 on-marked-down shutdown-sessions
server pg_bigd3 10.1.107.170:5432 check
server pg_bigd4 10.1.107.171:5432 check
There are the php application to connect through HAProxy to PostgreSQL. When i do request and close connection in php, HAProxy logs the SD termination state on every request:
BUT all required data are received (data size is correct and time of request execution is correct) and all works. No any errors is logged.
What it can be?
Could it be an issue with a wrong HA Proxy configuration, or is it normal when SSL encryption is working? Everything seems fine, but all connections are closed with the SD state.
SD The connection to the server died with an error during the data
transfer. This usually means that HAProxy has received an RST from
the server or an ICMP message from an intermediate equipment while
exchanging data with the server. This can be caused by a server crash
or by a network issue on an intermediate equipment.
So if you expect that the postgresql server closes the connection with a reset, then you can ignore this error.
I’m not sure that the application should terminate all connections with a reset, especially since the app properly closes the connection when SSL is disabled on the Postgres side.
This makes me wonder whether the issue lies more with HAProxy or with the database itself.