OK, I am now unable to reproduce what I am seeing in production - after reintroducing shutdown-sessions my test updates are now correctly exiting with update failed: EOF - I need to understand why in production the sessions are still getting re-established to the RO backend ahd showing as failed updates in a RO session. I have a couple of questions in connection with this:
- is there a way to get haproxy to dump its live config? - I am now wondering if k8s is correctly loading the new configmap with the shutdown-sessions directive as I have seen problems with this sort of thing before
- even without shutdown-sessions, can I assume haproxy would not allow a new session through to a down backend - in which case I must assume there is a delay in patroni updating its healthcheck port in production? Hard to tell how I could test this definitively..
- when does a debug line actually get written to log? When normal traffic is flowing there are no diagnostics (just stats fetches and PROMEX for prometheus) but as soon as I start the failover I get lots of session stats - is it just any error condition?
- I still see the haproxy version NOTICE at backend failover - I have tested and this is not the same as I see if I do a systemd reload or restart - is this definitely a problem? I donât think the process is restarting..
failover:
Nov 24 14:32:26 ibg-bank-dblb-00 haproxy[11212]: 192.168.0.29:59417 [24/Nov/2025:14:32:26.519] pgmaster pgmaster/alt-bank-db-00 1/0/3 0 SD 3/2/1/1/0 0/0
Nov 24 14:32:27 ibg-bank-dblb-00 haproxy[11212]: [WARNING] (11212) : Server pgmaster/ibg-bank-db-00 is UP, reason: Layer7 check passed, code: 200, check duration: 1ms. 2 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
Nov 24 14:32:27 ibg-bank-dblb-00 haproxy[11212]: Server pgmaster/ibg-bank-db-00 is UP, reason: Layer7 check passed, code: 200, check duration: 1ms. 2 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
Nov 24 14:32:27 ibg-bank-dblb-00 haproxy[11212]: Server pgmaster/ibg-bank-db-00 is UP, reason: Layer7 check passed, code: 200, check duration: 1ms. 2 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
Nov 24 14:32:28 ibg-bank-dblb-00 haproxy[11212]: 192.168.0.230:37868 [24/Nov/2025:14:32:13.537] stats stats/<PROMEX> 0/0/15000 66281 LR 7/1/0/0/0 0/0
Nov 24 14:32:28 ibg-bank-dblb-00 haproxy[11212]: 192.168.0.230:37868 [24/Nov/2025:14:32:13.537] stats stats/<PROMEX> 0/0/15000 66281 LR 7/1/0/0/0 0/0
Nov 24 14:32:28 ibg-bank-dblb-00 haproxy[11212]: [WARNING] (11212) : Server pgmaster/alt-bank-db-00 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 1ms. 1 active and 0 backup servers left. 1 sessions active, 0 requeued, 0 remaining in queue.
Nov 24 14:32:28 ibg-bank-dblb-00 haproxy[11212]: Server pgmaster/alt-bank-db-00 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 1ms. 1 active and 0 backup servers left. 1 sessions active, 0 requeued, 0 remaining in queue.
Nov 24 14:32:28 ibg-bank-dblb-00 haproxy[11212]: Server pgmaster/alt-bank-db-00 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 1ms. 1 active and 0 backup servers left. 1 sessions active, 0 requeued, 0 remaining in queue.
Nov 24 14:32:28 ibg-bank-dblb-00 haproxy[11212]: 192.168.0.29:59374 [24/Nov/2025:14:32:16.676] pgmaster pgmaster/alt-bank-db-00 1/0/11863 754 D- 7/6/5/0/0 0/0
Nov 24 14:32:28 ibg-bank-dblb-00 haproxy[11212]: 192.168.0.29:59374 [24/Nov/2025:14:32:16.676] pgmaster pgmaster/alt-bank-db-00 1/0/11863 754 D- 7/6/5/0/0 0/0
Nov 24 14:32:28 ibg-bank-dblb-00 haproxy[11212]: [WARNING] (11212) : Server pgstandby/ibg-bank-db-00 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 2ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
Broadcast message from systemd-journald@ibg-bank-dblb-00 (Mon 2025-11-24 14:32:28 GMT):
haproxy[11212]: backend pgstandby has no server available!
Broadcast message from systemd-journald@ibg-bank-dblb-00 (Mon 2025-11-24 14:32:28 GMT):
haproxy[11212]: backend pgstandby has no server available!
Message from syslogd@ibg-bank-dblb-00 at Nov 24 14:32:28 ...
haproxy[11212]:backend pgstandby has no server available!
Message from syslogd@ibg-bank-dblb-00 at Nov 24 14:32:28 ...
haproxy[11212]:backend pgstandby has no server available!
Nov 24 14:32:28 ibg-bank-dblb-00 haproxy[11212]: Server pgstandby/ibg-bank-db-00 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 2ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
Nov 24 14:32:28 ibg-bank-dblb-00 haproxy[11212]: Server pgstandby/ibg-bank-db-00 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 2ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
Nov 24 14:32:28 ibg-bank-dblb-00 haproxy[11212]: [NOTICE] (11212) : haproxy version is 2.4.22-f8e3218
Nov 24 14:32:28 ibg-bank-dblb-00 haproxy[11212]: [NOTICE] (11212) : path to executable is /usr/sbin/haproxy
Nov 24 14:32:28 ibg-bank-dblb-00 haproxy[11212]: [ALERT] (11212) : backend 'pgstandby' has no server available!
Nov 24 14:32:28 ibg-bank-dblb-00 haproxy[11212]: backend pgstandby has no server available!
Nov 24 14:32:28 ibg-bank-dblb-00 haproxy[11212]: backend pgstandby has no server available!
Nov 24 14:32:29 ibg-bank-dblb-00 haproxy[11212]: 192.168.0.29:59421 [24/Nov/2025:14:32:26.532] pgmaster pgmaster/alt-bank-db-00 1/3006/3006 0 D- 6/5/4/4/3 0/0
Nov 24 14:32:29 ibg-bank-dblb-00 haproxy[11212]: 192.168.0.29:59421 [24/Nov/2025:14:32:26.532] pgmaster pgmaster/alt-bank-db-00 1/3006/3006 0 D- 6/5/4/4/3 0/0
Nov 24 14:32:29 ibg-bank-dblb-00 haproxy[11212]: 192.168.0.29:59419 [24/Nov/2025:14:32:26.532] pgmaster pgmaster/alt-bank-db-00 1/3006/3006 0 D- 5/4/3/3/3 0/0
Nov 24 14:32:29 ibg-bank-dblb-00 haproxy[11212]: 192.168.0.29:59419 [24/Nov/2025:14:32:26.532] pgmaster pgmaster/alt-bank-db-00 1/3006/3006 0 D- 5/4/3/3/3 0/0
Nov 24 14:32:29 ibg-bank-dblb-00 haproxy[11212]: 192.168.0.29:59427 [24/Nov/2025:14:32:26.533] pgmaster pgmaster/alt-bank-db-00 1/3004/3004 0 D- 4/3/2/2/3 0/0
Nov 24 14:32:29 ibg-bank-dblb-00 haproxy[11212]: 192.168.0.29:59427 [24/Nov/2025:14:32:26.533] pgmaster pgmaster/alt-bank-db-00 1/3004/3004 0 D- 4/3/2/2/3 0/0
Nov 24 14:32:29 ibg-bank-dblb-00 haproxy[11212]: 192.168.0.29:59425 [24/Nov/2025:14:32:26.533] pgmaster pgmaster/alt-bank-db-00 1/3004/3004 0 D- 3/2/1/1/3 0/0
Nov 24 14:32:29 ibg-bank-dblb-00 haproxy[11212]: 192.168.0.29:59425 [24/Nov/2025:14:32:26.533] pgmaster pgmaster/alt-bank-db-00 1/3004/3004 0 D- 3/2/1/1/3 0/0
Nov 24 14:32:29 ibg-bank-dblb-00 haproxy[11212]: 192.168.0.29:59423 [24/Nov/2025:14:32:26.533] pgmaster pgmaster/alt-bank-db-00 1/3004/3004 0 D- 2/1/0/0/3 0/0
Nov 24 14:32:29 ibg-bank-dblb-00 haproxy[11212]: 192.168.0.29:59423 [24/Nov/2025:14:32:26.533] pgmaster pgmaster/alt-bank-db-00 1/3004/3004 0 D- 2/1/0/0/3 0/0
Nov 24 14:32:31 ibg-bank-dblb-00 haproxy[11212]: [WARNING] (11212) : Server pgstandby/alt-bank-db-00 is UP, reason: Layer7 check passed, code: 200, check duration: 2ms. 1 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
Nov 24 14:32:31 ibg-bank-dblb-00 haproxy[11212]: Server pgstandby/alt-bank-db-00 is UP, reason: Layer7 check passed, code: 200, check duration: 2ms. 1 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
N
reload:
Nov 24 14:27:13 ibg-bank-dblb-00 haproxy[11180]: 192.168.0.230:39148 [24/Nov/2025:14:26:58.536] stats stats/<PROMEX> 0/0/15001 66333 LR 1/1/0/0/0 0/0
Nov 24 14:27:15 ibg-bank-dblb-00 systemd[1]: Reloading HAProxy Load Balancer...
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11087]: [WARNING] (11087) : Reexecuting Master process
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11087]: [NOTICE] (11087) : New worker #1 (11194) forked
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11180]: [WARNING] (11180) : Proxy pgmaster stopped (cumulated conns: FE: 200, BE: 0).
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11180]: Proxy pgmaster stopped (cumulated conns: FE: 200, BE: 0).
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11180]: Proxy pgmaster stopped (cumulated conns: FE: 200, BE: 0).
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11180]: [WARNING] (11180) : Proxy pgstandby stopped (cumulated conns: FE: 0, BE: 0).
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11180]: Proxy pgstandby stopped (cumulated conns: FE: 0, BE: 0).
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11180]: Proxy pgstandby stopped (cumulated conns: FE: 0, BE: 0).
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11180]: [WARNING] (11180) : Proxy stats stopped (cumulated conns: FE: 1, BE: 0).
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11180]: Proxy stats stopped (cumulated conns: FE: 1, BE: 0).
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11180]: Proxy stats stopped (cumulated conns: FE: 1, BE: 0).
Nov 24 14:27:15 ibg-bank-dblb-00 systemd[1]: Reloaded HAProxy Load Balancer.
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11180]: [WARNING] (11180) : Stopping frontend GLOBAL in 0 ms.
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11180]: [WARNING] (11180) : Stopping backend pgmaster in 0 ms.
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11180]: Stopping backend pgmaster in 0 ms.
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11180]: Stopping backend pgmaster in 0 ms.
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11180]: [WARNING] (11180) : Stopping backend pgstandby in 0 ms.
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11180]: Stopping backend pgstandby in 0 ms.
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11180]: Stopping backend pgstandby in 0 ms.
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11087]: [WARNING] (11087) : Former worker #1 (11180) exited with code 0 (Exit)
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11194]: [WARNING] (11194) : Server pgmaster/ibg-bank-db-00 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 13ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11194]: Server pgmaster/ibg-bank-db-00 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 13ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11194]: Server pgmaster/ibg-bank-db-00 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 13ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11194]: [WARNING] (11194) : Server pgstandby/alt-bank-db-00 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 2ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11194]: Server pgstandby/alt-bank-db-00 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 2ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
Nov 24 14:27:15 ibg-bank-dblb-00 haproxy[11194]: Server pgstandby/alt-bank-db-00 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 2ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
Nov 24 14:27:28 ibg-bank-dblb-00 haproxy[11194]: 192.168.0.230:40492 [24/Nov/2025:14:27:28.537] stats stats/<PROMEX> 0/0/0 66223 LR 1/1/0/0/0 0/0
restart:
Nov 24 14:28:20 ibg-bank-dblb-00 haproxy[11087]: [WARNING] (11087) : Exiting Master process...
Nov 24 14:28:20 ibg-bank-dblb-00 systemd[1]: Stopping HAProxy Load Balancer...
Nov 24 14:28:20 ibg-bank-dblb-00 haproxy[11087]: [NOTICE] (11087) : haproxy version is 2.4.22-f8e3218
Nov 24 14:28:20 ibg-bank-dblb-00 haproxy[11087]: [NOTICE] (11087) : path to executable is /usr/sbin/haproxy
Nov 24 14:28:20 ibg-bank-dblb-00 haproxy[11087]: [ALERT] (11087) : Current worker #1 (11194) exited with code 143 (Terminated)
Nov 24 14:28:20 ibg-bank-dblb-00 haproxy[11087]: [WARNING] (11087) : All workers exited. Exiting... (0)
Nov 24 14:28:20 ibg-bank-dblb-00 systemd[1]: haproxy.service: Deactivated successfully.
Nov 24 14:28:20 ibg-bank-dblb-00 systemd[1]: Stopped HAProxy Load Balancer.
Nov 24 14:28:20 ibg-bank-dblb-00 systemd[1]: haproxy.service: Consumed 1.584s CPU time.
Nov 24 14:28:20 ibg-bank-dblb-00 systemd[1]: Starting HAProxy Load Balancer...
Nov 24 14:28:20 ibg-bank-dblb-00 haproxy[11200]: [NOTICE] (11200) : New worker #1 (11202) forked
Nov 24 14:28:20 ibg-bank-dblb-00 systemd[1]: Started HAProxy Load Balancer.
Nov 24 14:28:20 ibg-bank-dblb-00 haproxy[11202]: [WARNING] (11202) : Server pgmaster/ibg-bank-db-00 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 12ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
Nov 24 14:28:20 ibg-bank-dblb-00 haproxy[11202]: Server pgmaster/ibg-bank-db-00 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 12ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
Nov 24 14:28:20 ibg-bank-dblb-00 haproxy[11202]: Server pgmaster/ibg-bank-db-00 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 12ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
Nov 24 14:28:21 ibg-bank-dblb-00 haproxy[11202]: [WARNING] (11202) : Server pgstandby/alt-bank-db-00 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 2ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
Nov 24 14:28:21 ibg-bank-dblb-00 haproxy[11202]: Server pgstandby/alt-bank-db-00 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 2ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
Nov 24 14:28:21 ibg-bank-dblb-00 haproxy[11202]: Server pgstandby/alt-bank-db-00 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Unavailable", check duration: 2ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
Nov 24 14:28:28 ibg-bank-dblb-00 haproxy[11202]: 192.168.0.230:57998 [24/Nov/2025:14:28:28.537] stats stats/<PROMEX> 0/0/0 66214 LR 1/1/0/0/0 0/0
Nov 24 14:28:28 ibg-bank-dblb-00 haproxy[11202]: 192.168.0.230:57998 [24/Nov/2025:14:28:28.537] stats stats/<PROMEX> 0/0/0 66214 LR 1/1/0/0/0 0/0