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

Enforce CLIENT_DEPRECATE_EOF capability match for conn-pool #4806

Merged
merged 5 commits into from
Feb 3, 2025

Conversation

JavierJF
Copy link
Collaborator

Description

This PR enforces the matching of capabilities between backend and frontend connections. This matching extends to other capabilities which matching should also be enforced (and already is), when performing a connection selection from the connection pool. This is now enforced/check after a created connection has been returned to the session.

A new config variable has been introduced for this mysql-connpool_match_client_deprecate_eof, with default value true. This enforced matching on capabilities is always required for fast_forward connections, and it's also enforced when a session switches from a regular session to fast_forward.

Using the default settings, since the matching is enabled by default, the transition from a regular session to fast_forward is guaranteed to be smooth, otherwise the backend connection would fail to be created in the first instance. If the config allows a mismatch, the session would be terminated when transitioning to fast_forward if the backend connection doesn't match the required capabilities.

Other changes

This PR also enables deprecate_eof support for SQLite3 sessions. This allows to perform the testing of all the possible combinations of the new matching using a single ProxySQL instance. See the new test test_match_eof_conn_cap.cpp.

TODO

The same change should be performed for the Admin interface, but the work has been postponed. When implemented it would be a nice opportunity to perform a rework of how intercepted statements to improve maintainability. Also, this change should be paired with a test similar to the new test test_sqlite3_special_queries.cpp included in this PR.

Add new config option ('mysql-connpool_match_client_deprecate_eof') that
allows to control whether to enforce a match between fronted and backend
connections for 'CLIENT_DEPRECATE_EOF' capability. By default, this
option is 'true', allowing smooth transitions from regular sessions to
'fast_forward'.
…lclient'

Using both libraries allows to test the compatibility of 'fast-forward'
sessions for SQLite3 sessions.
@renecannao renecannao merged commit 97dda90 into v3.0 Feb 3, 2025
42 of 151 checks passed
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.

2 participants