Bug #34793 Failover/Balancing packet error
Submitted: 24 Feb 2008 21:17 Modified: 17 Aug 2009 17:19
Reporter: Paul Freeman
Status: Closed
Category:Proxy: Core Severity:S1 (Critical)
Version:0.61 & Trunk r369 OS:Linux (2.6.23-gentoo-r8)
Assigned to: MC Brown Target Version:
Tags: regression, failover, balance, linux, x86_64, amd64, gentoo, 2.6.23
Triage: D2 (Serious)

[24 Feb 2008 21:17] Paul Freeman
Description:
Running the proxy in standard balance/failover mode as described at
http://forge.mysql.com/wiki/MySQL_Proxy#Load_Balancing_.26_Failover

quote: "Run your tests, shut down one of the backends and see how the MySQL Proxy sends
all traffic to the one which is still alive."

shutting down a backend node renders the proxy unusable, causing it to reject all
connections:

error from mysql-proxy stdout:
2008-02-24 20:06:38: (critical) plugin.c.3778: connect(<host a>:3306) failed: Connection
refused

error from the connecting client:
mysql -h <proxy host> -p -u<user> --port 4040
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication
packet', system error: 0

I have tested using 0.61 binaries from dev.mysql.com, 0.61 source tree and Trunk r369.

How to repeat:

using 0.61 binaries from dev.mysql.com or 0.61 source tree or Trunk r369.

./mysql-proxy \
 --proxy-backend-addresses=<host a>:3306 \
 --proxy-backend-addresses=<host b>:3308 

stop the mysqld instance running on host a or host b and the proxy will no longer accept
client connections:

error from mysql-proxy stdout:
2008-02-24 20:06:38: (critical) plugin.c.3778: connect(<host a>:3306) failed: Connection
refused

error from the connecting client:
mysql -h <proxy host> -p -u<user> --port 4040
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication
packet', system error: 0

Suggested fix:
none known at time of posting.
[27 Feb 2008 0:03] Sveta Smirnova
Thank you for the report.

Verified as described.
[13 May 2008 11:27] Sveta Smirnova
Bug #36387 was marked as duplicate of this one.
[19 May 2008 12:57] Sveta Smirnova
Bug is not repeatable with Load Balancer.
[23 Jun 2008 14:32] Sveta Smirnova
Bug is not repeatable with current SVN sources.

Also it seems to be duplicate of bug #35295
[24 Sep 2008 22:00] Sveta Smirnova
Bug #39628 was marked as duplicate of this one.
[10 Feb 2009 12:01] Veneet Raina
Is this bug fixed under current svn trunk or work is still in progress.
[8 May 2009 5:01] scott fagg
Is a version of mysql-proxy with a fix for this issue publicly available anywhere ?
[9 Jun 2009 15:36] Diego Medina
Verified fixed on 0.7.1
[17 Aug 2009 17:19] MC Brown
A note has been added to the 0.7.1 changelog: 

When using MySQL Proxy with multiple backends, the failure of one backend would cause
proxy to disconnect all backends and stop routing requests.