Bug #36387 Proxy fail-over bug
Submitted: 29 Apr 2008 1:56 Modified: 13 May 2008 9:26
Reporter: Sam Hass Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Proxy: Core Severity:S2 (Serious)
Version:0.6.1 OS:Linux (Debian Etch)
Assigned to: CPU Architecture:Any
Tags: bug, failover

[29 Apr 2008 1:56] Sam Hass
Description:
I am using mysql-proxy 0.6.1 and I think the fail over function is not completely working.

Here the command (sql is the proxy address) :

-----------------------------------
/usr/local/sbin/mysql-proxy \
        --daemon \
        --pid-file=/var/run/mysql-proxy.pid \
        --proxy-address=sql:3306 \
        --proxy-backend-addresses=sql1:3306 \
        --proxy-backend-addresses=sql2:3306 \
        >& /var/log/mysql-proxy.log
-----------------------------------

===================================
SQL1 and SQL2 are UP :
===================================

-----------------------------------
sql1:/home/xxx# mysql -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 209
Server version: 5.0.32-Debian_7etch5-log Debian etch distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>
-----------------------------------

-----------------------------------
sql2:/home/xxx# mysql -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 319
Server version: 5.0.32-Debian_7etch5-log Debian etch distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>
-----------------------------------

-----------------------------------
sql:/home/xxx# mysql -h sql -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 350
Server version: 5.0.32-Debian_7etch5-log Debian etch distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>
-----------------------------------

===================================
I SHUTDOWN SQL1 :
===================================

-----------------------------------
sql1:/home/xxx# mysql -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
-----------------------------------

-----------------------------------
sql2:/home/xxx# mysql -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 531
Server version: 5.0.32-Debian_7etch5-log Debian etch distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>
-----------------------------------

-----------------------------------
sql:/home/xxx# mysql -h sql -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 501
Server version: 5.0.32-Debian_7etch5-log Debian etch distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>
-----------------------------------

===================================
I start SQL1 and SHUTDOWN SQL2 :
===================================

-----------------------------------
sql1:/home/xxx# mysql -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 478
Server version: 5.0.32-Debian_7etch5-log Debian etch distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>
-----------------------------------

-----------------------------------
sql2:/home/xxx# mysql -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
-----------------------------------

-----------------------------------
sql:/home/xxx# mysql -h sql -p
Enter password:
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0
-----------------------------------

:(

How to repeat:
There is something is particularly bizarre. Sometimes SQL is up when SQL1 is down so I enjoy : failover is working ! But when I start SQL1 and then shutdown SQL2, sql seems to be down :(
[29 Apr 2008 2:03] Sam Hass
I just add a comment to say one thing I notice :

When mysql-proxy is running with --daemon option, failover work a very few time. But without this option, failover work more long time, but not all time.

Sorry for my english, it is 5am :)
[13 May 2008 9:26] 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 #34793