audit_log: malformed record could be written after audit_log_flush=ON in ASYNC and PERFORMANCE modes

Bug #1613650 reported by Sergei Glushchenko
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.5
Fix Released
High
Sergei Glushchenko
5.6
Fix Released
High
Sergei Glushchenko
5.7
Fix Released
High
Sergei Glushchenko

Bug Description

Parser reporting

not well-formed (invalid token) at line 639, column 12, byte 20241 at /usr/lib/x86_64-linux-gnu/perl5/5.20/XML/Parser.pm line 187.

but in my testing environment the log file is only 18919 bytes and 577 lines.

We need to add the code to print the entire file in case of parser error to diagnose the issue.

Tags: audit ci
tags: added: audit ci
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

Malformed record appears at the end of the file and it looks like:

<AUDIT_RECORD
  NAME=</AUDIT>
"Query"
  RECORD="40_2016-08-25T14:07:40"
  TIMESTAMP="2016-08-25T14:07:40 UTC"
  COMMAND_CLASS="select"
  CONNECTION_ID="122"
  STATUS="0"
  SQLTEXT="select '&amp;;&amp;&amp;&amp;&quot;&quot;&quot;&quot;&lt;&gt;&lt;&lt;&gt;&gt;&gt;&gt;'"
  USER="root[root] @ localhost []"
  HOST="localhost"
  OS_USER=""
  IP=""
  DB="test"
/>

Note that </AUDIT> is written in the middle of <AUDIT_RECORD>. Probably footer (which is written by logger_close) interferes with the usual record written by flush thread.

Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Sergei, please edit the title of the bug for the underlying issue, this will need a proper release notes entry

summary: - Sporadic audit_log_old failures
+ audit_log: malformed record could be written after audit_log_flush=ON in
+ ASYNC and PERFORMANCE modes
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :
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-996

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.