Documentation for audit_log_rotate_on_size needs improvement.

Bug #1695468 reported by Agustín
6
This bug affects 1 person
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_rotate_on_size will not work unless audit_log_rotations is set to a value greater than 0.

From the online docs:

https://www.percona.com/doc/percona-server/5.6/management/audit_log_plugin.html#audit_log_rotate_on_size

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_rotate_on_size:

"""
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_buffer_size | 1048576 |
| audit_log_exclude_accounts | |
| audit_log_exclude_commands | |
| audit_log_file | audit.log |
| audit_log_flush | OFF |
| audit_log_format | OLD |
| audit_log_handler | FILE |
| audit_log_include_accounts | |
| audit_log_include_commands | |
| audit_log_policy | ALL |
| audit_log_rotate_on_size | 5242880 |
| audit_log_rotations | 0 |
| audit_log_strategy | ASYNCHRONOUS |
| audit_log_syslog_facility | LOG_USER |
| audit_log_syslog_ident | percona-audit |
| audit_log_syslog_priority | LOG_INFO |
+----------------------------+---------------+

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: audit doc i191354
tags: added: doc
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-1097

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.