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

stats_mysql_commands_counters table doesn't address the new source replica terminology commands in MYSQL 8.0, 8.4+ #4727

Open
ParveezBaig opened this issue Oct 24, 2024 · 1 comment

Comments

@ParveezBaig
Copy link

ProxySQL needs to consider the new mysql source/replica terminology commands wherever applicable. MySQL 8.4+ no longer recognize the old master/slave terminology commands.

AFAICS the below three stats in stats_mysql_commands_counters table needs to be updated to consider the new terminology commands:
CHANGE_MASTER (shall consider CHANGE REPLICATION SOURCE)
RESET_MASTER (shall consider RESET BINARY LOGS AND GTIDS)
RESET_SLAVE (shall consider RESET REPLICA)

ProxySQL version : 2.7.1
OS version: centos 9

Steps to reproduce:

  1. Setup proxysql with at least one backend mysql 8.4+ server correctly configured.
  2. Configure the mysql user in proxysql, ensure that the user with necessary privileges exists on mysql 8.4+ server.
  3. Open proxysql connection via the user configured.
  4. Execute CHANGE MASTER command with right syntax as per mysql 8.0, the query errors out as syntax ERROR but the stats_mysql_commands_counters table will increase the count for CHANGE_MASTER.
  5. Execute CHANGE REPLICATION SOURCE command with right syntax, the query executes successfully on server but no effect in CHANGE_MASTER counter.

Same behavior for RESET_MASTER and RESET_SLAVE

Fix:
Rename CHANGE_MASTER, RESET_MASTER and RESET_SLAVE to CHANGE_REPLICATION_SOURCE, RESET_BINARY_LOGS_AND_GTIDS and RESET_REPLICA respectively and when server is 8.4+ then consider only the new terminology commands as old terminology commands are invalid and when the version is lower then 8.4 then consider both the new and old terminology commands.

@ParveezBaig ParveezBaig changed the title stats_mysql_commands_counters table doesn't address the new source replica terminology commands in latest MYSQL 8.0, 8.4 stats_mysql_commands_counters table doesn't address the new source replica terminology commands in MYSQL 8.0, 8.4+ Oct 24, 2024
@326068345
Copy link

I also encountered this problem:
mysql version: 8.4.3
proxysql version: 2.7.1

error info:
2024-11-25 02:28:53 MySQL_Monitor.cpp:7849:monitor_replication_lag_process_ready_tasks(): [ERROR] Error after 0ms on server 172.16.1.154:3306 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SLAVE STATUS' at line 1
2024-11-25 02:28:53 MySQL_Monitor.cpp:7849:monitor_replication_lag_process_ready_tasks(): [ERROR] Error after 0ms on server xx.xx.xx.xx:3306 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SLAVE STATUS' at line 1
2024-11-25 02:29:03 MySQL_Monitor.cpp:7849:monitor_replication_lag_process_ready_tasks(): [ERROR] Error after 0ms on server xx.xx.xx.xx:3306 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SLAVE STATUS' at line 1
2024-11-25 02:29:03 MySQL_Monitor.cpp:7849:monitor_replication_lag_process_ready_tasks(): [ERROR] Error after 0ms on server xx.xx.xx.xx:3306 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SLAVE STATUS' at line 1
2024-11-25 02:29:13 MySQL_Monitor.cpp:7849:monitor_replication_lag_process_ready_tasks(): [ERROR] Error after 0ms on server xx.xx.xx.xx:3306 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SLAVE STATUS' at line 1

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

2 participants