pt-deadlock-logger error: Use of uninitialized value $ts in pattern match (m//)
Bug #1195034 reported by
Daniel Nichter
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/
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/^((?:
4144 if ( length($year) == 2 ) {
4145 $year += 2000;
4146 }
4147 $ts = sprintf(
4148 my ( $victim ) = $dl_text =~ m/^\*\*\* WE ROLL BACK TRANSACTION \((\d+)\)$/m;
4149 $victim ||= 0;
Related branches
lp:~percona-toolkit-dev/percona-toolkit/fix-dl-ts-bug-1195034
- Daniel Nichter: Approve
-
Diff: 69 lines (+36/-0)3 files modifiedbin/pt-deadlock-logger (+5/-0)
t/pt-deadlock-logger/bugs.t (+17/-0)
t/pt-deadlock-logger/samples/bug_1195034.txt (+14/-0)
lp:~percona-toolkit-dev/percona-toolkit/fix-dl-ts-bug-1195034-2.1
- Daniel Nichter: Approve
-
Diff: 69 lines (+36/-0)3 files modifiedbin/pt-deadlock-logger (+5/-0)
t/pt-deadlock-logger/bugs.t (+17/-0)
t/pt-deadlock-logger/samples/bug_1195034.txt (+14/-0)
To post a comment you must log in.
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/.