Haproxy is not stopping connections after failover from pxc-2 to pxc-0
General
Escalation
General
Escalation
Description
Environment
None
Activity
Show:
Done
Created December 21, 2023 at 6:28 PM
Updated March 4, 2024 at 2:41 PM
Resolved January 15, 2024 at 12:43 PM
Create the cluster (I’m using ./anydbver deploy k8s-pxc:1.13.0 , default cr.yaml with RollingUpdate)
Put pxc-0 down:
kubectl -n pxc exec -it cluster1-pxc-0 -c pxc -- bash -c 'touch /var/lib/mysql/sleep-forever;mysql -uroot -p"$MYSQL_ROOT_PASSWORD" -e shutdown'
Connect via haproxy:
kubectl -n pxc exec -it cluster1-pxc-2 -c pxc -- bash ; mysql -uroot -p$MYSQL_ROOT_PASSWORD -h cluster1-haproxy
SELECT @hostname returns pxc-2
Fix pxc-0: kubectl -n pxc exec -it cluster1-pxc-0 -c pxc -- rm -f /var/lib/mysql/sleep-forever
New connections going to pxc-0, but existing connections still able to execute DML/DDL queries on pxc-2
The issue could be fixed by adding
hard-stop-after 10s
to the global haproxy configuration