sysown / proxysql

High-performance MySQL proxy with a GPL license.
http://www.proxysql.com
GNU General Public License v3.0
6.05k stars 983 forks source link

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

Open ParveezBaig opened 4 weeks ago

ParveezBaig commented 4 weeks ago

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.