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

fix: [DPE-6234] Disable general_log and plugin audit_log_filter #566

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

taurus-forever
Copy link
Contributor

@taurus-forever taurus-forever commented Dec 13, 2024

Issue

The config option general_log is not compatible with the real productions due to the massive SQL queries dump into the general.log: https://dev.mysql.com/doc/refman/8.0/en/query-log.html

... The server writes information to this log when clients connect or
disconnect, and it logs each SQL statement received from clients...

In the past, it was a necessary evil as we had to keep all records about user's connects/disconnects for the security reasons. Nowadays we have audit_log plugin enabled by default, therefor no need to pay such a high performance price and struggle from the general.log size

#523 (comment)

33GB /var/snap/charmed-mysql/common/var/log/mysql/archive_general/general.log-20241212_0013

Additionally, we are working on the logs compression spec (separate topic).


While working here, we have noticed unnecessary enabled plugin audit_log_filter which also produces log files in /var/lib/mysql. Disabling it for now, as it is not necessary for audit_log plugin announcer functionality.

We will consider re-enabling the plugin without rush in https://warthogs.atlassian.net/browse/DPE-6235

Solution

  • Permanently disable general_log (as no longer necessary)
  • Temporary disable plugin audit_log_filter (to re-enable safely later).

The config option general_log is not compatible with the real
productions due to dumping all SQL queries to the general.log:
https://dev.mysql.com/doc/refman/8.0/en/query-log.html

> ... The server writes information to this log when clients connect or
> disconnect, and it logs each SQL statement received from clients...

In the past, it was a necessary evil as we had to keep record all
connects/disconnects from the clients for security reasons.
Nowadays we have audit_log plugin enabled by default, therefor no need to
pay such a high performance price and struggle from the general.log size

#523 (comment)
>  33GB /var/snap/charmed-mysql/common/var/log/mysql/archive_general/general.log-20241212_0013

Additionally, we are working on the logs compression spec (separate topic).

---

While working here, we have noticed unnecessary enabled plugin audit_log_filter
which also produces log files in /var/lib/mysql. Disabling it for now,
as it is not necessary for audit_log plugin announcer functionality.

We will consider re-enabling the plugin without rush in
https://warthogs.atlassian.net/browse/DPE-6235
Otherwise MySQL didn't start as the option is unknown until plugin is loaded.
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

Successfully merging this pull request may close these issues.

4 participants