Haproxy is not stopping connections after failover from pxc-2 to pxc-0

Description

  1. Create the cluster (I’m using ./anydbver deploy k8s-pxc:1.13.0 , default cr.yaml with RollingUpdate)

  2. 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'

  3. Connect via haproxy: kubectl -n pxc exec -it cluster1-pxc-2 -c pxc -- bash ; mysql -uroot -p$MYSQL_ROOT_PASSWORD -h cluster1-haproxy

  4. SELECT @hostname returns pxc-2

  5. Fix pxc-0: kubectl -n pxc exec -it cluster1-pxc-0 -c pxc -- rm -f /var/lib/mysql/sleep-forever

  6. 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

Environment

None

Activity

Show:
Done

Details

Assignee

Reporter

Needs QA

Yes

Fix versions

Affects versions

Priority

Smart Checklist

Created December 21, 2023 at 6:28 PM
Updated March 4, 2024 at 2:41 PM
Resolved January 15, 2024 at 12:43 PM
Loading...