MySQL Forums
Forum List  »  Router & Proxy

Using --proxy-pool-no-change-user crashes MySQL database
Posted by: Brian Chang
Date: November 05, 2010 08:16PM

Hi, I used a lua script to keep back-end connections to MySQL database server persistent (i.e. to form a back-end connection pool), while allowing the clients to connect to MySQL-proxy by allocating a back-end server connection from the pool.

When using "--proxy-pool-no-change-user" option, hoping each new client connection does not need to incur the extra overhead to authenticate with back-end db server, it actually complains about packet_id unexpected (because con->client's last_packet_id and the actual incoming packet_id is different). So I force the con->client to reset in MySQL-proxy code to fix that. But then another problem arises: the backend MySQL DB server got crashed after I stress tested using clients issuing different SQL statements. My suspicion is that when "network_mysqld_con_reset_command_response_state()" and/or "network_mysqld_con_command_states_init()" are used to clean up connection's state in order to let a server connection take a new query from client side, the server connection can be in a state in which server is still expecting some data to complete a previous query. Now, by resetting the state of server connection and by being fed with some new query from a new client connection, the server becomes confused. I actually see the backend MySQL server crashes at a point when it tries to roll-back, and somehow gets segfault. I know "--proxy-pool-no-change-user" leaves temporary tables on the server connection per document, but do not realize it can actually crash and corrupt back-end MySQL database (i.e., restarting MySQL database server fails, and needs to go thru recovery process).


In short, looks like "--proxy-pool-no-change-user" is still not a robust feature, given that it can literally corrupt back-end MySQL server.

Options: ReplyQuote


Subject
Views
Written By
Posted
Using --proxy-pool-no-change-user crashes MySQL database
3248
November 05, 2010 08:16PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.