Skip to content

Commit 928cd42

Browse files
fix: [DPE-6234] Disable general_log and plugin audit_log_filter (#574)
* fix: [DPE-6234] Disable general_log and plugin audit_log_filter 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 * Fix unit tests * Add loose- prefix for audit_log_filter to start MySQL Otherwise MySQL didn't start as the option is unknown until plugin is loaded. * Remove general.log from tests * finishing general log removal * update cffi as 1.16 has no binary for py3.13 * further test fixes and typing update --------- Co-authored-by: Alex Lutay <[email protected]>
1 parent a80079b commit 928cd42

File tree

6 files changed

+93
-88
lines changed

6 files changed

+93
-88
lines changed

lib/charms/mysql/v0/mysql.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def wait_until_mysql_connection(self) -> None:
133133
# Increment this major API version when introducing breaking changes
134134
LIBAPI = 0
135135

136-
LIBPATCH = 78
136+
LIBPATCH = 79
137137

138138
UNIT_TEARDOWN_LOCKNAME = "unit-teardown"
139139
UNIT_ADD_LOCKNAME = "unit-add"
@@ -1002,10 +1002,11 @@ def render_mysqld_configuration( # noqa: C901
10021002
"innodb_buffer_pool_size": str(innodb_buffer_pool_size),
10031003
"log_error_services": "log_filter_internal;log_sink_internal",
10041004
"log_error": f"{snap_common}/var/log/mysql/error.log",
1005-
"general_log": "ON",
1005+
"general_log": "OFF",
10061006
"general_log_file": f"{snap_common}/var/log/mysql/general.log",
10071007
"slow_query_log_file": f"{snap_common}/var/log/mysql/slow.log",
10081008
"binlog_expire_logs_seconds": f"{binlog_retention_seconds}",
1009+
"loose-audit_log_filter": "OFF",
10091010
"loose-audit_log_policy": "LOGINS",
10101011
"loose-audit_log_file": f"{snap_common}/var/log/mysql/audit.log",
10111012
}

0 commit comments

Comments
 (0)