Not the answer you need?
Register and ask your own question!

proxysql dropping client connection in case of node failure

split-brainsplit-brain EntrantCurrent User Role Contributor
edited July 23 in ProxySQL
Hi there!
I'm trying to make a POC that in case of node failure during the query, proxysql will redirect the connection to alive backend node. I'm running sysbench against proxysql with a basic 3 node PXC configured with just one active writer node (max_writers=1).

problem: when I kill mysqld on writer node the proxysql drops client connection and sysbench fails with: 'HY000': Lost connection to MySQL server during query'.

expected behavior:  killing the mysqld doesn't affect the client connection and it'll be redirected to alive backend node from backup_writer_hostgroup. If the sql query isn't a transaction I'm expecting the proxysql to rerun the query on the alive node.

proxysql 2.0.12-38-g58a909a, pxc 8.0.19-10, sysbench 1.0.20, centos 7, kernel 3.10.0-1127.13.1.el7.x86_64

on proxysql node I run:
sysbench /usr/share/sysbench/oltp_write_only.lua --db-driver=mysql --mysql-host= --mysql-user='sbuser' --mysql-password='sbpass' --mysql-port=6033 --mysql-db=sbtest --tables=1 --table_size=1000000 --db-ps-mode=disable --db-debug=on --threads=16 --report-interval=5 --time=300 --skip-trx=on --mysql-ignore-errors=1062 run
my proxysql tables:

before killing the mysqld on the writer node I have:

after killing the mysqld:

So the backup writer has been promoted to the writer HG, but the connection to sysbench was droppped and failed with 'HY000': Lost connection to MySQL server during query'.
What can I do to preserve the client connection and reroute it to backup writer node?
my proxysql.log from the time of killing the mysqld is attached.

Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.