Bug #39272 Mysql Proxy does not invalidate backend servers
Submitted: 5 Sep 2008 11:18 Modified: 5 Sep 2008 19:55
Reporter: Guillaume Morin Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Proxy Severity:S1 (Critical)
Version:0.6.1 OS:Linux (Debian Lenny)
Assigned to: CPU Architecture:Any

[5 Sep 2008 11:18] Guillaume Morin
Description:
Hello,

I'm trying to setup a mysql-proxy forwarding connections to 2 Mysql servers with a master/master replication. It works well when the 2 servers are up but when I shutdown one of them to test the failover, mysql-proxy does not invalidate the server, so half of my connections are refused.

Here is the command line I use to start Mysql-proxy :

/usr/sbin/mysql-proxy --daemon --proxy-address=0.0.0.0:3306 --admin-address=192.168.51.55:3308 --proxy-backend-addresses=192.168.90.1:3307 --proxy-backend-addresses=192.168.90.2:3307

If I shutdown one of my MySQL server, I have the following error : 

# mysql -h 192.168.91.1 -u test
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0

And on the Mysql Proxy :

network-mysqld-proxy.c.3709: connect(192.168.90.2:3307) failed: Connection refused

Half of the connections are still working. Shouldn't Mysql-proxy invalidate a node when it can't connect to it ?

To test if it could come from the Debian package, I compiled mysql-proxy 0.6.1 from a tarball, but I got the same behaviour.

Regards,

Guillaume Morin

How to repeat:
Setup a Mysql-proxy in front of two mysql servers, then shutdown one.

Suggested fix:
Invalidate a node when the proxy can't connect to it, so all connections will go the the other one.
[5 Sep 2008 19:55] Sveta Smirnova
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments to the original bug instead.

Thank you for your interest in MySQL.

Duplicate of bug #35295