Documentation for audit_log_rotate_on_size needs improvement.
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.6 |
Triaged
|
High
|
Unassigned | |||
5.7 |
Triaged
|
High
|
Unassigned |
Bug Description
In short: audit_log_
From the online docs:
it is never mentioned that for this variable to correctly work, audit_log_rotations needs to be set to some value greater than 0 (0 being the default).
If audit_log_rotations is not set, then even if audit_log_handler is set to FILE, it won't have any effect. Note that the documentation only states the following for audit_log_
"""
This variable is used to specify the maximum audit log file size. Upon reaching this size the log will be rotated. The rotated log files will be present in the same same directory as the current log file. A sequence number will be appended to the log file name upon rotation. This variable has effect only when audit_log_handler is set to FILE.
"""
Suggested fix:
Add that audit_log_rotations also needs to be set, apart from audit_log_handler.
How to reproduce:
Version:
| version | 5.6.36-82.0 |
| version_comment | Percona Server (GPL), Release 82.0, Revision 58e846a |
mysql [localhost] {msandbox} ((none)) > show variables like 'audit%';
+------
| Variable_name | Value |
+------
| audit_log_
| audit_log_
| audit_log_
| audit_log_file | audit.log |
| audit_log_flush | OFF |
| audit_log_format | OLD |
| audit_log_handler | FILE |
| audit_log_
| audit_log_
| audit_log_policy | ALL |
| audit_log_
| audit_log_rotations | 0 |
| audit_log_strategy | ASYNCHRONOUS |
| audit_log_
| audit_log_
| audit_log_
+------
Generate load on the server, so queries are logged to the audit log, and see how it's not rotated:
shell> ls -l audit.log*
-rw-rw---- 1 agustin.gallego percona 7803993 Jun 2 15:03 audit.log
shell> ls -lh audit.log*
-rw-rw---- 1 agustin.gallego percona 7.5M Jun 2 15:03 audit.log
tags: | added: doc |
Percona now uses JIRA for bug reports so this bug report is migrated to: https:/ /jira.percona. com/browse/ PS-1097