Merge lp:~percona-toolkit-dev/percona-toolkit/fix-dl-ts-bug-1195034 into lp:~percona-toolkit-dev/percona-toolkit/release-2.2.4

Proposed by Daniel Nichter
Status: Merged
Merged at revision: 592
Proposed branch: lp:~percona-toolkit-dev/percona-toolkit/fix-dl-ts-bug-1195034
Merge into: lp:~percona-toolkit-dev/percona-toolkit/release-2.2.4
Diff against target: 69 lines (+36/-0)
3 files modified
bin/pt-deadlock-logger (+5/-0)
t/pt-deadlock-logger/bugs.t (+17/-0)
t/pt-deadlock-logger/samples/bug_1195034.txt (+14/-0)
To merge this branch: bzr merge lp:~percona-toolkit-dev/percona-toolkit/fix-dl-ts-bug-1195034
Reviewer Review Type Date Requested Status
Daniel Nichter Approve
Review via email: mp+171679@code.launchpad.net
To post a comment you must log in.
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/pt-deadlock-logger'
2--- bin/pt-deadlock-logger 2013-06-25 22:32:19 +0000
3+++ bin/pt-deadlock-logger 2013-06-26 22:25:31 +0000
4@@ -4804,6 +4804,11 @@
5
6 # Extract some miscellaneous data from the deadlock.
7 my ( $ts ) = $dl_text =~ m/^$s$/m;
8+ if ( !$ts ) {
9+ # https://bugs.launchpad.net/percona-toolkit/+bug/1195034
10+ # 130624 17:39:24TOO DEEP OR LONG SEARCH IN THE LOCK TABLE ...
11+ ($ts) = $dl_text =~ m/^${s}TOO DEEP/m;
12+ }
13 my ( $year, $mon, $day, $hour, $min, $sec ) = $ts =~ m/^((?:\d\d)?\d\d)-?(\d\d)-?(\d\d) +(\d+):(\d+):(\d+)$/;
14 if ( length($year) == 2 ) {
15 $year += 2000;
16
17=== modified file 't/pt-deadlock-logger/bugs.t'
18--- t/pt-deadlock-logger/bugs.t 2012-11-23 22:11:50 +0000
19+++ t/pt-deadlock-logger/bugs.t 2013-06-26 22:25:31 +0000
20@@ -15,6 +15,8 @@
21 use Sandbox;
22 require "$trunk/bin/pt-deadlock-logger";
23
24+use Data::Dumper;
25+
26 # #############################################################################
27 # https://bugs.launchpad.net/percona-toolkit/+bug/903443
28 # pt-deadlock-logger crashes on MySQL 5.5
29@@ -120,6 +122,21 @@
30 );
31
32 # #############################################################################
33+# https://bugs.launchpad.net/percona-toolkit/+bug/1195034
34+# pt-deadlock-logger error: Use of uninitialized value $ts in pattern match
35+# #############################################################################
36+
37+$innodb_status_sample = load_file("t/pt-deadlock-logger/samples/bug_1195034.txt");
38+my $deadlocks = pt_deadlock_logger::parse_deadlocks($innodb_status_sample);
39+
40+is_deeply(
41+ $deadlocks,
42+ {
43+ },
44+ "Bug 1195034: TOO DEEP OR LONG SEARCH IN THE LOCK TABLE WAITS-FOR GRAPH"
45+) or diag(Dumper($deadlocks));
46+
47+# #############################################################################
48 # Done.
49 # #############################################################################
50 done_testing;
51
52=== added file 't/pt-deadlock-logger/samples/bug_1195034.txt'
53--- t/pt-deadlock-logger/samples/bug_1195034.txt 1970-01-01 00:00:00 +0000
54+++ t/pt-deadlock-logger/samples/bug_1195034.txt 2013-06-26 22:25:31 +0000
55@@ -0,0 +1,14 @@
56+
57+------------------------
58+LATEST DETECTED DEADLOCK
59+------------------------
60+130624 17:39:24TOO DEEP OR LONG SEARCH IN THE LOCK TABLE WAITS-FOR GRAPH, WE WILL ROLL BACK FOLLOWING TRANSACTION
61+
62+*** TRANSACTION:
63+TRANSACTION 3BF88F886, ACTIVE 0 sec setting auto-inc lock
64+mysql tables in use 1, locked 1
65+1 lock struct(s), heap size 376, 0 row lock(s)
66+MySQL thread id 23512694, OS thread handle 0x5055b940, query id 734303798 10.10.10.1 host update
67+INSERT INTO gr_v3_response_log (query_key, time_received, time_to_respond, status, raw_response, api_host, api_path, api_client) VALUES ('...
68+*** WAITING FOR THIS LOCK TO BE GRANTED:
69+TABLE LOCK table `db`.`gr_v3_response_log` trx id 3BF88F886 lock mode AUTO-INC waiting

Subscribers

People subscribed via source and target branches

to all changes: