Bug #43126 two proxy-backend-addresses with same IP but different port does not failover
Submitted: 24 Feb 1:18 Modified: 24 Feb 9:35
Reporter: Gabriel Kuri
Status: Verified
Category:Proxy: Core Severity:S3 (Non-critical)
Version:trunk (0.7) OS:Linux
Assigned to: Jan Kneschke Target Version:
Triage: Needs Triage: D2 (Serious)

[24 Feb 1:18] Gabriel Kuri
Description:
configuring two proxy-backend-addresses with the same IP address but different TCP port,
ie --proxy-backend-addresses=127.0.0.1:3306 --proxy-backend-addresses=127.0.0.1:3307
doesn't seem to failover. the reason for this configuration is to tunnel the mysql
traffic over a ssh tunnel to remote mysql servers to encrypt the mysql traffic. if the
server ip addresses are specified directly, failover works if one of the servers fails,
but when specifying 127.0.0.1 with different tcp ports, it doesn't failover to the other
server if one of the servers fail. message from the logs ...

2009-02-23 11:08:06: (debug) [network-mysqld.c:781]: error on server connection (fd: 10
event: 2). closing client connection.
2009-02-23 11:09:41: (message) last message repeated 6 times

How to repeat:
setup two ssh tunnels to two different mysql servers and setup the
proxy-backend-addresses to point to 127.0.0.1 and the tcp ports used for the ssh tunnel.
start mysql-proxy, launch the mysql client and connect to the local mysql-proxy address,
and then shutdown the first mysql server, and attempt to use the mysql client. the client
will complain it lost a connection to the server continuously and mysql-proxy will not
attempt to use the second mysql server.
[24 Feb 9:35] Sveta Smirnova
Thank you for the report.

Verified as described.

Problem exists only if connection over SSH tunnel is used. If just use 2 different
servers on different ports on the same machine everything works fine.