You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Rene:
Version v1.4.16
I find that if a new connection reuses the mysql_connection with auto_increment, multiplexing is incorrectly disabled.
Since auto_increment_delay_token of the mysql_connection with auto_increment is not reset to zero when the mysql_connection is pushed back to ConnectionsFree list. Then new session which reuses the connection will be multiplexing disabled since MySQL_Connection::MultiplexDisabled() returns true.
Reproduce:
1.create a new session and back end connection:A.
2.insert into xxxx with auto_increment, thus,auto_increment_delay_token is set to 5 by default.
3.disconnect and connection A is pushed back to ConnectionsFree list.
4.create a new session and will reuse connection:A. The new session is multiplexing disabled.
Fix:
Reset connection->auto_increment_delay_token to zero when get new back end connection
MySQL_Connection * MySQL_HostGroups_Manager::get_MyConn_from_pool(unsigned int _hid, MySQL_Session *sess, bool ff) {
MySQL_Connection * conn=NULL;
wrlock();
status.myconnpoll_get++;
MyHGC *myhgc=MyHGC_lookup(_hid);
MySrvC *mysrvc=myhgc->get_random_MySrvC();
if (mysrvc) { // a MySrvC exists. If not, we return NULL = no targets
conn=mysrvc->ConnectionsFree->get_random_MyConn(sess, ff);
if (conn) {
mysrvc->ConnectionsUsed->add(conn);
++conn->auto_increment_delay_token = 0;//reset auto_increment_delay_token of mysql_connection
status.myconnpoll_get_ok++;
}
}
wrunlock();
proxy_debug(PROXY_DEBUG_MYSQL_CONNPOOL, 7, "Returning MySQL Connection %p, server %s:%d\n", conn, (conn ? conn->parent->address : "") , (conn ? conn->parent->port : 0 ));
return conn;
}
Thank you!
The text was updated successfully, but these errors were encountered:
Thank you for the report.
Fixed in both 1.4.16 and 2.0.4 .
Note that the solution implemented is different than the suggested one. auto_increment_delay_token is being reset to 0 in MySQL_Connection::reset() .
Hi Rene:
Version v1.4.16
I find that if a new connection reuses the mysql_connection with auto_increment, multiplexing is incorrectly disabled.
Since auto_increment_delay_token of the mysql_connection with auto_increment is not reset to zero when the mysql_connection is pushed back to ConnectionsFree list. Then new session which reuses the connection will be multiplexing disabled since MySQL_Connection::MultiplexDisabled() returns true.
Reproduce:
1.create a new session and back end connection:A.
2.insert into xxxx with auto_increment, thus,auto_increment_delay_token is set to 5 by default.
3.disconnect and connection A is pushed back to ConnectionsFree list.
4.create a new session and will reuse connection:A. The new session is multiplexing disabled.
Fix:
Reset connection->auto_increment_delay_token to zero when get new back end connection
MySQL_Connection * MySQL_HostGroups_Manager::get_MyConn_from_pool(unsigned int _hid, MySQL_Session *sess, bool ff) {
MySQL_Connection * conn=NULL;
wrlock();
status.myconnpoll_get++;
MyHGC *myhgc=MyHGC_lookup(_hid);
MySrvC *mysrvc=myhgc->get_random_MySrvC();
if (mysrvc) { // a MySrvC exists. If not, we return NULL = no targets
conn=mysrvc->ConnectionsFree->get_random_MyConn(sess, ff);
if (conn) {
mysrvc->ConnectionsUsed->add(conn);
++conn->auto_increment_delay_token = 0;//reset auto_increment_delay_token of mysql_connection
status.myconnpoll_get_ok++;
}
}
wrunlock();
proxy_debug(PROXY_DEBUG_MYSQL_CONNPOOL, 7, "Returning MySQL Connection %p, server %s:%d\n", conn, (conn ? conn->parent->address : "") , (conn ? conn->parent->port : 0 ));
return conn;
}
Thank you!
The text was updated successfully, but these errors were encountered: