pt-query-digest fails to parse timestamp with no query

Bug #1082599 reported by Ovais Tariq
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Fix Released
High
Daniel Nichter

Bug Description

Brian I am reporting this as a bug in relation to what we talked about the problem I was facing with getting pt-query-digest to parse the slow log.

# pt-query-digest --version
pt-query-digest 2.1.5

The tool pt-query-digest fails to parse the slow log for queries if the queries are prefixed by SET timestamp=xxx. Removing the "SET timestamp=xxx" statements from the slow log fixes the issue and pt-query-digest then works as expected.

Related branches

Revision history for this message
Ovais Tariq (ovais-tariq) wrote :

I would like to add that this bug affects those who use this feature of Percona Server: http://www.percona.com/doc/percona-server/5.5/diagnostics/slow_extended_55.html#slow_query_log_timestamp_always

Brian Fraser (fraserbn)
tags: added: percona-server
Changed in percona-toolkit:
status: New → Triaged
milestone: none → 2.1.8
Revision history for this message
Brian Fraser (fraserbn) wrote :
Changed in percona-toolkit:
importance: Undecided → High
Changed in percona-toolkit:
assignee: nobody → Daniel Nichter (daniel-nichter)
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

This should work already: SlowLogParser.pm knows about SET statements. Maybe the format of those statements has changed. If you could provide a sample log that causes the problem, Ovais, that would be great. Else I'll try to reproduce it.

Revision history for this message
Ovais Tariq (ovais-tariq) wrote :

Daniel,

I have attached the log file that pt-query-digest is failing to parse. Note that removing "set timestamp = xxx" from the log fixes the issue.

For example use the attached slow.log file as follows and pt-query-digest will not parse it correctly:
cat slow.log | pt-query-digest

However, remove the SET TIMESTAMP = xx line and everything works fine:
cat slow.log | sed '/SET timestamp/d' | pt-query-digest

Changed in percona-toolkit:
status: Triaged → In Progress
summary: - pt-query-digest fails to parse queries preceded with SET timestamp=x
+ pt-query-digest fails to parse timestamp with no query
Changed in percona-toolkit:
status: In Progress → Fix Committed
Changed in percona-toolkit:
status: Fix Committed → Fix Released
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/PT-341

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

Other bug subscribers

Bug attachments

Remote bug watches

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