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

Add tracking for session_track_state_change and session_track_system_… #4159

Closed
wants to merge 5 commits into from

Conversation

javsanpar
Copy link
Contributor

…variables

Add tracking for 2 new variables: session_track_state_change and session_track_system_variables. If a client tries to set these variables explicitly, the request from the client will be ignored.

Also, add a new ProxySQL MySQL variable
(mysql-enable_session_state_trackers) that, if enabled, the 2 MySQL variables will be automatically set into each MySQL client connection. ProxySQL will try to set these variables on backend connections and will track if the SET on backend failed or succeeded.

…variables

Add tracking for 2 new variables: session_track_state_change and
session_track_system_variables. If a client tries to set these variables
explicitly, the request from the client will be ignored.

Also, add a new ProxySQL MySQL variable
(mysql-enable_session_state_trackers) that, if enabled, the 2 MySQL
variables will be automatically set into each MySQL client connection.
ProxySQL will try to set these variables on backend connections and will
track if the SET on backend failed or succeeded.
Move it from MySQL_Session::handler() to
MySQL_Thread::create_new_session_and_client_data_stream().

This way, we ensure the code is always executed when a client connects
to ProxySQL.
MySQL_Thread::create_new_session_and_client_data_stream() to
MySQL_Session::get_pkts_from_client().

Otherwise, session track variables state is lost when changing user.
Create a helper function to set the variables an use it after the
creation of the client connection and after the reset of the client
connection.
Checks whether session track variables have been configured properly.
@mirostauder
Copy link
Collaborator

retest this please

1 similar comment
@mirostauder
Copy link
Collaborator

retest this please

@renecannao
Copy link
Contributor

Closing because included in #4164

@renecannao renecannao closed this Apr 21, 2023
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