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

The established connection did not execute the avoidance policy #4639

Open
zhaozhiguang opened this issue Sep 6, 2024 · 0 comments
Open

Comments

@zhaozhiguang
Copy link

zhaozhiguang commented Sep 6, 2024

version:2.6.3
mode:mysql group replication
system:centos8

I am using Hikari connection pool and JDBC template to query data (select count (*) from table) for lag data validation. I found that lagging data can be queried, but I directly changed to using JDBC's driverManager.getConnection() retrieves new connections and executes the same query data each time

problem analysis
Connection pool (such as HikariCP): A connection pool establishes and maintains a certain number of database connections in advance. These connections were already directed to specific MySQL server instances at the time of creation. If ProxySQL detects a delay in a server instance and decides not to route new queries to that instance, but established connections still point to that instance, queries executed through these connections may still return old data.
Driver Manager: Every time a connection is obtained through Driver Manager, a new connection is established. If ProxySQL has updated its routing rules based on the state of MGR, new connections will follow these rules, making it more likely to connect to the server instance with the latest data.

expect
The established connection should also implement the backend MySQL server replication lag avoidance strategy

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

No branches or pull requests

1 participant