Bug #61798 | using mysql-proxy connection pool error | ||
---|---|---|---|
Submitted: | 8 Jul 2011 8:42 | Modified: | 17 Apr 2018 23:35 |
Reporter: | Thomas Zhang | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Proxy | Severity: | S2 (Serious) |
Version: | 0.8.1, 0.9.0 | OS: | FreeBSD (7.3-STABLE (64bit)) |
Assigned to: | CPU Architecture: | Any | |
Tags: | proxy database |
[8 Jul 2011 8:42]
Thomas Zhang
[16 Jul 2011 13:23]
Valeriy Kravchuk
Please, check if the same problem happens with a newer version of proxy, 0.9.0.
[18 Jul 2011 8:30]
Thomas Zhang
>> Please, check if the same problem happens with a newer version of proxy, 0.9.0. how to download MySQL Proxy 0.9.0 ?
[18 Jul 2011 11:23]
Valeriy Kravchuk
You can get it using bzr: bzr branch lp:mysql-proxy See https://launchpad.net/mysql-proxy/trunk
[27 Jul 2011 8:44]
Thomas Zhang
I installed the MYSQL-PROXY 0.9.0 , But still have the same problem Are there other ways to test the database switching problem ?
[27 Jul 2011 9:05]
Thomas Zhang
mysql-proxy 0.9.0 chassis: mysql-proxy 0.9.0 glib2: 2.26.1 libevent: 1.4.13-stable LUA: Lua 5.1.4 package.path: /usr/local/mysql-proxy090/lib/mysql-proxy/lua/?.lua package.cpath: /usr/local/mysql-proxy090/lib/mysql-proxy/lua/?.so -- modules admin: 0.9.0 proxy: 0.9.0 ------------------------------------- [read_query] 192.168.9.225:56743 current backend = 0 client default db = client username = report sending to backend : 192.168.9.176:3306 is_slave : false server default db: report_zc server username : report in_trans : false in_calc_found : false COM_QUERY : false [read_query] 192.168.9.225:56743 current backend = 0 client default db = report_zc client username = report query = SELECT count(*) as count FROM report_einfo WHERE i_etype IN(1,2,3,4,6) server default db: arab_space_cluster_1 client default db: report_zc syncronizing sending to backend : 172.21.15.73:3306 is_slave : true server default db: arab_space_cluster_1 server username : tm198102 in_trans : false in_calc_found : false COM_QUERY : true --------------------------------------------------------- query = SELECT count(*) as count FROM report_einfo WHERE i_etype IN(1,2,3,4,6) server default db: arab_space_cluster_1 client default db: report_zc syncronizing <--- ( switch DB fail ?! ) site info: MySQL Query Error Script: /index.php DB Server: Default SQL: SELECT count(*) as count FROM report_einfo WHERE i_etype IN(1,2,3,4,6) Error: Table 'arab_space_cluster_1.report_einfo' doesn't exist Errno.: 1146
[20 Mar 2012 21:50]
Sveta Smirnova
Thank you for the feedback. Please ignore previous comment: I had error in my test setup. I can not repeat described behavior. Do you have all databases on each of 3 servers?
[21 Apr 2012 1:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
[24 Jan 2014 23:41]
Mikko Lampikoski
I ended up with the same problem in the case of a multi-database server. It clearly attempt to do SELECT from wrong database. I have similar configuration as Thomas have. Error: Table 'wrongdatabasename.store' doesn't exist Error No: 1146 SELECT * FROM store mysql-proxy version: 0.8.1, Debian GNU/Linux 7.
[9 Dec 2014 19:10]
Sveta Smirnova
Thank you for the feedback. Do you have all databases on all servers? Simply if you use 1 database on first server, second database on the second one and third on third you cannot use bundled scripts such as rw-splitting.lua, because they are not supposed to handle such complicated setup. You should modify bundled scripts to suite your needs.
[9 Dec 2014 19:32]
Mikko Lampikoski
All databases on one server (master+slave). One mysql-proxy and one mysql-master and one mysql-slave. Just want to split reads to master+slave and writes only to master.
[15 Dec 2014 20:29]
Sveta Smirnova
Thank you for the feedback. I still cannot repeat described behavior with following test: 1. Start master-slave setup. 2. Create following tables and records on master: create database test1; create table test1.t1(f1 int); create database test2; create table test2.t2(f1 int); create database test3; create table test3.t3(f1 int); insert into test1.t1 values(1); insert into test2.t2 values(2); insert into test3.t3 values(3); 3. Start proxy: mysql-proxy --proxy-backend-addresses=127.0.0.1:13000 --proxy-read-only-backend-addresses=127.0.0.1:13001 --log-level=debug 4. Run following PHP scripts in three terminal windows: while true; do php -r '$m=mysqli_connect("127.0.0.1", "root", "", "", 4040); $m->select_db("test1"); sleep(1); $m->query("select * from t1");if (0 != $m->errno) var_dump($m->error, $m->errno);'; done while true; do php -r '$m=mysqli_connect("127.0.0.1", "root", "", "", 4040); $m->select_db("test3"); sleep(1); $m->query("select * from t3");if (0 != $m->errno) var_dump($m->error, $m->errno);'; done while true; do php -r '$m=mysqli_connect("127.0.0.1", "root", "", "", 4040); $m->select_db("test2"); sleep(1); $m->query("select * from t2");if (0 != $m->errno) var_dump($m->error, $m->errno);'; done Please check how these scripts differ from way you connect to MySQL Proxy and select databases.
[16 Jan 2015 1:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
[20 Jan 2015 11:54]
Bruno Morais
Hi, I have the same problem. I have Master + Slave setup with replication. Master has mysql-proxy-0.8.5 installed. my /etc/mysql-proxy.cnf: [mysql-proxy] daemon = true pid-file = /var/run/mysql-proxy.pid log-file = /var/log/mysql-proxy.log log-level = debug max-open-files = 2048 plugins = admin,proxy user = mysql-proxy #local min_idle_connections = 4 #local max_idle_connections = 8 # #Proxy Configuration proxy-address = 192.168.10.30:3306 proxy-backend-addresses = db01.local:3305 proxy-read-only-backend-addresses = db02.local:3305 proxy-lua-script = /usr/lib64/mysql-proxy/lua/proxy/rw-splitting.lua #proxy-skip-profiling = true # # Admin Configuration admin-address = 0.0.0.0:4041 admin-lua-script = /usr/lib64/mysql-proxy/lua/admin.lua admin-username = admin admin-password = xxxxxx I have several databases with different users. When 1 connection is made everything goes ok. When a second connection is made is like is is using previous connection to database as the results are wrong. (Database structure are the same only data differs). If I change database name just to check if I receive error, it works ok. I receive error saying database does not exists. But with database name correct I receive data from another database like a previous connection database. So I believe the behaviour is the same as the other posts. Is there a solution already? Regards, Bruno Morais