[MDEV-23540] Can't disable Mariadb general query log Created: 2020-08-22  Updated: 2020-08-30  Resolved: 2020-08-30

Status: Closed
Project: MariaDB Server
Component/s: Configuration
Affects Version/s: 10.4.13
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Artem Russakovskii Assignee: Sergei Golubchik
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

OpenSUSE 15.2



 Description   

Hi folks,

I'm at a loss here. I've had a mysql and now mariadb (MariaDB 10.4.13-MariaDB-log) slave with query logging enabled for years, but I'm now trying to turn it off using the my.cnf option and it does not seem to stick on server restarts.

What's weird is the other slaves with the exact same my.cnf don't log, but this one slave refuses to stop doing it.

To clarify, SET global general_log = 0 does stop logging but the setting comes back on after a restart.

I'm turning it off in my.cnf like this:
general_log = off
#Enter a name for the query log file. Otherwise a default name will be used.
general_log_file=/var/log/mysql/mysqld-queries.log

Commenting out general_log_file simply changes it to go to a different location. I also tried general_log=0 without any luck.

ps shows it as running with:
mysql 27580 1 99 16:26 ? 00:01:40 /usr/sbin/mysqld --defaults-file=/etc/my.cnf --user=mysql
So --general-log isn't getting set on command line.

What am I missing? Why does it insist on getting turned on and refuses to listen to the setting? Is it a bug?

Thanks.

Sincerely,
Artem



 Comments   
Comment by Artem Russakovskii [ 2020-08-29 ]

The option is in the same group as all other settings that do take effect ( [mysqld] ) and is the same across all 3 slave servers.

Default options are read from the following files in the given order:
/etc/my.cnf ~/.my.cnf
The following groups are read: mysqld server mysqld-10.4 mariadb mariadb-10.4 mariadbd mariadbd-10.4 client-server galera

~/.my.cnf only contains user/password auth info and nothing else.

The printout lists these:

general-log TRUE
general-log-file /var/log/mysql/mysqld-queries.log

The log-file is exactly what I set in my.cnf, but general-log is set to TRUE, even though I have it set to "off".

I'm still at a loss.

Comment by Artem Russakovskii [ 2020-08-29 ]

Thanks to Karl Levik, I just found where the setting is coming from. It is indeed coming from an include at the very end of my.cnf (!includedir /etc/my.cnf.d) which I now vaguely remember setting up many years ago and stuffing any settings that are different across the slaves in there so that the main file could be rsynced over freely. I didn't see it because it was the last line in the config, past other sections, so it didn't occur to me that stuff in other sections could be affecting [mysqld]. �‍♂️ �‍♂️ �‍♂️ egg on face.

One thing that would have been really good in this process is either a way to see where a given value was set or a verbose mode that prints out each value as config files are being read along with config file names. Basically, some way to trace who does what, where, and when.

This issue may be closed otherwise, I don't seem to have the power to do it.

Comment by Sergei Golubchik [ 2020-08-30 ]

in 10.5 you can see where the value was set, MDEV-12684.

Generated at Thu Feb 08 09:23:10 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.