pt-deadlock-logger error: Use of uninitialized value $ts in pattern match (m//)

Bug #1195034 reported by Daniel Nichter on 2013-06-26
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
2.1
Fix Released
High
Daniel Nichter
2.2
Fix Released
High
Daniel Nichter

Bug Description

A customer has reported a case where the deadlock information causes:

Use of uninitialized value $ts in pattern match (m//) at /usr/bin/pt-deadlock-logger line 4143.

The lines around 4143:
4141 # Extract some miscellaneous data from the deadlock.
4142 my ( $ts ) = $dl_text =~ m/^$s$/m;
4143 my ( $year, $mon, $day, $hour, $min, $sec ) = $ts =~ m/^((?:\d\d)?\d\d)-?(\d\d)-?(\d\d) +(\d+):(\d+):(\d+)$/;
4144 if ( length($year) == 2 ) {
4145 $year += 2000;
4146 }
4147 $ts = sprintf('%02d-%02d-%02dT%02d:%02d:%02d', $year, $mon, $day, $hour, $min, $sec);
4148 my ( $victim ) = $dl_text =~ m/^\*\*\* WE ROLL BACK TRANSACTION \((\d+)\)$/m;
4149 $victim ||= 0;

Related branches

Daniel Nichter (daniel-nichter) wrote :

The cause is timestamp lines like:

130624 17:39:24TOO DEEP OR LONG SEARCH IN THE LOCK TABLE WAITS-FOR GRAPH, WE WILL ROLL BACK FOLLOWING TRANSACTION

The code assumed that ts matched /^<ts>$/. Now when this fails, we try to match /^<ts>TOO DEEP/.

Changed in percona-toolkit:
status: Confirmed → Fix Committed

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

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

Other bug subscribers