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

Unexpected behavior with admin variable mysql-hostgroup_manager_verbose #4611

Closed dbray925 closed 3 months ago

dbray925 commented 3 months ago

Description: I'm trying to remove the mysql_server dump into the /var/lib/proxysql/proxysql.log Updating mysql-hostgroup_manager_verbose does not work, and also does not save on restart.

ProxySQL version: proxysql-2.6.3-1.x86_64 OS version: Rocky Linux 8

The steps to reproduce the issue

SELECT * FROM global_variables WHERE variable_name = 'mysql-hostgroup_manager_verbose'; 
+---------------------------------+----------------+
| variable_name                   | variable_value |
+---------------------------------+----------------+
| mysql-hostgroup_manager_verbose | 1              |
+---------------------------------+----------------+
UPDATE global_variables SET variable_value='0' WHERE variable_name='mysql-hostgroup_manager_verbose';
SELECT * FROM global_variables WHERE variable_name = 'mysql-hostgroup_manager_verbose';
+---------------------------------+----------------+
| variable_name                   | variable_value |
+---------------------------------+----------------+
| mysql-hostgroup_manager_verbose | 0              |
+---------------------------------+----------------+
LOAD ADMIN VARIABLES TO RUNTIME; SAVE ADMIN VARIABLES TO DISK;

Unfortunately, the log files still show:

2024-08-15 17:54:54 [INFO] Dumping current MySQL Servers structures for hostgroup 1
2024-08-15 17:54:54 [INFO] Dumping mysql_servers: HG 1
+-----+----------+------+------+--------+--------+-----+-----------+---------+-----+---------+---------+-------------+
| hid | hostname | port | gtid | weight | status | cmp | max_conns | max_lag | ssl | max_lat | comment | mem_pointer |
+-----+----------+------+------+--------+--------+-----+-----------+---------+-----+---------+---------+-------------+
+-----+----------+------+------+--------+--------+-----+-----------+---------+-----+---------+---------+-------------+
2024-08-15 17:54:54 [INFO] Dumping current MySQL Servers structures for hostgroup 4
2024-08-15 17:54:54 [INFO] Dumping mysql_servers: HG 4
+-----+----------+------+------+--------+--------+-----+-----------+---------+-----+---------+---------+-------------+
| hid | hostname | port | gtid | weight | status | cmp | max_conns | max_lag | ssl | max_lat | comment | mem_pointer |
+-----+----------+------+------+--------+--------+-----+-----------+---------+-----+---------+---------+-------------+
+-----+----------+------+------+--------+--------+-----+-----------+---------+-----+---------+---------+-------------+

In addition to the above issue, when I restart ProxySQL, the variable reverts back to 1:

sudo systemctl restart proxysql

SELECT * FROM global_variables WHERE variable_name = 'mysql-hostgroup_manager_verbose';
+---------------------------------+----------------+
| variable_name                   | variable_value |
+---------------------------------+----------------+
| mysql-hostgroup_manager_verbose | 1              |
+---------------------------------+----------------+
renecannao commented 3 months ago

Hi @dbray925 .

SELECT ... variable_name = 'mysql-... UPDATE ... variable_name='mysql-... LOAD ADMIN ... SAVE ADMIN ...

Do you see the problem? mysql != ADMIN

I hope this help. Thanks.

dbray925 commented 3 months ago

Apologies, I'm missing something. I thought after updating any global_variables I needed to: LOAD ADMIN VARIABLES TO RUNTIME; SAVE ADMIN VARIABLES TO DISK;

renecannao commented 3 months ago

If you change mysql variables, you must use LOAD MYSQL VARIABLES ... and SAVE MYSQL VARIABLES ... . If you change admin variables, you must use [LOAD|SAVE] ADMIN VARIABLES ... . You changed a mysql- variable.

dbray925 commented 3 months ago

Very sorry about that, I was blind to the MYSQL vs. ADMIN. The variable is now staying at 0, and the logs look much cleaner now. Thank you so much for your time, and sorry again it was end user error :-(