Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support more mysql system variables to keep mulitplexing enabled #1922

Merged
merged 7 commits into from
Mar 22, 2019

Conversation

ahaha-zhang
Copy link
Contributor

Hi, Rene:
I recently �debug why some connections were not multiplexing. I find that there are too many types of query digests, such as "select @@session.xxxx/select @@xxxx as yyy/select @@A,@b,@c", kinds of connector init-SQL and creative developers:).
I notice that there are only 2 exceptions hardcoded "select @@version/tx_isolation" that don't disable multiplexing. The other way is to configure a query rule. However, I have to configure too many kinds of query digests. Being able to configure more variables and support more kinds of queries is definitely preferred.
A new global variable in proxysql, default "tx_isolation,version":
mysql> show variables like 'mysql-keep_multiplexing_variables';
+-----------------------------------+----------------------+
| Variable_name | Value |
+-----------------------------------+----------------------+
| mysql-keep_multiplexing_variables | tx_isolation,version |
+-----------------------------------+----------------------+
1 row in set (0.00 sec)

A new function
bool MySQL_Connection::IsKeepMultiplexEnabledVariables(char *query_digest_text)

Support more kinds of query_digest_text:
select @@Version,@@tx_isolation;
select @@Version as aaa,@@tx_isolation as bbb,......;

@pondix
Copy link
Contributor

pondix commented Feb 22, 2019

Automated message: PR pending admin approval for build testing

@renecannao
Copy link
Contributor

@ahaha-zhang : would it be possible to have some unit test for the code in this PR?
Thank you

@ahaha-zhang
Copy link
Contributor Author

ahaha-zhang commented Mar 6, 2019

@renecannao, I've added the unit test code for this PR. Thank you for your review :)
file location:test/keepmultiplexingvariables/client1.cpp
commit:e05fe558073032d9cad177f7d6de658d443f9478

Copy link
Contributor Author

@ahaha-zhang ahaha-zhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug fix for #1943

@renecannao renecannao merged commit c1383b0 into sysown:v1.4.16 Mar 22, 2019
@renecannao
Copy link
Contributor

Thank you for the PR.
I will revert the last commit (81ea265) because fixed differently in f4d3d6b , and port it to 2.0 .
Thanks!

renecannao added a commit that referenced this pull request Mar 22, 2019
support more mysql system variables to keep mulitplexing enabled
Added variable mysql-keep_multiplexing_variables
renecannao added a commit that referenced this pull request Mar 22, 2019
@ahaha-zhang
Copy link
Contributor Author

OK, My pleasure:)

renecannao added a commit that referenced this pull request Apr 23, 2019
Dieken pushed a commit to Dieken/proxysql that referenced this pull request May 13, 2019
(cherry picked from commit 58d77e4)
renecannao added a commit that referenced this pull request Aug 10, 2019
Port to 1.4.x of commit 58d77e4
renecannao added a commit that referenced this pull request Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants