Merge lp:~percona-toolkit-dev/percona-toolkit/release-2.2.12 into lp:percona-toolkit/2.2
- release-2.2.12
- Merge into 2.2
Proposed by
Tomislav Plavcic
Status: | Merged |
---|---|
Merged at revision: | 611 |
Proposed branch: | lp:~percona-toolkit-dev/percona-toolkit/release-2.2.12 |
Merge into: | lp:percona-toolkit/2.2 |
Diff against target: |
2086 lines (+720/-172) 50 files modified
Changelog (+12/-0) Makefile.PL (+1/-1) bin/pt-align (+9/-1) bin/pt-archiver (+13/-2) bin/pt-config-diff (+24/-5) bin/pt-deadlock-logger (+24/-5) bin/pt-diskstats (+2/-2) bin/pt-duplicate-key-checker (+2/-2) bin/pt-fifo-split (+9/-1) bin/pt-find (+2/-2) bin/pt-fingerprint (+9/-1) bin/pt-fk-error-logger (+24/-5) bin/pt-heartbeat (+28/-2) bin/pt-index-usage (+2/-2) bin/pt-ioprofile (+5/-2) bin/pt-kill (+24/-5) bin/pt-mext (+30/-24) bin/pt-mysql-summary (+3/-1) bin/pt-online-schema-change (+61/-8) bin/pt-pmp (+5/-2) bin/pt-query-digest (+26/-4) bin/pt-show-grants (+9/-1) bin/pt-sift (+5/-2) bin/pt-slave-delay (+2/-2) bin/pt-slave-find (+9/-1) bin/pt-slave-restart (+2/-2) bin/pt-stalk (+15/-2) bin/pt-summary (+3/-1) bin/pt-table-checksum (+58/-14) bin/pt-table-sync (+2/-2) bin/pt-table-usage (+9/-1) bin/pt-upgrade (+24/-5) bin/pt-variable-advisor (+2/-2) bin/pt-visual-explain (+9/-1) config/deb/changelog (+13/-0) config/sphinx-build/conf.py (+1/-1) docs/percona-toolkit.pod (+1/-1) docs/release_notes.rst (+35/-0) lib/Cxn.pm (+19/-2) lib/OptionParser.pm (+10/-0) lib/Percona/Toolkit.pm (+1/-1) lib/Percona/XtraDB/Cluster.pm (+23/-2) lib/bash/collect.sh (+9/-0) lib/bash/parse_options.sh (+3/-0) t/lib/OptionParser.t (+23/-0) t/pt-archiver/basics.t (+1/-1) t/pt-archiver/indexes.t (+1/-1) t/pt-archiver/samples/issue-248.txt (+2/-2) t/pt-query-digest/binlog_analyses.t (+21/-1) t/pt-table-checksum/pxc.t (+93/-47) |
To merge this branch: | bzr merge lp:~percona-toolkit-dev/percona-toolkit/release-2.2.12 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel Nichter | Pending | ||
Review via email: mp+241804@code.launchpad.net |
Commit message
Description of the change
Release branch for version 2.2.12
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'Changelog' | |||
2 | --- Changelog 2014-09-25 13:48:22 +0000 | |||
3 | +++ Changelog 2014-11-14 14:12:25 +0000 | |||
4 | @@ -1,5 +1,17 @@ | |||
5 | 1 | Changelog for Percona Toolkit | 1 | Changelog for Percona Toolkit |
6 | 2 | 2 | ||
7 | 3 | v2.2.12 released 2014-11-14 | ||
8 | 4 | |||
9 | 5 | |||
10 | 6 | * Fixed bug 1376561: pt-archiver is not able to archive all the rows when a table has a hash partition | ||
11 | 7 | * Fixed bug 1328686: pt-heartbeat check-read-only option does not prevent creates or inserts | ||
12 | 8 | * Fixed bug 1269695: pt-online-schema-change does not allow ALTER for a table without a non-unique, while manual does not explain this | ||
13 | 9 | * Fixed bug 1217466: pt-table-checksum refuses to run on PXC if server_id is the same on all nodes | ||
14 | 10 | * Fixed bug 1373937: pt-table-checksum requires recursion when working with and XtraDB Cluster node | ||
15 | 11 | * Fixed bug 1377888: pt-query-digest manual for --type binlog is ambiguous | ||
16 | 12 | * Fixed bug 1349086: pt-stalk should also gather dmesg output | ||
17 | 13 | * Fixed bug 1361293: Some scripts fail when no-version-check option is put in global config file | ||
18 | 14 | |||
19 | 3 | v2.2.11 released 2014-09-26 | 15 | v2.2.11 released 2014-09-26 |
20 | 4 | 16 | ||
21 | 5 | * Fixed bug 1262456: pt-query-digest doesn't report host details | 17 | * Fixed bug 1262456: pt-query-digest doesn't report host details |
22 | 6 | 18 | ||
23 | === modified file 'Makefile.PL' | |||
24 | --- Makefile.PL 2014-09-25 13:48:22 +0000 | |||
25 | +++ Makefile.PL 2014-11-14 14:12:25 +0000 | |||
26 | @@ -2,7 +2,7 @@ | |||
27 | 2 | 2 | ||
28 | 3 | WriteMakefile( | 3 | WriteMakefile( |
29 | 4 | NAME => 'percona-toolkit', | 4 | NAME => 'percona-toolkit', |
31 | 5 | VERSION => '2.2.11', | 5 | VERSION => '2.2.12', |
32 | 6 | EXE_FILES => [ <bin/*> ], | 6 | EXE_FILES => [ <bin/*> ], |
33 | 7 | MAN1PODS => { | 7 | MAN1PODS => { |
34 | 8 | 'docs/percona-toolkit.pod' => 'blib/man1/percona-toolkit.1p', | 8 | 'docs/percona-toolkit.pod' => 'blib/man1/percona-toolkit.1p', |
35 | 9 | 9 | ||
36 | === modified file 'bin/pt-align' | |||
37 | --- bin/pt-align 2014-09-25 13:48:22 +0000 | |||
38 | +++ bin/pt-align 2014-11-14 14:12:25 +0000 | |||
39 | @@ -901,6 +901,14 @@ | |||
40 | 901 | $parse = 0; | 901 | $parse = 0; |
41 | 902 | next LINE; | 902 | next LINE; |
42 | 903 | } | 903 | } |
43 | 904 | |||
44 | 905 | if ( $parse | ||
45 | 906 | && !$self->has('version-check') | ||
46 | 907 | && $line =~ /version-check/ | ||
47 | 908 | ) { | ||
48 | 909 | next LINE; | ||
49 | 910 | } | ||
50 | 911 | |||
51 | 904 | if ( $parse | 912 | if ( $parse |
52 | 905 | && (my($opt, $arg) = $line =~ m/^\s*([^=\s]+?)(?:\s*=\s*(.*?)\s*)?$/) | 913 | && (my($opt, $arg) = $line =~ m/^\s*([^=\s]+?)(?:\s*=\s*(.*?)\s*)?$/) |
53 | 906 | ) { | 914 | ) { |
54 | @@ -1323,6 +1331,6 @@ | |||
55 | 1323 | 1331 | ||
56 | 1324 | =head1 VERSION | 1332 | =head1 VERSION |
57 | 1325 | 1333 | ||
59 | 1326 | pt-align 2.2.11 | 1334 | pt-align 2.2.12 |
60 | 1327 | 1335 | ||
61 | 1328 | =cut | 1336 | =cut |
62 | 1329 | 1337 | ||
63 | === modified file 'bin/pt-archiver' | |||
64 | --- bin/pt-archiver 2014-09-25 13:48:22 +0000 | |||
65 | +++ bin/pt-archiver 2014-11-14 14:12:25 +0000 | |||
66 | @@ -43,7 +43,7 @@ | |||
67 | 43 | { | 43 | { |
68 | 44 | package Percona::Toolkit; | 44 | package Percona::Toolkit; |
69 | 45 | 45 | ||
71 | 46 | our $VERSION = '2.2.11'; | 46 | our $VERSION = '2.2.12'; |
72 | 47 | 47 | ||
73 | 48 | use strict; | 48 | use strict; |
74 | 49 | use warnings FATAL => 'all'; | 49 | use warnings FATAL => 'all'; |
75 | @@ -5811,7 +5811,18 @@ | |||
76 | 5811 | $next_sql .= " AND $sel_stmt->{where}"; | 5811 | $next_sql .= " AND $sel_stmt->{where}"; |
77 | 5812 | } | 5812 | } |
78 | 5813 | 5813 | ||
79 | 5814 | # Obtain index cols so we can order them when ascending | ||
80 | 5815 | # this ensures returned sets are disjoint when ran on partitioned tables | ||
81 | 5816 | # issue 1376561 | ||
82 | 5817 | my $index_cols; | ||
83 | 5818 | if ( $sel_stmt->{index} | ||
84 | 5819 | && $src->{info}->{keys}->{$sel_stmt->{index}}->{cols} | ||
85 | 5820 | ) { | ||
86 | 5821 | $index_cols = $src->{info}->{keys}->{$sel_stmt->{index}}->{colnames}; | ||
87 | 5822 | } | ||
88 | 5823 | |||
89 | 5814 | foreach my $thing ( $first_sql, $next_sql ) { | 5824 | foreach my $thing ( $first_sql, $next_sql ) { |
90 | 5825 | $thing .= " ORDER BY $index_cols" if $index_cols; | ||
91 | 5815 | $thing .= " LIMIT $limit"; | 5826 | $thing .= " LIMIT $limit"; |
92 | 5816 | if ( $o->get('for-update') ) { | 5827 | if ( $o->get('for-update') ) { |
93 | 5817 | $thing .= ' FOR UPDATE'; | 5828 | $thing .= ' FOR UPDATE'; |
94 | @@ -7892,6 +7903,6 @@ | |||
95 | 7892 | 7903 | ||
96 | 7893 | =head1 VERSION | 7904 | =head1 VERSION |
97 | 7894 | 7905 | ||
99 | 7895 | pt-archiver 2.2.11 | 7906 | pt-archiver 2.2.12 |
100 | 7896 | 7907 | ||
101 | 7897 | =cut | 7908 | =cut |
102 | 7898 | 7909 | ||
103 | === modified file 'bin/pt-config-diff' | |||
104 | --- bin/pt-config-diff 2014-09-25 13:48:22 +0000 | |||
105 | +++ bin/pt-config-diff 2014-11-14 14:12:25 +0000 | |||
106 | @@ -43,7 +43,7 @@ | |||
107 | 43 | { | 43 | { |
108 | 44 | package Percona::Toolkit; | 44 | package Percona::Toolkit; |
109 | 45 | 45 | ||
111 | 46 | our $VERSION = '2.2.11'; | 46 | our $VERSION = '2.2.12'; |
112 | 47 | 47 | ||
113 | 48 | use strict; | 48 | use strict; |
114 | 49 | use warnings FATAL => 'all'; | 49 | use warnings FATAL => 'all'; |
115 | @@ -2295,7 +2295,7 @@ | |||
116 | 2295 | set => $args{set}, | 2295 | set => $args{set}, |
117 | 2296 | NAME_lc => defined($args{NAME_lc}) ? $args{NAME_lc} : 1, | 2296 | NAME_lc => defined($args{NAME_lc}) ? $args{NAME_lc} : 1, |
118 | 2297 | dbh_set => 0, | 2297 | dbh_set => 0, |
120 | 2298 | ask_pass => $o->get('ask-pass'), | 2298 | ask_pass => $args{ask_pass}, |
121 | 2299 | DSNParser => $dp, | 2299 | DSNParser => $dp, |
122 | 2300 | is_cluster_node => undef, | 2300 | is_cluster_node => undef, |
123 | 2301 | parent => $args{parent}, | 2301 | parent => $args{parent}, |
124 | @@ -2306,7 +2306,7 @@ | |||
125 | 2306 | 2306 | ||
126 | 2307 | sub connect { | 2307 | sub connect { |
127 | 2308 | my ( $self, %opts ) = @_; | 2308 | my ( $self, %opts ) = @_; |
129 | 2309 | my $dsn = $self->{dsn}; | 2309 | my $dsn = $opts{dsn} || $self->{dsn}; |
130 | 2310 | my $dp = $self->{DSNParser}; | 2310 | my $dp = $self->{DSNParser}; |
131 | 2311 | 2311 | ||
132 | 2312 | my $dbh = $self->{dbh}; | 2312 | my $dbh = $self->{dbh}; |
133 | @@ -2325,6 +2325,13 @@ | |||
134 | 2325 | } | 2325 | } |
135 | 2326 | 2326 | ||
136 | 2327 | $dbh = $self->set_dbh($dbh); | 2327 | $dbh = $self->set_dbh($dbh); |
137 | 2328 | if ( $opts{dsn} ) { | ||
138 | 2329 | $self->{dsn} = $dsn; | ||
139 | 2330 | $self->{dsn_name} = $dp->as_string($dsn, [qw(h P S)]) | ||
140 | 2331 | || $dp->as_string($dsn, [qw(F)]) | ||
141 | 2332 | || ''; | ||
142 | 2333 | |||
143 | 2334 | } | ||
144 | 2328 | PTDEBUG && _d($dbh, 'Connected dbh to', $self->{hostname},$self->{dsn_name}); | 2335 | PTDEBUG && _d($dbh, 'Connected dbh to', $self->{hostname},$self->{dsn_name}); |
145 | 2329 | return $dbh; | 2336 | return $dbh; |
146 | 2330 | } | 2337 | } |
147 | @@ -2386,6 +2393,17 @@ | |||
148 | 2386 | return $self->{hostname} || $self->{dsn_name} || 'unknown host'; | 2393 | return $self->{hostname} || $self->{dsn_name} || 'unknown host'; |
149 | 2387 | } | 2394 | } |
150 | 2388 | 2395 | ||
151 | 2396 | sub is_cluster_node { | ||
152 | 2397 | my ($self, $cxn) = @_; | ||
153 | 2398 | |||
154 | 2399 | my $sql = "SHOW VARIABLES LIKE 'wsrep\_on'"; | ||
155 | 2400 | PTDEBUG && _d($cxn->name, $sql); | ||
156 | 2401 | my $row = $cxn->dbh->selectrow_arrayref($sql); | ||
157 | 2402 | PTDEBUG && _d(Dumper($row)); | ||
158 | 2403 | return $row && $row->[1] && ($row->[1] eq 'ON' || $row->[1] eq '1') ? 1 : 0; | ||
159 | 2404 | |||
160 | 2405 | } | ||
161 | 2406 | |||
162 | 2389 | sub remove_duplicate_cxns { | 2407 | sub remove_duplicate_cxns { |
163 | 2390 | my ($self, %args) = @_; | 2408 | my ($self, %args) = @_; |
164 | 2391 | my @cxns = @{$args{cxns}}; | 2409 | my @cxns = @{$args{cxns}}; |
165 | @@ -2395,7 +2413,8 @@ | |||
166 | 2395 | 2413 | ||
167 | 2396 | for my $cxn ( @cxns ) { | 2414 | for my $cxn ( @cxns ) { |
168 | 2397 | my $dbh = $cxn->dbh(); | 2415 | my $dbh = $cxn->dbh(); |
170 | 2398 | my $sql = q{SELECT @@server_id}; | 2416 | |
171 | 2417 | my $sql = $self->is_cluster_node($cxn) ? q{SELECT @@wsrep_node_incoming_address} : q{SELECT @@server_id}; | ||
172 | 2399 | PTDEBUG && _d($sql); | 2418 | PTDEBUG && _d($sql); |
173 | 2400 | my ($id) = $dbh->selectrow_array($sql); | 2419 | my ($id) = $dbh->selectrow_array($sql); |
174 | 2401 | PTDEBUG && _d('Server ID for ', $cxn->name, ': ', $id); | 2420 | PTDEBUG && _d('Server ID for ', $cxn->name, ': ', $id); |
175 | @@ -5733,6 +5752,6 @@ | |||
176 | 5733 | 5752 | ||
177 | 5734 | =head1 VERSION | 5753 | =head1 VERSION |
178 | 5735 | 5754 | ||
180 | 5736 | pt-config-diff 2.2.11 | 5755 | pt-config-diff 2.2.12 |
181 | 5737 | 5756 | ||
182 | 5738 | =cut | 5757 | =cut |
183 | 5739 | 5758 | ||
184 | === modified file 'bin/pt-deadlock-logger' | |||
185 | --- bin/pt-deadlock-logger 2014-09-25 13:48:22 +0000 | |||
186 | +++ bin/pt-deadlock-logger 2014-11-14 14:12:25 +0000 | |||
187 | @@ -42,7 +42,7 @@ | |||
188 | 42 | { | 42 | { |
189 | 43 | package Percona::Toolkit; | 43 | package Percona::Toolkit; |
190 | 44 | 44 | ||
192 | 45 | our $VERSION = '2.2.11'; | 45 | our $VERSION = '2.2.12'; |
193 | 46 | 46 | ||
194 | 47 | use strict; | 47 | use strict; |
195 | 48 | use warnings FATAL => 'all'; | 48 | use warnings FATAL => 'all'; |
196 | @@ -2639,7 +2639,7 @@ | |||
197 | 2639 | set => $args{set}, | 2639 | set => $args{set}, |
198 | 2640 | NAME_lc => defined($args{NAME_lc}) ? $args{NAME_lc} : 1, | 2640 | NAME_lc => defined($args{NAME_lc}) ? $args{NAME_lc} : 1, |
199 | 2641 | dbh_set => 0, | 2641 | dbh_set => 0, |
201 | 2642 | ask_pass => $o->get('ask-pass'), | 2642 | ask_pass => $args{ask_pass}, |
202 | 2643 | DSNParser => $dp, | 2643 | DSNParser => $dp, |
203 | 2644 | is_cluster_node => undef, | 2644 | is_cluster_node => undef, |
204 | 2645 | parent => $args{parent}, | 2645 | parent => $args{parent}, |
205 | @@ -2650,7 +2650,7 @@ | |||
206 | 2650 | 2650 | ||
207 | 2651 | sub connect { | 2651 | sub connect { |
208 | 2652 | my ( $self, %opts ) = @_; | 2652 | my ( $self, %opts ) = @_; |
210 | 2653 | my $dsn = $self->{dsn}; | 2653 | my $dsn = $opts{dsn} || $self->{dsn}; |
211 | 2654 | my $dp = $self->{DSNParser}; | 2654 | my $dp = $self->{DSNParser}; |
212 | 2655 | 2655 | ||
213 | 2656 | my $dbh = $self->{dbh}; | 2656 | my $dbh = $self->{dbh}; |
214 | @@ -2669,6 +2669,13 @@ | |||
215 | 2669 | } | 2669 | } |
216 | 2670 | 2670 | ||
217 | 2671 | $dbh = $self->set_dbh($dbh); | 2671 | $dbh = $self->set_dbh($dbh); |
218 | 2672 | if ( $opts{dsn} ) { | ||
219 | 2673 | $self->{dsn} = $dsn; | ||
220 | 2674 | $self->{dsn_name} = $dp->as_string($dsn, [qw(h P S)]) | ||
221 | 2675 | || $dp->as_string($dsn, [qw(F)]) | ||
222 | 2676 | || ''; | ||
223 | 2677 | |||
224 | 2678 | } | ||
225 | 2672 | PTDEBUG && _d($dbh, 'Connected dbh to', $self->{hostname},$self->{dsn_name}); | 2679 | PTDEBUG && _d($dbh, 'Connected dbh to', $self->{hostname},$self->{dsn_name}); |
226 | 2673 | return $dbh; | 2680 | return $dbh; |
227 | 2674 | } | 2681 | } |
228 | @@ -2730,6 +2737,17 @@ | |||
229 | 2730 | return $self->{hostname} || $self->{dsn_name} || 'unknown host'; | 2737 | return $self->{hostname} || $self->{dsn_name} || 'unknown host'; |
230 | 2731 | } | 2738 | } |
231 | 2732 | 2739 | ||
232 | 2740 | sub is_cluster_node { | ||
233 | 2741 | my ($self, $cxn) = @_; | ||
234 | 2742 | |||
235 | 2743 | my $sql = "SHOW VARIABLES LIKE 'wsrep\_on'"; | ||
236 | 2744 | PTDEBUG && _d($cxn->name, $sql); | ||
237 | 2745 | my $row = $cxn->dbh->selectrow_arrayref($sql); | ||
238 | 2746 | PTDEBUG && _d(Dumper($row)); | ||
239 | 2747 | return $row && $row->[1] && ($row->[1] eq 'ON' || $row->[1] eq '1') ? 1 : 0; | ||
240 | 2748 | |||
241 | 2749 | } | ||
242 | 2750 | |||
243 | 2733 | sub remove_duplicate_cxns { | 2751 | sub remove_duplicate_cxns { |
244 | 2734 | my ($self, %args) = @_; | 2752 | my ($self, %args) = @_; |
245 | 2735 | my @cxns = @{$args{cxns}}; | 2753 | my @cxns = @{$args{cxns}}; |
246 | @@ -2739,7 +2757,8 @@ | |||
247 | 2739 | 2757 | ||
248 | 2740 | for my $cxn ( @cxns ) { | 2758 | for my $cxn ( @cxns ) { |
249 | 2741 | my $dbh = $cxn->dbh(); | 2759 | my $dbh = $cxn->dbh(); |
251 | 2742 | my $sql = q{SELECT @@server_id}; | 2760 | |
252 | 2761 | my $sql = $self->is_cluster_node($cxn) ? q{SELECT @@wsrep_node_incoming_address} : q{SELECT @@server_id}; | ||
253 | 2743 | PTDEBUG && _d($sql); | 2762 | PTDEBUG && _d($sql); |
254 | 2744 | my ($id) = $dbh->selectrow_array($sql); | 2763 | my ($id) = $dbh->selectrow_array($sql); |
255 | 2745 | PTDEBUG && _d('Server ID for ', $cxn->name, ': ', $id); | 2764 | PTDEBUG && _d('Server ID for ', $cxn->name, ': ', $id); |
256 | @@ -5523,6 +5542,6 @@ | |||
257 | 5523 | 5542 | ||
258 | 5524 | =head1 VERSION | 5543 | =head1 VERSION |
259 | 5525 | 5544 | ||
261 | 5526 | pt-deadlock-logger 2.2.11 | 5545 | pt-deadlock-logger 2.2.12 |
262 | 5527 | 5546 | ||
263 | 5528 | =cut | 5547 | =cut |
264 | 5529 | 5548 | ||
265 | === modified file 'bin/pt-diskstats' | |||
266 | --- bin/pt-diskstats 2014-09-25 13:48:22 +0000 | |||
267 | +++ bin/pt-diskstats 2014-11-14 14:12:25 +0000 | |||
268 | @@ -38,7 +38,7 @@ | |||
269 | 38 | { | 38 | { |
270 | 39 | package Percona::Toolkit; | 39 | package Percona::Toolkit; |
271 | 40 | 40 | ||
273 | 41 | our $VERSION = '2.2.11'; | 41 | our $VERSION = '2.2.12'; |
274 | 42 | 42 | ||
275 | 43 | use strict; | 43 | use strict; |
276 | 44 | use warnings FATAL => 'all'; | 44 | use warnings FATAL => 'all'; |
277 | @@ -5579,6 +5579,6 @@ | |||
278 | 5579 | 5579 | ||
279 | 5580 | =head1 VERSION | 5580 | =head1 VERSION |
280 | 5581 | 5581 | ||
282 | 5582 | pt-diskstats 2.2.11 | 5582 | pt-diskstats 2.2.12 |
283 | 5583 | 5583 | ||
284 | 5584 | =cut | 5584 | =cut |
285 | 5585 | 5585 | ||
286 | === modified file 'bin/pt-duplicate-key-checker' | |||
287 | --- bin/pt-duplicate-key-checker 2014-09-25 13:48:22 +0000 | |||
288 | +++ bin/pt-duplicate-key-checker 2014-11-14 14:12:25 +0000 | |||
289 | @@ -39,7 +39,7 @@ | |||
290 | 39 | { | 39 | { |
291 | 40 | package Percona::Toolkit; | 40 | package Percona::Toolkit; |
292 | 41 | 41 | ||
294 | 42 | our $VERSION = '2.2.11'; | 42 | our $VERSION = '2.2.12'; |
295 | 43 | 43 | ||
296 | 44 | use strict; | 44 | use strict; |
297 | 45 | use warnings FATAL => 'all'; | 45 | use warnings FATAL => 'all'; |
298 | @@ -5600,6 +5600,6 @@ | |||
299 | 5600 | 5600 | ||
300 | 5601 | =head1 VERSION | 5601 | =head1 VERSION |
301 | 5602 | 5602 | ||
303 | 5603 | pt-duplicate-key-checker 2.2.11 | 5603 | pt-duplicate-key-checker 2.2.12 |
304 | 5604 | 5604 | ||
305 | 5605 | =cut | 5605 | =cut |
306 | 5606 | 5606 | ||
307 | === modified file 'bin/pt-fifo-split' | |||
308 | --- bin/pt-fifo-split 2014-09-25 13:48:22 +0000 | |||
309 | +++ bin/pt-fifo-split 2014-11-14 14:12:25 +0000 | |||
310 | @@ -902,6 +902,14 @@ | |||
311 | 902 | $parse = 0; | 902 | $parse = 0; |
312 | 903 | next LINE; | 903 | next LINE; |
313 | 904 | } | 904 | } |
314 | 905 | |||
315 | 906 | if ( $parse | ||
316 | 907 | && !$self->has('version-check') | ||
317 | 908 | && $line =~ /version-check/ | ||
318 | 909 | ) { | ||
319 | 910 | next LINE; | ||
320 | 911 | } | ||
321 | 912 | |||
322 | 905 | if ( $parse | 913 | if ( $parse |
323 | 906 | && (my($opt, $arg) = $line =~ m/^\s*([^=\s]+?)(?:\s*=\s*(.*?)\s*)?$/) | 914 | && (my($opt, $arg) = $line =~ m/^\s*([^=\s]+?)(?:\s*=\s*(.*?)\s*)?$/) |
324 | 907 | ) { | 915 | ) { |
325 | @@ -1612,6 +1620,6 @@ | |||
326 | 1612 | 1620 | ||
327 | 1613 | =head1 VERSION | 1621 | =head1 VERSION |
328 | 1614 | 1622 | ||
330 | 1615 | pt-fifo-split 2.2.11 | 1623 | pt-fifo-split 2.2.12 |
331 | 1616 | 1624 | ||
332 | 1617 | =cut | 1625 | =cut |
333 | 1618 | 1626 | ||
334 | === modified file 'bin/pt-find' | |||
335 | --- bin/pt-find 2014-09-25 13:48:22 +0000 | |||
336 | +++ bin/pt-find 2014-11-14 14:12:25 +0000 | |||
337 | @@ -35,7 +35,7 @@ | |||
338 | 35 | { | 35 | { |
339 | 36 | package Percona::Toolkit; | 36 | package Percona::Toolkit; |
340 | 37 | 37 | ||
342 | 38 | our $VERSION = '2.2.11'; | 38 | our $VERSION = '2.2.12'; |
343 | 39 | 39 | ||
344 | 40 | use strict; | 40 | use strict; |
345 | 41 | use warnings FATAL => 'all'; | 41 | use warnings FATAL => 'all'; |
346 | @@ -4984,6 +4984,6 @@ | |||
347 | 4984 | 4984 | ||
348 | 4985 | =head1 VERSION | 4985 | =head1 VERSION |
349 | 4986 | 4986 | ||
351 | 4987 | pt-find 2.2.11 | 4987 | pt-find 2.2.12 |
352 | 4988 | 4988 | ||
353 | 4989 | =cut | 4989 | =cut |
354 | 4990 | 4990 | ||
355 | === modified file 'bin/pt-fingerprint' | |||
356 | --- bin/pt-fingerprint 2014-09-25 13:48:22 +0000 | |||
357 | +++ bin/pt-fingerprint 2014-11-14 14:12:25 +0000 | |||
358 | @@ -903,6 +903,14 @@ | |||
359 | 903 | $parse = 0; | 903 | $parse = 0; |
360 | 904 | next LINE; | 904 | next LINE; |
361 | 905 | } | 905 | } |
362 | 906 | |||
363 | 907 | if ( $parse | ||
364 | 908 | && !$self->has('version-check') | ||
365 | 909 | && $line =~ /version-check/ | ||
366 | 910 | ) { | ||
367 | 911 | next LINE; | ||
368 | 912 | } | ||
369 | 913 | |||
370 | 906 | if ( $parse | 914 | if ( $parse |
371 | 907 | && (my($opt, $arg) = $line =~ m/^\s*([^=\s]+?)(?:\s*=\s*(.*?)\s*)?$/) | 915 | && (my($opt, $arg) = $line =~ m/^\s*([^=\s]+?)(?:\s*=\s*(.*?)\s*)?$/) |
372 | 908 | ) { | 916 | ) { |
373 | @@ -2203,6 +2211,6 @@ | |||
374 | 2203 | 2211 | ||
375 | 2204 | =head1 VERSION | 2212 | =head1 VERSION |
376 | 2205 | 2213 | ||
378 | 2206 | pt-fingerprint 2.2.11 | 2214 | pt-fingerprint 2.2.12 |
379 | 2207 | 2215 | ||
380 | 2208 | =cut | 2216 | =cut |
381 | 2209 | 2217 | ||
382 | === modified file 'bin/pt-fk-error-logger' | |||
383 | --- bin/pt-fk-error-logger 2014-09-25 13:48:22 +0000 | |||
384 | +++ bin/pt-fk-error-logger 2014-11-14 14:12:25 +0000 | |||
385 | @@ -37,7 +37,7 @@ | |||
386 | 37 | { | 37 | { |
387 | 38 | package Percona::Toolkit; | 38 | package Percona::Toolkit; |
388 | 39 | 39 | ||
390 | 40 | our $VERSION = '2.2.11'; | 40 | our $VERSION = '2.2.12'; |
391 | 41 | 41 | ||
392 | 42 | use strict; | 42 | use strict; |
393 | 43 | use warnings FATAL => 'all'; | 43 | use warnings FATAL => 'all'; |
394 | @@ -1791,7 +1791,7 @@ | |||
395 | 1791 | set => $args{set}, | 1791 | set => $args{set}, |
396 | 1792 | NAME_lc => defined($args{NAME_lc}) ? $args{NAME_lc} : 1, | 1792 | NAME_lc => defined($args{NAME_lc}) ? $args{NAME_lc} : 1, |
397 | 1793 | dbh_set => 0, | 1793 | dbh_set => 0, |
399 | 1794 | ask_pass => $o->get('ask-pass'), | 1794 | ask_pass => $args{ask_pass}, |
400 | 1795 | DSNParser => $dp, | 1795 | DSNParser => $dp, |
401 | 1796 | is_cluster_node => undef, | 1796 | is_cluster_node => undef, |
402 | 1797 | parent => $args{parent}, | 1797 | parent => $args{parent}, |
403 | @@ -1802,7 +1802,7 @@ | |||
404 | 1802 | 1802 | ||
405 | 1803 | sub connect { | 1803 | sub connect { |
406 | 1804 | my ( $self, %opts ) = @_; | 1804 | my ( $self, %opts ) = @_; |
408 | 1805 | my $dsn = $self->{dsn}; | 1805 | my $dsn = $opts{dsn} || $self->{dsn}; |
409 | 1806 | my $dp = $self->{DSNParser}; | 1806 | my $dp = $self->{DSNParser}; |
410 | 1807 | 1807 | ||
411 | 1808 | my $dbh = $self->{dbh}; | 1808 | my $dbh = $self->{dbh}; |
412 | @@ -1821,6 +1821,13 @@ | |||
413 | 1821 | } | 1821 | } |
414 | 1822 | 1822 | ||
415 | 1823 | $dbh = $self->set_dbh($dbh); | 1823 | $dbh = $self->set_dbh($dbh); |
416 | 1824 | if ( $opts{dsn} ) { | ||
417 | 1825 | $self->{dsn} = $dsn; | ||
418 | 1826 | $self->{dsn_name} = $dp->as_string($dsn, [qw(h P S)]) | ||
419 | 1827 | || $dp->as_string($dsn, [qw(F)]) | ||
420 | 1828 | || ''; | ||
421 | 1829 | |||
422 | 1830 | } | ||
423 | 1824 | PTDEBUG && _d($dbh, 'Connected dbh to', $self->{hostname},$self->{dsn_name}); | 1831 | PTDEBUG && _d($dbh, 'Connected dbh to', $self->{hostname},$self->{dsn_name}); |
424 | 1825 | return $dbh; | 1832 | return $dbh; |
425 | 1826 | } | 1833 | } |
426 | @@ -1882,6 +1889,17 @@ | |||
427 | 1882 | return $self->{hostname} || $self->{dsn_name} || 'unknown host'; | 1889 | return $self->{hostname} || $self->{dsn_name} || 'unknown host'; |
428 | 1883 | } | 1890 | } |
429 | 1884 | 1891 | ||
430 | 1892 | sub is_cluster_node { | ||
431 | 1893 | my ($self, $cxn) = @_; | ||
432 | 1894 | |||
433 | 1895 | my $sql = "SHOW VARIABLES LIKE 'wsrep\_on'"; | ||
434 | 1896 | PTDEBUG && _d($cxn->name, $sql); | ||
435 | 1897 | my $row = $cxn->dbh->selectrow_arrayref($sql); | ||
436 | 1898 | PTDEBUG && _d(Dumper($row)); | ||
437 | 1899 | return $row && $row->[1] && ($row->[1] eq 'ON' || $row->[1] eq '1') ? 1 : 0; | ||
438 | 1900 | |||
439 | 1901 | } | ||
440 | 1902 | |||
441 | 1885 | sub remove_duplicate_cxns { | 1903 | sub remove_duplicate_cxns { |
442 | 1886 | my ($self, %args) = @_; | 1904 | my ($self, %args) = @_; |
443 | 1887 | my @cxns = @{$args{cxns}}; | 1905 | my @cxns = @{$args{cxns}}; |
444 | @@ -1891,7 +1909,8 @@ | |||
445 | 1891 | 1909 | ||
446 | 1892 | for my $cxn ( @cxns ) { | 1910 | for my $cxn ( @cxns ) { |
447 | 1893 | my $dbh = $cxn->dbh(); | 1911 | my $dbh = $cxn->dbh(); |
449 | 1894 | my $sql = q{SELECT @@server_id}; | 1912 | |
450 | 1913 | my $sql = $self->is_cluster_node($cxn) ? q{SELECT @@wsrep_node_incoming_address} : q{SELECT @@server_id}; | ||
451 | 1895 | PTDEBUG && _d($sql); | 1914 | PTDEBUG && _d($sql); |
452 | 1896 | my ($id) = $dbh->selectrow_array($sql); | 1915 | my ($id) = $dbh->selectrow_array($sql); |
453 | 1897 | PTDEBUG && _d('Server ID for ', $cxn->name, ': ', $id); | 1916 | PTDEBUG && _d('Server ID for ', $cxn->name, ': ', $id); |
454 | @@ -4509,6 +4528,6 @@ | |||
455 | 4509 | 4528 | ||
456 | 4510 | =head1 VERSION | 4529 | =head1 VERSION |
457 | 4511 | 4530 | ||
459 | 4512 | pt-fk-error-logger 2.2.11 | 4531 | pt-fk-error-logger 2.2.12 |
460 | 4513 | 4532 | ||
461 | 4514 | =cut | 4533 | =cut |
462 | 4515 | 4534 | ||
463 | === modified file 'bin/pt-heartbeat' | |||
464 | --- bin/pt-heartbeat 2014-09-25 13:48:22 +0000 | |||
465 | +++ bin/pt-heartbeat 2014-11-14 14:12:25 +0000 | |||
466 | @@ -38,7 +38,7 @@ | |||
467 | 38 | { | 38 | { |
468 | 39 | package Percona::Toolkit; | 39 | package Percona::Toolkit; |
469 | 40 | 40 | ||
471 | 41 | our $VERSION = '2.2.11'; | 41 | our $VERSION = '2.2.12'; |
472 | 42 | 42 | ||
473 | 43 | use strict; | 43 | use strict; |
474 | 44 | use warnings FATAL => 'all'; | 44 | use warnings FATAL => 'all'; |
475 | @@ -4892,6 +4892,32 @@ | |||
476 | 4892 | $dbh->do("USE `$db`"); | 4892 | $dbh->do("USE `$db`"); |
477 | 4893 | 4893 | ||
478 | 4894 | # ######################################################################## | 4894 | # ######################################################################## |
479 | 4895 | # If --check-read-only option was given and we are in --update mode | ||
480 | 4896 | # we wait until server is writable , or run-time is over, or sentinel file | ||
481 | 4897 | # We also do this check after daemon is up and running, but it is necessary | ||
482 | 4898 | # to check this before attempting to create the table and inserting rows | ||
483 | 4899 | # https://bugs.launchpad.net/percona-toolkit/+bug/1328686 | ||
484 | 4900 | # ####################################################################### | ||
485 | 4901 | if ( $o->get('check-read-only') && $o->get('update') ) { | ||
486 | 4902 | PTDEBUG && _d('Checking if server is read_only'); | ||
487 | 4903 | if ( server_is_readonly($dbh) && PTDEBUG ) { | ||
488 | 4904 | _d('Server is read-only, waiting') | ||
489 | 4905 | } | ||
490 | 4906 | my $start_time = time; | ||
491 | 4907 | my $run_time = $o->get('run-time'); | ||
492 | 4908 | my $interval = $o->get('interval') || 5; | ||
493 | 4909 | while (server_is_readonly($dbh)) { | ||
494 | 4910 | sleep($interval); | ||
495 | 4911 | if ( | ||
496 | 4912 | ($run_time && $run_time < time - $start_time) | ||
497 | 4913 | || -f $sentinel | ||
498 | 4914 | ) { | ||
499 | 4915 | return 0; | ||
500 | 4916 | } | ||
501 | 4917 | } | ||
502 | 4918 | } | ||
503 | 4919 | |||
504 | 4920 | # ######################################################################## | ||
505 | 4895 | # Create the heartbeat table if --create-table was given. | 4921 | # Create the heartbeat table if --create-table was given. |
506 | 4896 | # ######################################################################## | 4922 | # ######################################################################## |
507 | 4897 | my $utc = $o->get('utc'); | 4923 | my $utc = $o->get('utc'); |
508 | @@ -6192,6 +6218,6 @@ | |||
509 | 6192 | 6218 | ||
510 | 6193 | =head1 VERSION | 6219 | =head1 VERSION |
511 | 6194 | 6220 | ||
513 | 6195 | pt-heartbeat 2.2.11 | 6221 | pt-heartbeat 2.2.12 |
514 | 6196 | 6222 | ||
515 | 6197 | =cut | 6223 | =cut |
516 | 6198 | 6224 | ||
517 | === modified file 'bin/pt-index-usage' | |||
518 | --- bin/pt-index-usage 2014-09-25 13:48:22 +0000 | |||
519 | +++ bin/pt-index-usage 2014-11-14 14:12:25 +0000 | |||
520 | @@ -45,7 +45,7 @@ | |||
521 | 45 | { | 45 | { |
522 | 46 | package Percona::Toolkit; | 46 | package Percona::Toolkit; |
523 | 47 | 47 | ||
525 | 48 | our $VERSION = '2.2.11'; | 48 | our $VERSION = '2.2.12'; |
526 | 49 | 49 | ||
527 | 50 | use strict; | 50 | use strict; |
528 | 51 | use warnings FATAL => 'all'; | 51 | use warnings FATAL => 'all'; |
529 | @@ -7548,6 +7548,6 @@ | |||
530 | 7548 | 7548 | ||
531 | 7549 | =head1 VERSION | 7549 | =head1 VERSION |
532 | 7550 | 7550 | ||
534 | 7551 | pt-index-usage 2.2.11 | 7551 | pt-index-usage 2.2.12 |
535 | 7552 | 7552 | ||
536 | 7553 | =cut | 7553 | =cut |
537 | 7554 | 7554 | ||
538 | === modified file 'bin/pt-ioprofile' | |||
539 | --- bin/pt-ioprofile 2014-09-25 13:48:22 +0000 | |||
540 | +++ bin/pt-ioprofile 2014-11-14 14:12:25 +0000 | |||
541 | @@ -86,9 +86,10 @@ | |||
542 | 86 | 86 | ||
543 | 87 | usage_or_errors() { | 87 | usage_or_errors() { |
544 | 88 | local file="$1" | 88 | local file="$1" |
545 | 89 | local version="" | ||
546 | 89 | 90 | ||
547 | 90 | if [ "$OPT_VERSION" ]; then | 91 | if [ "$OPT_VERSION" ]; then |
549 | 91 | local version=$(grep '^pt-[^ ]\+ [0-9]' "$file") | 92 | version=$(grep '^pt-[^ ]\+ [0-9]' "$file") |
550 | 92 | echo "$version" | 93 | echo "$version" |
551 | 93 | return 1 | 94 | return 1 |
552 | 94 | fi | 95 | fi |
553 | @@ -310,6 +311,8 @@ | |||
554 | 310 | 311 | ||
555 | 311 | [ "$config_opt" = "" ] && continue | 312 | [ "$config_opt" = "" ] && continue |
556 | 312 | 313 | ||
557 | 314 | echo "$config_opt" | grep -v 'version-check' >/dev/null 2>&1 || continue | ||
558 | 315 | |||
559 | 313 | if ! [ "$HAVE_EXT_ARGV" ]; then | 316 | if ! [ "$HAVE_EXT_ARGV" ]; then |
560 | 314 | config_opt="--$config_opt" | 317 | config_opt="--$config_opt" |
561 | 315 | fi | 318 | fi |
562 | @@ -1119,7 +1122,7 @@ | |||
563 | 1119 | 1122 | ||
564 | 1120 | =head1 VERSION | 1123 | =head1 VERSION |
565 | 1121 | 1124 | ||
567 | 1122 | pt-ioprofile 2.2.11 | 1125 | pt-ioprofile 2.2.12 |
568 | 1123 | 1126 | ||
569 | 1124 | =cut | 1127 | =cut |
570 | 1125 | 1128 | ||
571 | 1126 | 1129 | ||
572 | === modified file 'bin/pt-kill' | |||
573 | --- bin/pt-kill 2014-09-25 13:48:22 +0000 | |||
574 | +++ bin/pt-kill 2014-11-14 14:12:25 +0000 | |||
575 | @@ -47,7 +47,7 @@ | |||
576 | 47 | { | 47 | { |
577 | 48 | package Percona::Toolkit; | 48 | package Percona::Toolkit; |
578 | 49 | 49 | ||
580 | 50 | our $VERSION = '2.2.11'; | 50 | our $VERSION = '2.2.12'; |
581 | 51 | 51 | ||
582 | 52 | use strict; | 52 | use strict; |
583 | 53 | use warnings FATAL => 'all'; | 53 | use warnings FATAL => 'all'; |
584 | @@ -5158,7 +5158,7 @@ | |||
585 | 5158 | set => $args{set}, | 5158 | set => $args{set}, |
586 | 5159 | NAME_lc => defined($args{NAME_lc}) ? $args{NAME_lc} : 1, | 5159 | NAME_lc => defined($args{NAME_lc}) ? $args{NAME_lc} : 1, |
587 | 5160 | dbh_set => 0, | 5160 | dbh_set => 0, |
589 | 5161 | ask_pass => $o->get('ask-pass'), | 5161 | ask_pass => $args{ask_pass}, |
590 | 5162 | DSNParser => $dp, | 5162 | DSNParser => $dp, |
591 | 5163 | is_cluster_node => undef, | 5163 | is_cluster_node => undef, |
592 | 5164 | parent => $args{parent}, | 5164 | parent => $args{parent}, |
593 | @@ -5169,7 +5169,7 @@ | |||
594 | 5169 | 5169 | ||
595 | 5170 | sub connect { | 5170 | sub connect { |
596 | 5171 | my ( $self, %opts ) = @_; | 5171 | my ( $self, %opts ) = @_; |
598 | 5172 | my $dsn = $self->{dsn}; | 5172 | my $dsn = $opts{dsn} || $self->{dsn}; |
599 | 5173 | my $dp = $self->{DSNParser}; | 5173 | my $dp = $self->{DSNParser}; |
600 | 5174 | 5174 | ||
601 | 5175 | my $dbh = $self->{dbh}; | 5175 | my $dbh = $self->{dbh}; |
602 | @@ -5188,6 +5188,13 @@ | |||
603 | 5188 | } | 5188 | } |
604 | 5189 | 5189 | ||
605 | 5190 | $dbh = $self->set_dbh($dbh); | 5190 | $dbh = $self->set_dbh($dbh); |
606 | 5191 | if ( $opts{dsn} ) { | ||
607 | 5192 | $self->{dsn} = $dsn; | ||
608 | 5193 | $self->{dsn_name} = $dp->as_string($dsn, [qw(h P S)]) | ||
609 | 5194 | || $dp->as_string($dsn, [qw(F)]) | ||
610 | 5195 | || ''; | ||
611 | 5196 | |||
612 | 5197 | } | ||
613 | 5191 | PTDEBUG && _d($dbh, 'Connected dbh to', $self->{hostname},$self->{dsn_name}); | 5198 | PTDEBUG && _d($dbh, 'Connected dbh to', $self->{hostname},$self->{dsn_name}); |
614 | 5192 | return $dbh; | 5199 | return $dbh; |
615 | 5193 | } | 5200 | } |
616 | @@ -5249,6 +5256,17 @@ | |||
617 | 5249 | return $self->{hostname} || $self->{dsn_name} || 'unknown host'; | 5256 | return $self->{hostname} || $self->{dsn_name} || 'unknown host'; |
618 | 5250 | } | 5257 | } |
619 | 5251 | 5258 | ||
620 | 5259 | sub is_cluster_node { | ||
621 | 5260 | my ($self, $cxn) = @_; | ||
622 | 5261 | |||
623 | 5262 | my $sql = "SHOW VARIABLES LIKE 'wsrep\_on'"; | ||
624 | 5263 | PTDEBUG && _d($cxn->name, $sql); | ||
625 | 5264 | my $row = $cxn->dbh->selectrow_arrayref($sql); | ||
626 | 5265 | PTDEBUG && _d(Dumper($row)); | ||
627 | 5266 | return $row && $row->[1] && ($row->[1] eq 'ON' || $row->[1] eq '1') ? 1 : 0; | ||
628 | 5267 | |||
629 | 5268 | } | ||
630 | 5269 | |||
631 | 5252 | sub remove_duplicate_cxns { | 5270 | sub remove_duplicate_cxns { |
632 | 5253 | my ($self, %args) = @_; | 5271 | my ($self, %args) = @_; |
633 | 5254 | my @cxns = @{$args{cxns}}; | 5272 | my @cxns = @{$args{cxns}}; |
634 | @@ -5258,7 +5276,8 @@ | |||
635 | 5258 | 5276 | ||
636 | 5259 | for my $cxn ( @cxns ) { | 5277 | for my $cxn ( @cxns ) { |
637 | 5260 | my $dbh = $cxn->dbh(); | 5278 | my $dbh = $cxn->dbh(); |
639 | 5261 | my $sql = q{SELECT @@server_id}; | 5279 | |
640 | 5280 | my $sql = $self->is_cluster_node($cxn) ? q{SELECT @@wsrep_node_incoming_address} : q{SELECT @@server_id}; | ||
641 | 5262 | PTDEBUG && _d($sql); | 5281 | PTDEBUG && _d($sql); |
642 | 5263 | my ($id) = $dbh->selectrow_array($sql); | 5282 | my ($id) = $dbh->selectrow_array($sql); |
643 | 5264 | PTDEBUG && _d('Server ID for ', $cxn->name, ': ', $id); | 5283 | PTDEBUG && _d('Server ID for ', $cxn->name, ': ', $id); |
644 | @@ -8183,6 +8202,6 @@ | |||
645 | 8183 | 8202 | ||
646 | 8184 | =head1 VERSION | 8203 | =head1 VERSION |
647 | 8185 | 8204 | ||
649 | 8186 | pt-kill 2.2.11 | 8205 | pt-kill 2.2.12 |
650 | 8187 | 8206 | ||
651 | 8188 | =cut | 8207 | =cut |
652 | 8189 | 8208 | ||
653 | === modified file 'bin/pt-mext' | |||
654 | --- bin/pt-mext 2014-09-25 13:48:22 +0000 | |||
655 | +++ bin/pt-mext 2014-11-14 14:12:25 +0000 | |||
656 | @@ -251,34 +251,38 @@ | |||
657 | 251 | _parse_pod() { | 251 | _parse_pod() { |
658 | 252 | local file="$1" | 252 | local file="$1" |
659 | 253 | 253 | ||
672 | 254 | cat "$file" | PO_DIR="$PO_DIR" perl -ne ' | 254 | PO_FILE="$file" PO_DIR="$PO_DIR" perl -e ' |
673 | 255 | BEGIN { $/ = ""; } | 255 | $/ = ""; |
674 | 256 | next unless $_ =~ m/^=head1 OPTIONS/; | 256 | my $file = $ENV{PO_FILE}; |
675 | 257 | while ( defined(my $para = <>) ) { | 257 | open my $fh, "<", $file or die "Cannot open $file: $!"; |
676 | 258 | last if $para =~ m/^=head1/; | 258 | while ( defined(my $para = <$fh>) ) { |
677 | 259 | chomp; | 259 | next unless $para =~ m/^=head1 OPTIONS/; |
678 | 260 | if ( $para =~ m/^=item --(\S+)/ ) { | 260 | while ( defined(my $para = <$fh>) ) { |
679 | 261 | my $opt = $1; | 261 | last if $para =~ m/^=head1/; |
668 | 262 | my $file = "$ENV{PO_DIR}/$opt"; | ||
669 | 263 | open my $opt_fh, ">", $file or die "Cannot open $file: $!"; | ||
670 | 264 | print $opt_fh "long:$opt\n"; | ||
671 | 265 | $para = <>; | ||
680 | 266 | chomp; | 262 | chomp; |
683 | 267 | if ( $para =~ m/^[a-z ]+:/ ) { | 263 | if ( $para =~ m/^=item --(\S+)/ ) { |
684 | 268 | map { | 264 | my $opt = $1; |
685 | 265 | my $file = "$ENV{PO_DIR}/$opt"; | ||
686 | 266 | open my $opt_fh, ">", $file or die "Cannot open $file: $!"; | ||
687 | 267 | print $opt_fh "long:$opt\n"; | ||
688 | 268 | $para = <$fh>; | ||
689 | 269 | chomp; | ||
690 | 270 | if ( $para =~ m/^[a-z ]+:/ ) { | ||
691 | 271 | map { | ||
692 | 272 | chomp; | ||
693 | 273 | my ($attrib, $val) = split(/: /, $_); | ||
694 | 274 | print $opt_fh "$attrib:$val\n"; | ||
695 | 275 | } split(/; /, $para); | ||
696 | 276 | $para = <$fh>; | ||
697 | 269 | chomp; | 277 | chomp; |
703 | 270 | my ($attrib, $val) = split(/: /, $_); | 278 | } |
704 | 271 | print $opt_fh "$attrib:$val\n"; | 279 | my ($desc) = $para =~ m/^([^?.]+)/; |
705 | 272 | } split(/; /, $para); | 280 | print $opt_fh "desc:$desc.\n"; |
706 | 273 | $para = <>; | 281 | close $opt_fh; |
702 | 274 | chomp; | ||
707 | 275 | } | 282 | } |
708 | 276 | my ($desc) = $para =~ m/^([^?.]+)/; | ||
709 | 277 | print $opt_fh "desc:$desc.\n"; | ||
710 | 278 | close $opt_fh; | ||
711 | 279 | } | 283 | } |
712 | 284 | last; | ||
713 | 280 | } | 285 | } |
714 | 281 | last; | ||
715 | 282 | ' | 286 | ' |
716 | 283 | } | 287 | } |
717 | 284 | 288 | ||
718 | @@ -348,6 +352,8 @@ | |||
719 | 348 | 352 | ||
720 | 349 | [ "$config_opt" = "" ] && continue | 353 | [ "$config_opt" = "" ] && continue |
721 | 350 | 354 | ||
722 | 355 | echo "$config_opt" | grep -v 'version-check' >/dev/null 2>&1 || continue | ||
723 | 356 | |||
724 | 351 | if ! [ "$HAVE_EXT_ARGV" ]; then | 357 | if ! [ "$HAVE_EXT_ARGV" ]; then |
725 | 352 | config_opt="--$config_opt" | 358 | config_opt="--$config_opt" |
726 | 353 | fi | 359 | fi |
727 | @@ -792,7 +798,7 @@ | |||
728 | 792 | 798 | ||
729 | 793 | =head1 VERSION | 799 | =head1 VERSION |
730 | 794 | 800 | ||
732 | 795 | pt-mext 2.2.11 | 801 | pt-mext 2.2.12 |
733 | 796 | 802 | ||
734 | 797 | =cut | 803 | =cut |
735 | 798 | 804 | ||
736 | 799 | 805 | ||
737 | === modified file 'bin/pt-mysql-summary' | |||
738 | --- bin/pt-mysql-summary 2014-09-25 13:48:22 +0000 | |||
739 | +++ bin/pt-mysql-summary 2014-11-14 14:12:25 +0000 | |||
740 | @@ -313,6 +313,8 @@ | |||
741 | 313 | 313 | ||
742 | 314 | [ "$config_opt" = "" ] && continue | 314 | [ "$config_opt" = "" ] && continue |
743 | 315 | 315 | ||
744 | 316 | echo "$config_opt" | grep -v 'version-check' >/dev/null 2>&1 || continue | ||
745 | 317 | |||
746 | 316 | if ! [ "$HAVE_EXT_ARGV" ]; then | 318 | if ! [ "$HAVE_EXT_ARGV" ]; then |
747 | 317 | config_opt="--$config_opt" | 319 | config_opt="--$config_opt" |
748 | 318 | fi | 320 | fi |
749 | @@ -3083,7 +3085,7 @@ | |||
750 | 3083 | 3085 | ||
751 | 3084 | =head1 VERSION | 3086 | =head1 VERSION |
752 | 3085 | 3087 | ||
754 | 3086 | pt-mysql-summary 2.2.11 | 3088 | pt-mysql-summary 2.2.12 |
755 | 3087 | 3089 | ||
756 | 3088 | =cut | 3090 | =cut |
757 | 3089 | 3091 | ||
758 | 3090 | 3092 | ||
759 | === modified file 'bin/pt-online-schema-change' | |||
760 | --- bin/pt-online-schema-change 2014-09-25 13:48:22 +0000 | |||
761 | +++ bin/pt-online-schema-change 2014-11-14 14:12:25 +0000 | |||
762 | @@ -54,7 +54,7 @@ | |||
763 | 54 | { | 54 | { |
764 | 55 | package Percona::Toolkit; | 55 | package Percona::Toolkit; |
765 | 56 | 56 | ||
767 | 57 | our $VERSION = '2.2.11'; | 57 | our $VERSION = '2.2.12'; |
768 | 58 | 58 | ||
769 | 59 | use strict; | 59 | use strict; |
770 | 60 | use warnings FATAL => 'all'; | 60 | use warnings FATAL => 'all'; |
771 | @@ -3755,7 +3755,7 @@ | |||
772 | 3755 | set => $args{set}, | 3755 | set => $args{set}, |
773 | 3756 | NAME_lc => defined($args{NAME_lc}) ? $args{NAME_lc} : 1, | 3756 | NAME_lc => defined($args{NAME_lc}) ? $args{NAME_lc} : 1, |
774 | 3757 | dbh_set => 0, | 3757 | dbh_set => 0, |
776 | 3758 | ask_pass => $o->get('ask-pass'), | 3758 | ask_pass => $args{ask_pass}, |
777 | 3759 | DSNParser => $dp, | 3759 | DSNParser => $dp, |
778 | 3760 | is_cluster_node => undef, | 3760 | is_cluster_node => undef, |
779 | 3761 | parent => $args{parent}, | 3761 | parent => $args{parent}, |
780 | @@ -3766,12 +3766,12 @@ | |||
781 | 3766 | 3766 | ||
782 | 3767 | sub connect { | 3767 | sub connect { |
783 | 3768 | my ( $self, %opts ) = @_; | 3768 | my ( $self, %opts ) = @_; |
785 | 3769 | my $dsn = $self->{dsn}; | 3769 | my $dsn = $opts{dsn} || $self->{dsn}; |
786 | 3770 | my $dp = $self->{DSNParser}; | 3770 | my $dp = $self->{DSNParser}; |
787 | 3771 | 3771 | ||
788 | 3772 | my $dbh = $self->{dbh}; | 3772 | my $dbh = $self->{dbh}; |
789 | 3773 | if ( !$dbh || !$dbh->ping() ) { | 3773 | if ( !$dbh || !$dbh->ping() ) { |
791 | 3774 | if ( $self->{ask_pass} && !$self->{asked_for_pass} && !defined $dsn->{p}) { | 3774 | if ( $self->{ask_pass} && !$self->{asked_for_pass} ) { |
792 | 3775 | $dsn->{p} = OptionParser::prompt_noecho("Enter MySQL password: "); | 3775 | $dsn->{p} = OptionParser::prompt_noecho("Enter MySQL password: "); |
793 | 3776 | $self->{asked_for_pass} = 1; | 3776 | $self->{asked_for_pass} = 1; |
794 | 3777 | } | 3777 | } |
795 | @@ -3785,6 +3785,13 @@ | |||
796 | 3785 | } | 3785 | } |
797 | 3786 | 3786 | ||
798 | 3787 | $dbh = $self->set_dbh($dbh); | 3787 | $dbh = $self->set_dbh($dbh); |
799 | 3788 | if ( $opts{dsn} ) { | ||
800 | 3789 | $self->{dsn} = $dsn; | ||
801 | 3790 | $self->{dsn_name} = $dp->as_string($dsn, [qw(h P S)]) | ||
802 | 3791 | || $dp->as_string($dsn, [qw(F)]) | ||
803 | 3792 | || ''; | ||
804 | 3793 | |||
805 | 3794 | } | ||
806 | 3788 | PTDEBUG && _d($dbh, 'Connected dbh to', $self->{hostname},$self->{dsn_name}); | 3795 | PTDEBUG && _d($dbh, 'Connected dbh to', $self->{hostname},$self->{dsn_name}); |
807 | 3789 | return $dbh; | 3796 | return $dbh; |
808 | 3790 | } | 3797 | } |
809 | @@ -3846,6 +3853,17 @@ | |||
810 | 3846 | return $self->{hostname} || $self->{dsn_name} || 'unknown host'; | 3853 | return $self->{hostname} || $self->{dsn_name} || 'unknown host'; |
811 | 3847 | } | 3854 | } |
812 | 3848 | 3855 | ||
813 | 3856 | sub is_cluster_node { | ||
814 | 3857 | my ($self, $cxn) = @_; | ||
815 | 3858 | |||
816 | 3859 | my $sql = "SHOW VARIABLES LIKE 'wsrep\_on'"; | ||
817 | 3860 | PTDEBUG && _d($cxn->name, $sql); | ||
818 | 3861 | my $row = $cxn->dbh->selectrow_arrayref($sql); | ||
819 | 3862 | PTDEBUG && _d(Dumper($row)); | ||
820 | 3863 | return $row && $row->[1] && ($row->[1] eq 'ON' || $row->[1] eq '1') ? 1 : 0; | ||
821 | 3864 | |||
822 | 3865 | } | ||
823 | 3866 | |||
824 | 3849 | sub remove_duplicate_cxns { | 3867 | sub remove_duplicate_cxns { |
825 | 3850 | my ($self, %args) = @_; | 3868 | my ($self, %args) = @_; |
826 | 3851 | my @cxns = @{$args{cxns}}; | 3869 | my @cxns = @{$args{cxns}}; |
827 | @@ -3855,7 +3873,8 @@ | |||
828 | 3855 | 3873 | ||
829 | 3856 | for my $cxn ( @cxns ) { | 3874 | for my $cxn ( @cxns ) { |
830 | 3857 | my $dbh = $cxn->dbh(); | 3875 | my $dbh = $cxn->dbh(); |
832 | 3858 | my $sql = q{SELECT @@server_id}; | 3876 | |
833 | 3877 | my $sql = $self->is_cluster_node($cxn) ? q{SELECT @@wsrep_node_incoming_address} : q{SELECT @@server_id}; | ||
834 | 3859 | PTDEBUG && _d($sql); | 3878 | PTDEBUG && _d($sql); |
835 | 3860 | my ($id) = $dbh->selectrow_array($sql); | 3879 | my ($id) = $dbh->selectrow_array($sql); |
836 | 3861 | PTDEBUG && _d('Server ID for ', $cxn->name, ': ', $id); | 3880 | PTDEBUG && _d('Server ID for ', $cxn->name, ': ', $id); |
837 | @@ -7638,8 +7657,26 @@ | |||
838 | 7638 | sub remove_duplicate_cxns { | 7657 | sub remove_duplicate_cxns { |
839 | 7639 | my ($self, %args) = @_; | 7658 | my ($self, %args) = @_; |
840 | 7640 | my @cxns = @{$args{cxns}}; | 7659 | my @cxns = @{$args{cxns}}; |
843 | 7641 | my $seen_ids = $args{seen_ids}; | 7660 | my $seen_ids = $args{seen_ids} || {}; |
844 | 7642 | return Cxn->remove_duplicate_cxns(%args); | 7661 | PTDEBUG && _d("Removing duplicates nodes from ", join(" ", map { $_->name } @cxns)); |
845 | 7662 | my @trimmed_cxns; | ||
846 | 7663 | |||
847 | 7664 | for my $cxn ( @cxns ) { | ||
848 | 7665 | my $dbh = $cxn->dbh(); | ||
849 | 7666 | my $sql = $self->is_cluster_node($cxn) ? q{SELECT @@wsrep_node_incoming_address} : q{SELECT @@server_id}; | ||
850 | 7667 | PTDEBUG && _d($sql); | ||
851 | 7668 | my ($id) = $dbh->selectrow_array($sql); | ||
852 | 7669 | PTDEBUG && _d('Server ID for ', $cxn->name, ': ', $id); | ||
853 | 7670 | |||
854 | 7671 | if ( ! $seen_ids->{$id}++ ) { | ||
855 | 7672 | push @trimmed_cxns, $cxn | ||
856 | 7673 | } | ||
857 | 7674 | else { | ||
858 | 7675 | PTDEBUG && _d("Removing ", $cxn->name, | ||
859 | 7676 | ", ID ", $id, ", because we've already seen it"); | ||
860 | 7677 | } | ||
861 | 7678 | } | ||
862 | 7679 | return \@trimmed_cxns; | ||
863 | 7643 | } | 7680 | } |
864 | 7644 | 7681 | ||
865 | 7645 | sub same_cluster { | 7682 | sub same_cluster { |
866 | @@ -10556,6 +10593,12 @@ | |||
867 | 10556 | 10593 | ||
868 | 10557 | =item * | 10594 | =item * |
869 | 10558 | 10595 | ||
870 | 10596 | In most cases the tool will refuse to operate unless a PRIMARY KEY or UNIQUE INDEX is | ||
871 | 10597 | present in the table. See L<"--alter"> for details. | ||
872 | 10598 | |||
873 | 10599 | |||
874 | 10600 | =item * | ||
875 | 10601 | |||
876 | 10559 | The tool refuses to operate if it detects replication filters. See | 10602 | The tool refuses to operate if it detects replication filters. See |
877 | 10560 | L<"--[no]check-replication-filters"> for details. | 10603 | L<"--[no]check-replication-filters"> for details. |
878 | 10561 | 10604 | ||
879 | @@ -10634,6 +10677,16 @@ | |||
880 | 10634 | 10677 | ||
881 | 10635 | =item * | 10678 | =item * |
882 | 10636 | 10679 | ||
883 | 10680 | In almost all cases a PRIMARY KEY or UNIQUE INDEX needs to be present in the table. | ||
884 | 10681 | This is necessary because the tool creates a DELETE trigger to keep the new table | ||
885 | 10682 | updated while the process is running. | ||
886 | 10683 | |||
887 | 10684 | A notable exception is when a PRIMARY KEY or UNIQUE INDEX is being created from | ||
888 | 10685 | B<existing columns> as part of the ALTER clause; in that case it will use these | ||
889 | 10686 | column(s) for the DELETE trigger. | ||
890 | 10687 | |||
891 | 10688 | =item * | ||
892 | 10689 | |||
893 | 10637 | The C<RENAME> clause cannot be used to rename the table. | 10690 | The C<RENAME> clause cannot be used to rename the table. |
894 | 10638 | 10691 | ||
895 | 10639 | =item * | 10692 | =item * |
896 | @@ -11563,6 +11616,6 @@ | |||
897 | 11563 | 11616 | ||
898 | 11564 | =head1 VERSION | 11617 | =head1 VERSION |
899 | 11565 | 11618 | ||
901 | 11566 | pt-online-schema-change 2.2.11 | 11619 | pt-online-schema-change 2.2.12 |
902 | 11567 | 11620 | ||
903 | 11568 | =cut | 11621 | =cut |
904 | 11569 | 11622 | ||
905 | === modified file 'bin/pt-pmp' | |||
906 | --- bin/pt-pmp 2014-09-25 13:48:22 +0000 | |||
907 | +++ bin/pt-pmp 2014-11-14 14:12:25 +0000 | |||
908 | @@ -129,9 +129,10 @@ | |||
909 | 129 | 129 | ||
910 | 130 | usage_or_errors() { | 130 | usage_or_errors() { |
911 | 131 | local file="$1" | 131 | local file="$1" |
912 | 132 | local version="" | ||
913 | 132 | 133 | ||
914 | 133 | if [ "$OPT_VERSION" ]; then | 134 | if [ "$OPT_VERSION" ]; then |
916 | 134 | local version=$(grep '^pt-[^ ]\+ [0-9]' "$file") | 135 | version=$(grep '^pt-[^ ]\+ [0-9]' "$file") |
917 | 135 | echo "$version" | 136 | echo "$version" |
918 | 136 | return 1 | 137 | return 1 |
919 | 137 | fi | 138 | fi |
920 | @@ -353,6 +354,8 @@ | |||
921 | 353 | 354 | ||
922 | 354 | [ "$config_opt" = "" ] && continue | 355 | [ "$config_opt" = "" ] && continue |
923 | 355 | 356 | ||
924 | 357 | echo "$config_opt" | grep -v 'version-check' >/dev/null 2>&1 || continue | ||
925 | 358 | |||
926 | 356 | if ! [ "$HAVE_EXT_ARGV" ]; then | 359 | if ! [ "$HAVE_EXT_ARGV" ]; then |
927 | 357 | config_opt="--$config_opt" | 360 | config_opt="--$config_opt" |
928 | 358 | fi | 361 | fi |
929 | @@ -889,7 +892,7 @@ | |||
930 | 889 | 892 | ||
931 | 890 | =head1 VERSION | 893 | =head1 VERSION |
932 | 891 | 894 | ||
934 | 892 | pt-pmp 2.2.11 | 895 | pt-pmp 2.2.12 |
935 | 893 | 896 | ||
936 | 894 | =cut | 897 | =cut |
937 | 895 | 898 | ||
938 | 896 | 899 | ||
939 | === modified file 'bin/pt-query-digest' | |||
940 | --- bin/pt-query-digest 2014-09-25 13:48:22 +0000 | |||
941 | +++ bin/pt-query-digest 2014-11-14 14:12:25 +0000 | |||
942 | @@ -64,7 +64,7 @@ | |||
943 | 64 | { | 64 | { |
944 | 65 | package Percona::Toolkit; | 65 | package Percona::Toolkit; |
945 | 66 | 66 | ||
947 | 67 | our $VERSION = '2.2.11'; | 67 | our $VERSION = '2.2.12'; |
948 | 68 | 68 | ||
949 | 69 | use strict; | 69 | use strict; |
950 | 70 | use warnings FATAL => 'all'; | 70 | use warnings FATAL => 'all'; |
951 | @@ -13181,6 +13181,13 @@ | |||
952 | 13181 | if ( $fh ) { | 13181 | if ( $fh ) { |
953 | 13182 | PTDEBUG && _d('Reading', $filename); | 13182 | PTDEBUG && _d('Reading', $filename); |
954 | 13183 | PTDEBUG && _d('File size:', $filesize); | 13183 | PTDEBUG && _d('File size:', $filesize); |
955 | 13184 | # catch if user is trying to use an uncoverted (raw) binlog # issue 1377888 | ||
956 | 13185 | if ( $filename && $o->get('type')->[0] eq 'binlog') { | ||
957 | 13186 | if (is_raw_binlog($filename)) { | ||
958 | 13187 | warn "Binlog file $filename must first be converted to text format using mysqlbinlog"; | ||
959 | 13188 | return 1; | ||
960 | 13189 | } | ||
961 | 13190 | } | ||
962 | 13184 | push @read_files, { name => ($filename || "STDIN"), size => $filesize }; | 13191 | push @read_files, { name => ($filename || "STDIN"), size => $filesize }; |
963 | 13185 | 13192 | ||
964 | 13186 | # Read the file offset for --resume. | 13193 | # Read the file offset for --resume. |
965 | @@ -14722,6 +14729,14 @@ | |||
966 | 14722 | return; | 14729 | return; |
967 | 14723 | } | 14730 | } |
968 | 14724 | 14731 | ||
969 | 14732 | # make an effort to check if file is a raw binlog | ||
970 | 14733 | # (i.e. was not converted to text using mysqlbinlog) | ||
971 | 14734 | sub is_raw_binlog { | ||
972 | 14735 | my $filename = shift; | ||
973 | 14736 | |||
974 | 14737 | return -B $filename; | ||
975 | 14738 | } | ||
976 | 14739 | |||
977 | 14725 | sub _d { | 14740 | sub _d { |
978 | 14726 | my ($package, undef, $line) = caller 0; | 14741 | my ($package, undef, $line) = caller 0; |
979 | 14727 | @_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; } | 14742 | @_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; } |
980 | @@ -14798,7 +14813,8 @@ | |||
981 | 14798 | 14813 | ||
982 | 14799 | pt-query-digest is a sophisticated but easy to use tool for analyzing | 14814 | pt-query-digest is a sophisticated but easy to use tool for analyzing |
983 | 14800 | MySQL queries. It can analyze queries from MySQL slow, general, and binary | 14815 | MySQL queries. It can analyze queries from MySQL slow, general, and binary |
985 | 14801 | logs, as well as C<SHOW PROCESSLIST> and MySQL protocol data from tcpdump. | 14816 | logs. (Binary logs must first be converted to text, see L<"--type">). |
986 | 14817 | It can also use C<SHOW PROCESSLIST> and MySQL protocol data from tcpdump. | ||
987 | 14802 | By default, the tool reports which queries are the slowest, and therefore | 14818 | By default, the tool reports which queries are the slowest, and therefore |
988 | 14803 | the most important to optimize. More complex and custom-tailored reports | 14819 | the most important to optimize. More complex and custom-tailored reports |
989 | 14804 | can be created by using options like L<"--group-by">, L<"--filter">, and | 14820 | can be created by using options like L<"--group-by">, L<"--filter">, and |
990 | @@ -16134,7 +16150,13 @@ | |||
991 | 16134 | 16150 | ||
992 | 16135 | =item binlog | 16151 | =item binlog |
993 | 16136 | 16152 | ||
995 | 16137 | Parse a binary log file. | 16153 | Parse a binary log file that has first been converted to text using mysqlbinlog. |
996 | 16154 | |||
997 | 16155 | For example: | ||
998 | 16156 | |||
999 | 16157 | mysqlbinlog mysql-bin.000441 > mysql-bin.000441.txt | ||
1000 | 16158 | |||
1001 | 16159 | pt-query-digest --type binlog mysql-bin.000441.txt | ||
1002 | 16138 | 16160 | ||
1003 | 16139 | =item genlog | 16161 | =item genlog |
1004 | 16140 | 16162 | ||
1005 | @@ -16595,6 +16617,6 @@ | |||
1006 | 16595 | 16617 | ||
1007 | 16596 | =head1 VERSION | 16618 | =head1 VERSION |
1008 | 16597 | 16619 | ||
1010 | 16598 | pt-query-digest 2.2.11 | 16620 | pt-query-digest 2.2.12 |
1011 | 16599 | 16621 | ||
1012 | 16600 | =cut | 16622 | =cut |
1013 | 16601 | 16623 | ||
1014 | === modified file 'bin/pt-show-grants' | |||
1015 | --- bin/pt-show-grants 2014-09-25 13:48:22 +0000 | |||
1016 | +++ bin/pt-show-grants 2014-11-14 14:12:25 +0000 | |||
1017 | @@ -903,6 +903,14 @@ | |||
1018 | 903 | $parse = 0; | 903 | $parse = 0; |
1019 | 904 | next LINE; | 904 | next LINE; |
1020 | 905 | } | 905 | } |
1021 | 906 | |||
1022 | 907 | if ( $parse | ||
1023 | 908 | && !$self->has('version-check') | ||
1024 | 909 | && $line =~ /version-check/ | ||
1025 | 910 | ) { | ||
1026 | 911 | next LINE; | ||
1027 | 912 | } | ||
1028 | 913 | |||
1029 | 906 | if ( $parse | 914 | if ( $parse |
1030 | 907 | && (my($opt, $arg) = $line =~ m/^\s*([^=\s]+?)(?:\s*=\s*(.*?)\s*)?$/) | 915 | && (my($opt, $arg) = $line =~ m/^\s*([^=\s]+?)(?:\s*=\s*(.*?)\s*)?$/) |
1031 | 908 | ) { | 916 | ) { |
1032 | @@ -2406,6 +2414,6 @@ | |||
1033 | 2406 | 2414 | ||
1034 | 2407 | =head1 VERSION | 2415 | =head1 VERSION |
1035 | 2408 | 2416 | ||
1037 | 2409 | pt-show-grants 2.2.11 | 2417 | pt-show-grants 2.2.12 |
1038 | 2410 | 2418 | ||
1039 | 2411 | =cut | 2419 | =cut |
1040 | 2412 | 2420 | ||
1041 | === modified file 'bin/pt-sift' | |||
1042 | --- bin/pt-sift 2014-09-25 13:48:22 +0000 | |||
1043 | +++ bin/pt-sift 2014-11-14 14:12:25 +0000 | |||
1044 | @@ -127,9 +127,10 @@ | |||
1045 | 127 | 127 | ||
1046 | 128 | usage_or_errors() { | 128 | usage_or_errors() { |
1047 | 129 | local file="$1" | 129 | local file="$1" |
1048 | 130 | local version="" | ||
1049 | 130 | 131 | ||
1050 | 131 | if [ "$OPT_VERSION" ]; then | 132 | if [ "$OPT_VERSION" ]; then |
1052 | 132 | local version=$(grep '^pt-[^ ]\+ [0-9]' "$file") | 133 | version=$(grep '^pt-[^ ]\+ [0-9]' "$file") |
1053 | 133 | echo "$version" | 134 | echo "$version" |
1054 | 134 | return 1 | 135 | return 1 |
1055 | 135 | fi | 136 | fi |
1056 | @@ -351,6 +352,8 @@ | |||
1057 | 351 | 352 | ||
1058 | 352 | [ "$config_opt" = "" ] && continue | 353 | [ "$config_opt" = "" ] && continue |
1059 | 353 | 354 | ||
1060 | 355 | echo "$config_opt" | grep -v 'version-check' >/dev/null 2>&1 || continue | ||
1061 | 356 | |||
1062 | 354 | if ! [ "$HAVE_EXT_ARGV" ]; then | 357 | if ! [ "$HAVE_EXT_ARGV" ]; then |
1063 | 355 | config_opt="--$config_opt" | 358 | config_opt="--$config_opt" |
1064 | 356 | fi | 359 | fi |
1065 | @@ -1237,7 +1240,7 @@ | |||
1066 | 1237 | 1240 | ||
1067 | 1238 | =head1 VERSION | 1241 | =head1 VERSION |
1068 | 1239 | 1242 | ||
1070 | 1240 | pt-sift 2.2.11 | 1243 | pt-sift 2.2.12 |
1071 | 1241 | 1244 | ||
1072 | 1242 | =cut | 1245 | =cut |
1073 | 1243 | 1246 | ||
1074 | 1244 | 1247 | ||
1075 | === modified file 'bin/pt-slave-delay' | |||
1076 | --- bin/pt-slave-delay 2014-09-25 13:48:22 +0000 | |||
1077 | +++ bin/pt-slave-delay 2014-11-14 14:12:25 +0000 | |||
1078 | @@ -40,7 +40,7 @@ | |||
1079 | 40 | { | 40 | { |
1080 | 41 | package Percona::Toolkit; | 41 | package Percona::Toolkit; |
1081 | 42 | 42 | ||
1083 | 43 | our $VERSION = '2.2.11'; | 43 | our $VERSION = '2.2.12'; |
1084 | 44 | 44 | ||
1085 | 45 | use strict; | 45 | use strict; |
1086 | 46 | use warnings FATAL => 'all'; | 46 | use warnings FATAL => 'all'; |
1087 | @@ -4869,6 +4869,6 @@ | |||
1088 | 4869 | 4869 | ||
1089 | 4870 | =head1 VERSION | 4870 | =head1 VERSION |
1090 | 4871 | 4871 | ||
1092 | 4872 | pt-slave-delay 2.2.11 | 4872 | pt-slave-delay 2.2.12 |
1093 | 4873 | 4873 | ||
1094 | 4874 | =cut | 4874 | =cut |
1095 | 4875 | 4875 | ||
1096 | === modified file 'bin/pt-slave-find' | |||
1097 | --- bin/pt-slave-find 2014-09-25 13:48:22 +0000 | |||
1098 | +++ bin/pt-slave-find 2014-11-14 14:12:25 +0000 | |||
1099 | @@ -911,6 +911,14 @@ | |||
1100 | 911 | $parse = 0; | 911 | $parse = 0; |
1101 | 912 | next LINE; | 912 | next LINE; |
1102 | 913 | } | 913 | } |
1103 | 914 | |||
1104 | 915 | if ( $parse | ||
1105 | 916 | && !$self->has('version-check') | ||
1106 | 917 | && $line =~ /version-check/ | ||
1107 | 918 | ) { | ||
1108 | 919 | next LINE; | ||
1109 | 920 | } | ||
1110 | 921 | |||
1111 | 914 | if ( $parse | 922 | if ( $parse |
1112 | 915 | && (my($opt, $arg) = $line =~ m/^\s*([^=\s]+?)(?:\s*=\s*(.*?)\s*)?$/) | 923 | && (my($opt, $arg) = $line =~ m/^\s*([^=\s]+?)(?:\s*=\s*(.*?)\s*)?$/) |
1113 | 916 | ) { | 924 | ) { |
1114 | @@ -4334,6 +4342,6 @@ | |||
1115 | 4334 | 4342 | ||
1116 | 4335 | =head1 VERSION | 4343 | =head1 VERSION |
1117 | 4336 | 4344 | ||
1119 | 4337 | pt-slave-find 2.2.11 | 4345 | pt-slave-find 2.2.12 |
1120 | 4338 | 4346 | ||
1121 | 4339 | =cut | 4347 | =cut |
1122 | 4340 | 4348 | ||
1123 | === modified file 'bin/pt-slave-restart' | |||
1124 | --- bin/pt-slave-restart 2014-09-25 13:48:22 +0000 | |||
1125 | +++ bin/pt-slave-restart 2014-11-14 14:12:25 +0000 | |||
1126 | @@ -41,7 +41,7 @@ | |||
1127 | 41 | { | 41 | { |
1128 | 42 | package Percona::Toolkit; | 42 | package Percona::Toolkit; |
1129 | 43 | 43 | ||
1131 | 44 | our $VERSION = '2.2.11'; | 44 | our $VERSION = '2.2.12'; |
1132 | 45 | 45 | ||
1133 | 46 | use strict; | 46 | use strict; |
1134 | 47 | use warnings FATAL => 'all'; | 47 | use warnings FATAL => 'all'; |
1135 | @@ -5937,6 +5937,6 @@ | |||
1136 | 5937 | 5937 | ||
1137 | 5938 | =head1 VERSION | 5938 | =head1 VERSION |
1138 | 5939 | 5939 | ||
1140 | 5940 | pt-slave-restart 2.2.11 | 5940 | pt-slave-restart 2.2.12 |
1141 | 5941 | 5941 | ||
1142 | 5942 | =cut | 5942 | =cut |
1143 | 5943 | 5943 | ||
1144 | === modified file 'bin/pt-stalk' | |||
1145 | --- bin/pt-stalk 2014-09-25 13:48:22 +0000 | |||
1146 | +++ bin/pt-stalk 2014-11-14 14:12:25 +0000 | |||
1147 | @@ -140,9 +140,10 @@ | |||
1148 | 140 | 140 | ||
1149 | 141 | usage_or_errors() { | 141 | usage_or_errors() { |
1150 | 142 | local file="$1" | 142 | local file="$1" |
1151 | 143 | local version="" | ||
1152 | 143 | 144 | ||
1153 | 144 | if [ "$OPT_VERSION" ]; then | 145 | if [ "$OPT_VERSION" ]; then |
1155 | 145 | local version=$(grep '^pt-[^ ]\+ [0-9]' "$file") | 146 | version=$(grep '^pt-[^ ]\+ [0-9]' "$file") |
1156 | 146 | echo "$version" | 147 | echo "$version" |
1157 | 147 | return 1 | 148 | return 1 |
1158 | 148 | fi | 149 | fi |
1159 | @@ -364,6 +365,8 @@ | |||
1160 | 364 | 365 | ||
1161 | 365 | [ "$config_opt" = "" ] && continue | 366 | [ "$config_opt" = "" ] && continue |
1162 | 366 | 367 | ||
1163 | 368 | echo "$config_opt" | grep -v 'version-check' >/dev/null 2>&1 || continue | ||
1164 | 369 | |||
1165 | 367 | if ! [ "$HAVE_EXT_ARGV" ]; then | 370 | if ! [ "$HAVE_EXT_ARGV" ]; then |
1166 | 368 | config_opt="--$config_opt" | 371 | config_opt="--$config_opt" |
1167 | 369 | fi | 372 | fi |
1168 | @@ -779,6 +782,7 @@ | |||
1169 | 779 | CMD_SYSCTL="${CMD_SYSCTL:-"$(_which sysctl)"}" | 782 | CMD_SYSCTL="${CMD_SYSCTL:-"$(_which sysctl)"}" |
1170 | 780 | CMD_TCPDUMP="${CMD_TCPDUMP:-"$(_which tcpdump)"}" | 783 | CMD_TCPDUMP="${CMD_TCPDUMP:-"$(_which tcpdump)"}" |
1171 | 781 | CMD_VMSTAT="${CMD_VMSTAT:-"$(_which vmstat)"}" | 784 | CMD_VMSTAT="${CMD_VMSTAT:-"$(_which vmstat)"}" |
1172 | 785 | CMD_DMESG="${CMD_DMESG:-"$(_which dmesg)"}" | ||
1173 | 782 | 786 | ||
1174 | 783 | [ -z "$CMD_SYSCTL" -a -x "/sbin/sysctl" ] && CMD_SYSCTL="/sbin/sysctl" | 787 | [ -z "$CMD_SYSCTL" -a -x "/sbin/sysctl" ] && CMD_SYSCTL="/sbin/sysctl" |
1175 | 784 | 788 | ||
1176 | @@ -862,6 +866,14 @@ | |||
1177 | 862 | if [ "$CMD_SYSCTL" ]; then | 866 | if [ "$CMD_SYSCTL" ]; then |
1178 | 863 | $CMD_SYSCTL -a >> "$d/$p-sysctl" & | 867 | $CMD_SYSCTL -a >> "$d/$p-sysctl" & |
1179 | 864 | fi | 868 | fi |
1180 | 869 | |||
1181 | 870 | # collect dmesg events from 60 seconds ago until present | ||
1182 | 871 | if [ "$CMD_DMESG" ]; then | ||
1183 | 872 | local UPTIME=`cat /proc/uptime | awk '{ print $1 }'` | ||
1184 | 873 | local START_TIME=$(echo "$UPTIME 60" | awk '{print ($1 - $2)}') | ||
1185 | 874 | $CMD_DMESG | perl -ne 'm/\[\s*(\d+)\./; if ($1 > '${START_TIME}') { print }' >> "$d/$p-dmesg" & | ||
1186 | 875 | fi | ||
1187 | 876 | |||
1188 | 865 | local cnt=$(($OPT_RUN_TIME / $OPT_SLEEP_COLLECT)) | 877 | local cnt=$(($OPT_RUN_TIME / $OPT_SLEEP_COLLECT)) |
1189 | 866 | if [ "$CMD_VMSTAT" ]; then | 878 | if [ "$CMD_VMSTAT" ]; then |
1190 | 867 | $CMD_VMSTAT $OPT_SLEEP_COLLECT $cnt >> "$d/$p-vmstat" & | 879 | $CMD_VMSTAT $OPT_SLEEP_COLLECT $cnt >> "$d/$p-vmstat" & |
1191 | @@ -876,6 +888,7 @@ | |||
1192 | 876 | $CMD_MPSTAT -P ALL $OPT_RUN_TIME 1 >> "$d/$p-mpstat-overall" & | 888 | $CMD_MPSTAT -P ALL $OPT_RUN_TIME 1 >> "$d/$p-mpstat-overall" & |
1193 | 877 | fi | 889 | fi |
1194 | 878 | 890 | ||
1195 | 891 | |||
1196 | 879 | $CMD_MYSQLADMIN $EXT_ARGV ext -i$OPT_SLEEP_COLLECT -c$cnt >>"$d/$p-mysqladmin" & | 892 | $CMD_MYSQLADMIN $EXT_ARGV ext -i$OPT_SLEEP_COLLECT -c$cnt >>"$d/$p-mysqladmin" & |
1197 | 880 | local mysqladmin_pid=$! | 893 | local mysqladmin_pid=$! |
1198 | 881 | 894 | ||
1199 | @@ -2225,7 +2238,7 @@ | |||
1200 | 2225 | 2238 | ||
1201 | 2226 | =head1 VERSION | 2239 | =head1 VERSION |
1202 | 2227 | 2240 | ||
1204 | 2228 | pt-stalk 2.2.11 | 2241 | pt-stalk 2.2.12 |
1205 | 2229 | 2242 | ||
1206 | 2230 | =cut | 2243 | =cut |
1207 | 2231 | 2244 | ||
1208 | 2232 | 2245 | ||
1209 | === modified file 'bin/pt-summary' | |||
1210 | --- bin/pt-summary 2014-09-25 13:48:22 +0000 | |||
1211 | +++ bin/pt-summary 2014-11-14 14:12:25 +0000 | |||
1212 | @@ -320,6 +320,8 @@ | |||
1213 | 320 | 320 | ||
1214 | 321 | [ "$config_opt" = "" ] && continue | 321 | [ "$config_opt" = "" ] && continue |
1215 | 322 | 322 | ||
1216 | 323 | echo "$config_opt" | grep -v 'version-check' >/dev/null 2>&1 || continue | ||
1217 | 324 | |||
1218 | 323 | if ! [ "$HAVE_EXT_ARGV" ]; then | 325 | if ! [ "$HAVE_EXT_ARGV" ]; then |
1219 | 324 | config_opt="--$config_opt" | 326 | config_opt="--$config_opt" |
1220 | 325 | fi | 327 | fi |
1221 | @@ -2691,7 +2693,7 @@ | |||
1222 | 2691 | 2693 | ||
1223 | 2692 | =head1 VERSION | 2694 | =head1 VERSION |
1224 | 2693 | 2695 | ||
1226 | 2694 | pt-summary 2.2.11 | 2696 | pt-summary 2.2.12 |
1227 | 2695 | 2697 | ||
1228 | 2696 | =cut | 2698 | =cut |
1229 | 2697 | 2699 | ||
1230 | 2698 | 2700 | ||
1231 | === modified file 'bin/pt-table-checksum' | |||
1232 | --- bin/pt-table-checksum 2014-09-25 13:48:22 +0000 | |||
1233 | +++ bin/pt-table-checksum 2014-11-14 14:12:25 +0000 | |||
1234 | @@ -57,7 +57,7 @@ | |||
1235 | 57 | { | 57 | { |
1236 | 58 | package Percona::Toolkit; | 58 | package Percona::Toolkit; |
1237 | 59 | 59 | ||
1239 | 60 | our $VERSION = '2.2.11'; | 60 | our $VERSION = '2.2.12'; |
1240 | 61 | 61 | ||
1241 | 62 | use strict; | 62 | use strict; |
1242 | 63 | use warnings FATAL => 'all'; | 63 | use warnings FATAL => 'all'; |
1243 | @@ -3533,7 +3533,7 @@ | |||
1244 | 3533 | set => $args{set}, | 3533 | set => $args{set}, |
1245 | 3534 | NAME_lc => defined($args{NAME_lc}) ? $args{NAME_lc} : 1, | 3534 | NAME_lc => defined($args{NAME_lc}) ? $args{NAME_lc} : 1, |
1246 | 3535 | dbh_set => 0, | 3535 | dbh_set => 0, |
1248 | 3536 | ask_pass => $o->get('ask-pass'), | 3536 | ask_pass => $args{ask_pass}, |
1249 | 3537 | DSNParser => $dp, | 3537 | DSNParser => $dp, |
1250 | 3538 | is_cluster_node => undef, | 3538 | is_cluster_node => undef, |
1251 | 3539 | parent => $args{parent}, | 3539 | parent => $args{parent}, |
1252 | @@ -3544,7 +3544,7 @@ | |||
1253 | 3544 | 3544 | ||
1254 | 3545 | sub connect { | 3545 | sub connect { |
1255 | 3546 | my ( $self, %opts ) = @_; | 3546 | my ( $self, %opts ) = @_; |
1257 | 3547 | my $dsn = $self->{dsn}; | 3547 | my $dsn = $opts{dsn} || $self->{dsn}; |
1258 | 3548 | my $dp = $self->{DSNParser}; | 3548 | my $dp = $self->{DSNParser}; |
1259 | 3549 | 3549 | ||
1260 | 3550 | my $dbh = $self->{dbh}; | 3550 | my $dbh = $self->{dbh}; |
1261 | @@ -3563,6 +3563,13 @@ | |||
1262 | 3563 | } | 3563 | } |
1263 | 3564 | 3564 | ||
1264 | 3565 | $dbh = $self->set_dbh($dbh); | 3565 | $dbh = $self->set_dbh($dbh); |
1265 | 3566 | if ( $opts{dsn} ) { | ||
1266 | 3567 | $self->{dsn} = $dsn; | ||
1267 | 3568 | $self->{dsn_name} = $dp->as_string($dsn, [qw(h P S)]) | ||
1268 | 3569 | || $dp->as_string($dsn, [qw(F)]) | ||
1269 | 3570 | || ''; | ||
1270 | 3571 | |||
1271 | 3572 | } | ||
1272 | 3566 | PTDEBUG && _d($dbh, 'Connected dbh to', $self->{hostname},$self->{dsn_name}); | 3573 | PTDEBUG && _d($dbh, 'Connected dbh to', $self->{hostname},$self->{dsn_name}); |
1273 | 3567 | return $dbh; | 3574 | return $dbh; |
1274 | 3568 | } | 3575 | } |
1275 | @@ -3624,6 +3631,17 @@ | |||
1276 | 3624 | return $self->{hostname} || $self->{dsn_name} || 'unknown host'; | 3631 | return $self->{hostname} || $self->{dsn_name} || 'unknown host'; |
1277 | 3625 | } | 3632 | } |
1278 | 3626 | 3633 | ||
1279 | 3634 | sub is_cluster_node { | ||
1280 | 3635 | my ($self, $cxn) = @_; | ||
1281 | 3636 | |||
1282 | 3637 | my $sql = "SHOW VARIABLES LIKE 'wsrep\_on'"; | ||
1283 | 3638 | PTDEBUG && _d($cxn->name, $sql); | ||
1284 | 3639 | my $row = $cxn->dbh->selectrow_arrayref($sql); | ||
1285 | 3640 | PTDEBUG && _d(Dumper($row)); | ||
1286 | 3641 | return $row && $row->[1] && ($row->[1] eq 'ON' || $row->[1] eq '1') ? 1 : 0; | ||
1287 | 3642 | |||
1288 | 3643 | } | ||
1289 | 3644 | |||
1290 | 3627 | sub remove_duplicate_cxns { | 3645 | sub remove_duplicate_cxns { |
1291 | 3628 | my ($self, %args) = @_; | 3646 | my ($self, %args) = @_; |
1292 | 3629 | my @cxns = @{$args{cxns}}; | 3647 | my @cxns = @{$args{cxns}}; |
1293 | @@ -3633,7 +3651,8 @@ | |||
1294 | 3633 | 3651 | ||
1295 | 3634 | for my $cxn ( @cxns ) { | 3652 | for my $cxn ( @cxns ) { |
1296 | 3635 | my $dbh = $cxn->dbh(); | 3653 | my $dbh = $cxn->dbh(); |
1298 | 3636 | my $sql = q{SELECT @@server_id}; | 3654 | |
1299 | 3655 | my $sql = $self->is_cluster_node($cxn) ? q{SELECT @@wsrep_node_incoming_address} : q{SELECT @@server_id}; | ||
1300 | 3637 | PTDEBUG && _d($sql); | 3656 | PTDEBUG && _d($sql); |
1301 | 3638 | my ($id) = $dbh->selectrow_array($sql); | 3657 | my ($id) = $dbh->selectrow_array($sql); |
1302 | 3639 | PTDEBUG && _d('Server ID for ', $cxn->name, ': ', $id); | 3658 | PTDEBUG && _d('Server ID for ', $cxn->name, ': ', $id); |
1303 | @@ -3788,8 +3807,26 @@ | |||
1304 | 3788 | sub remove_duplicate_cxns { | 3807 | sub remove_duplicate_cxns { |
1305 | 3789 | my ($self, %args) = @_; | 3808 | my ($self, %args) = @_; |
1306 | 3790 | my @cxns = @{$args{cxns}}; | 3809 | my @cxns = @{$args{cxns}}; |
1309 | 3791 | my $seen_ids = $args{seen_ids}; | 3810 | my $seen_ids = $args{seen_ids} || {}; |
1310 | 3792 | return Cxn->remove_duplicate_cxns(%args); | 3811 | PTDEBUG && _d("Removing duplicates nodes from ", join(" ", map { $_->name } @cxns)); |
1311 | 3812 | my @trimmed_cxns; | ||
1312 | 3813 | |||
1313 | 3814 | for my $cxn ( @cxns ) { | ||
1314 | 3815 | my $dbh = $cxn->dbh(); | ||
1315 | 3816 | my $sql = $self->is_cluster_node($cxn) ? q{SELECT @@wsrep_node_incoming_address} : q{SELECT @@server_id}; | ||
1316 | 3817 | PTDEBUG && _d($sql); | ||
1317 | 3818 | my ($id) = $dbh->selectrow_array($sql); | ||
1318 | 3819 | PTDEBUG && _d('Server ID for ', $cxn->name, ': ', $id); | ||
1319 | 3820 | |||
1320 | 3821 | if ( ! $seen_ids->{$id}++ ) { | ||
1321 | 3822 | push @trimmed_cxns, $cxn | ||
1322 | 3823 | } | ||
1323 | 3824 | else { | ||
1324 | 3825 | PTDEBUG && _d("Removing ", $cxn->name, | ||
1325 | 3826 | ", ID ", $id, ", because we've already seen it"); | ||
1326 | 3827 | } | ||
1327 | 3828 | } | ||
1328 | 3829 | return \@trimmed_cxns; | ||
1329 | 3793 | } | 3830 | } |
1330 | 3794 | 3831 | ||
1331 | 3795 | sub same_cluster { | 3832 | sub same_cluster { |
1332 | @@ -9286,7 +9323,8 @@ | |||
1333 | 9286 | my %seen_ids; | 9323 | my %seen_ids; |
1334 | 9287 | for my $cxn ($master_cxn, @$slaves) { | 9324 | for my $cxn ($master_cxn, @$slaves) { |
1335 | 9288 | my $dbh = $cxn->dbh(); | 9325 | my $dbh = $cxn->dbh(); |
1337 | 9289 | my $sql = q{SELECT @@server_id}; | 9326 | # if it's a cluster node we use its incoming address as id ( see https://bugs.launchpad.net/percona-toolkit/+bug/1217466 ) |
1338 | 9327 | my $sql = $cluster->is_cluster_node($cxn) ? q{SELECT @@wsrep_node_incoming_address} : q{SELECT @@server_id}; | ||
1339 | 9290 | PTDEBUG && _d($cxn, $dbh, $sql); | 9328 | PTDEBUG && _d($cxn, $dbh, $sql); |
1340 | 9291 | my ($id) = $dbh->selectrow_array($sql); | 9329 | my ($id) = $dbh->selectrow_array($sql); |
1341 | 9292 | $seen_ids{$id}++; | 9330 | $seen_ids{$id}++; |
1342 | @@ -9363,9 +9401,11 @@ | |||
1343 | 9363 | 9401 | ||
1344 | 9364 | if ( $cluster_name_for{$master_cxn} ) { | 9402 | if ( $cluster_name_for{$master_cxn} ) { |
1345 | 9365 | if ( !@$slaves ) { | 9403 | if ( !@$slaves ) { |
1349 | 9366 | die $master_cxn->name() . " is a cluster node but no other nodes " | 9404 | if ( ($o->get('recursion-method')->[0] || '') ne 'none' ) { |
1350 | 9367 | . "or regular replicas were found. Use --recursion-method=dsn " | 9405 | die $master_cxn->name() . " is a cluster node but no other nodes " |
1351 | 9368 | . "to specify the other nodes in the cluster.\n"; | 9406 | . "or regular replicas were found. Use --recursion-method=dsn " |
1352 | 9407 | . "to specify the other nodes in the cluster.\n"; | ||
1353 | 9408 | } | ||
1354 | 9369 | } | 9409 | } |
1355 | 9370 | 9410 | ||
1356 | 9371 | # Make sure the master and all node are in the same cluster. | 9411 | # Make sure the master and all node are in the same cluster. |
1357 | @@ -12240,9 +12280,13 @@ | |||
1358 | 12240 | The C<dsn> column contains a replica DSN like it would be given on the command | 12280 | The C<dsn> column contains a replica DSN like it would be given on the command |
1359 | 12241 | line, for example: C<"h=replica_host,u=repl_user,p=repl_pass">. | 12281 | line, for example: C<"h=replica_host,u=repl_user,p=repl_pass">. |
1360 | 12242 | 12282 | ||
1364 | 12243 | The C<none> method prevents the tool from connecting to any replicas. | 12283 | The C<none> method makes the tool ignore all slaves and cluster nodes. This |
1365 | 12244 | This effectively disables all the L<"REPLICA CHECKS"> because there will | 12284 | method is not recommended because it effectively disables the |
1366 | 12245 | not be any replicas to check. Therefore, this method is not recommended. | 12285 | L<"REPLICA CHECKS"> and no differences can be found. It is useful, however, if |
1367 | 12286 | you only need to write checksums on the master or a single cluster node. The | ||
1368 | 12287 | safer alternative is C<--no-replicate-check>: the tool finds replicas and | ||
1369 | 12288 | cluster nodes, performs the L<"REPLICA CHECKS">, but does not check for | ||
1370 | 12289 | differences. See L<"--[no]replicate-check">. | ||
1371 | 12246 | 12290 | ||
1372 | 12247 | =item --replicate | 12291 | =item --replicate |
1373 | 12248 | 12292 | ||
1374 | @@ -12698,6 +12742,6 @@ | |||
1375 | 12698 | 12742 | ||
1376 | 12699 | =head1 VERSION | 12743 | =head1 VERSION |
1377 | 12700 | 12744 | ||
1379 | 12701 | pt-table-checksum 2.2.11 | 12745 | pt-table-checksum 2.2.12 |
1380 | 12702 | 12746 | ||
1381 | 12703 | =cut | 12747 | =cut |
1382 | 12704 | 12748 | ||
1383 | === modified file 'bin/pt-table-sync' | |||
1384 | --- bin/pt-table-sync 2014-09-25 13:48:22 +0000 | |||
1385 | +++ bin/pt-table-sync 2014-11-14 14:12:25 +0000 | |||
1386 | @@ -55,7 +55,7 @@ | |||
1387 | 55 | { | 55 | { |
1388 | 56 | package Percona::Toolkit; | 56 | package Percona::Toolkit; |
1389 | 57 | 57 | ||
1391 | 58 | our $VERSION = '2.2.11'; | 58 | our $VERSION = '2.2.12'; |
1392 | 59 | 59 | ||
1393 | 60 | use strict; | 60 | use strict; |
1394 | 61 | use warnings FATAL => 'all'; | 61 | use warnings FATAL => 'all'; |
1395 | @@ -12768,6 +12768,6 @@ | |||
1396 | 12768 | 12768 | ||
1397 | 12769 | =head1 VERSION | 12769 | =head1 VERSION |
1398 | 12770 | 12770 | ||
1400 | 12771 | pt-table-sync 2.2.11 | 12771 | pt-table-sync 2.2.12 |
1401 | 12772 | 12772 | ||
1402 | 12773 | =cut | 12773 | =cut |
1403 | 12774 | 12774 | ||
1404 | === modified file 'bin/pt-table-usage' | |||
1405 | --- bin/pt-table-usage 2014-09-25 13:48:22 +0000 | |||
1406 | +++ bin/pt-table-usage 2014-11-14 14:12:25 +0000 | |||
1407 | @@ -1340,6 +1340,14 @@ | |||
1408 | 1340 | $parse = 0; | 1340 | $parse = 0; |
1409 | 1341 | next LINE; | 1341 | next LINE; |
1410 | 1342 | } | 1342 | } |
1411 | 1343 | |||
1412 | 1344 | if ( $parse | ||
1413 | 1345 | && !$self->has('version-check') | ||
1414 | 1346 | && $line =~ /version-check/ | ||
1415 | 1347 | ) { | ||
1416 | 1348 | next LINE; | ||
1417 | 1349 | } | ||
1418 | 1350 | |||
1419 | 1343 | if ( $parse | 1351 | if ( $parse |
1420 | 1344 | && (my($opt, $arg) = $line =~ m/^\s*([^=\s]+?)(?:\s*=\s*(.*?)\s*)?$/) | 1352 | && (my($opt, $arg) = $line =~ m/^\s*([^=\s]+?)(?:\s*=\s*(.*?)\s*)?$/) |
1421 | 1345 | ) { | 1353 | ) { |
1422 | @@ -7563,6 +7571,6 @@ | |||
1423 | 7563 | 7571 | ||
1424 | 7564 | =head1 VERSION | 7572 | =head1 VERSION |
1425 | 7565 | 7573 | ||
1427 | 7566 | pt-table-usage 2.2.11 | 7574 | pt-table-usage 2.2.12 |
1428 | 7567 | 7575 | ||
1429 | 7568 | =cut | 7576 | =cut |
1430 | 7569 | 7577 | ||
1431 | === modified file 'bin/pt-upgrade' | |||
1432 | --- bin/pt-upgrade 2014-09-25 13:48:22 +0000 | |||
1433 | +++ bin/pt-upgrade 2014-11-14 14:12:25 +0000 | |||
1434 | @@ -61,7 +61,7 @@ | |||
1435 | 61 | { | 61 | { |
1436 | 62 | package Percona::Toolkit; | 62 | package Percona::Toolkit; |
1437 | 63 | 63 | ||
1439 | 64 | our $VERSION = '2.2.11'; | 64 | our $VERSION = '2.2.12'; |
1440 | 65 | 65 | ||
1441 | 66 | use strict; | 66 | use strict; |
1442 | 67 | use warnings FATAL => 'all'; | 67 | use warnings FATAL => 'all'; |
1443 | @@ -2464,7 +2464,7 @@ | |||
1444 | 2464 | set => $args{set}, | 2464 | set => $args{set}, |
1445 | 2465 | NAME_lc => defined($args{NAME_lc}) ? $args{NAME_lc} : 1, | 2465 | NAME_lc => defined($args{NAME_lc}) ? $args{NAME_lc} : 1, |
1446 | 2466 | dbh_set => 0, | 2466 | dbh_set => 0, |
1448 | 2467 | ask_pass => $o->get('ask-pass'), | 2467 | ask_pass => $args{ask_pass}, |
1449 | 2468 | DSNParser => $dp, | 2468 | DSNParser => $dp, |
1450 | 2469 | is_cluster_node => undef, | 2469 | is_cluster_node => undef, |
1451 | 2470 | parent => $args{parent}, | 2470 | parent => $args{parent}, |
1452 | @@ -2475,7 +2475,7 @@ | |||
1453 | 2475 | 2475 | ||
1454 | 2476 | sub connect { | 2476 | sub connect { |
1455 | 2477 | my ( $self, %opts ) = @_; | 2477 | my ( $self, %opts ) = @_; |
1457 | 2478 | my $dsn = $self->{dsn}; | 2478 | my $dsn = $opts{dsn} || $self->{dsn}; |
1458 | 2479 | my $dp = $self->{DSNParser}; | 2479 | my $dp = $self->{DSNParser}; |
1459 | 2480 | 2480 | ||
1460 | 2481 | my $dbh = $self->{dbh}; | 2481 | my $dbh = $self->{dbh}; |
1461 | @@ -2494,6 +2494,13 @@ | |||
1462 | 2494 | } | 2494 | } |
1463 | 2495 | 2495 | ||
1464 | 2496 | $dbh = $self->set_dbh($dbh); | 2496 | $dbh = $self->set_dbh($dbh); |
1465 | 2497 | if ( $opts{dsn} ) { | ||
1466 | 2498 | $self->{dsn} = $dsn; | ||
1467 | 2499 | $self->{dsn_name} = $dp->as_string($dsn, [qw(h P S)]) | ||
1468 | 2500 | || $dp->as_string($dsn, [qw(F)]) | ||
1469 | 2501 | || ''; | ||
1470 | 2502 | |||
1471 | 2503 | } | ||
1472 | 2497 | PTDEBUG && _d($dbh, 'Connected dbh to', $self->{hostname},$self->{dsn_name}); | 2504 | PTDEBUG && _d($dbh, 'Connected dbh to', $self->{hostname},$self->{dsn_name}); |
1473 | 2498 | return $dbh; | 2505 | return $dbh; |
1474 | 2499 | } | 2506 | } |
1475 | @@ -2555,6 +2562,17 @@ | |||
1476 | 2555 | return $self->{hostname} || $self->{dsn_name} || 'unknown host'; | 2562 | return $self->{hostname} || $self->{dsn_name} || 'unknown host'; |
1477 | 2556 | } | 2563 | } |
1478 | 2557 | 2564 | ||
1479 | 2565 | sub is_cluster_node { | ||
1480 | 2566 | my ($self, $cxn) = @_; | ||
1481 | 2567 | |||
1482 | 2568 | my $sql = "SHOW VARIABLES LIKE 'wsrep\_on'"; | ||
1483 | 2569 | PTDEBUG && _d($cxn->name, $sql); | ||
1484 | 2570 | my $row = $cxn->dbh->selectrow_arrayref($sql); | ||
1485 | 2571 | PTDEBUG && _d(Dumper($row)); | ||
1486 | 2572 | return $row && $row->[1] && ($row->[1] eq 'ON' || $row->[1] eq '1') ? 1 : 0; | ||
1487 | 2573 | |||
1488 | 2574 | } | ||
1489 | 2575 | |||
1490 | 2558 | sub remove_duplicate_cxns { | 2576 | sub remove_duplicate_cxns { |
1491 | 2559 | my ($self, %args) = @_; | 2577 | my ($self, %args) = @_; |
1492 | 2560 | my @cxns = @{$args{cxns}}; | 2578 | my @cxns = @{$args{cxns}}; |
1493 | @@ -2564,7 +2582,8 @@ | |||
1494 | 2564 | 2582 | ||
1495 | 2565 | for my $cxn ( @cxns ) { | 2583 | for my $cxn ( @cxns ) { |
1496 | 2566 | my $dbh = $cxn->dbh(); | 2584 | my $dbh = $cxn->dbh(); |
1498 | 2567 | my $sql = q{SELECT @@server_id}; | 2585 | |
1499 | 2586 | my $sql = $self->is_cluster_node($cxn) ? q{SELECT @@wsrep_node_incoming_address} : q{SELECT @@server_id}; | ||
1500 | 2568 | PTDEBUG && _d($sql); | 2587 | PTDEBUG && _d($sql); |
1501 | 2569 | my ($id) = $dbh->selectrow_array($sql); | 2588 | my ($id) = $dbh->selectrow_array($sql); |
1502 | 2570 | PTDEBUG && _d('Server ID for ', $cxn->name, ': ', $id); | 2589 | PTDEBUG && _d('Server ID for ', $cxn->name, ': ', $id); |
1503 | @@ -11240,6 +11259,6 @@ | |||
1504 | 11240 | 11259 | ||
1505 | 11241 | =head1 VERSION | 11260 | =head1 VERSION |
1506 | 11242 | 11261 | ||
1508 | 11243 | pt-upgrade 2.2.11 | 11262 | pt-upgrade 2.2.12 |
1509 | 11244 | 11263 | ||
1510 | 11245 | =cut | 11264 | =cut |
1511 | 11246 | 11265 | ||
1512 | === modified file 'bin/pt-variable-advisor' | |||
1513 | --- bin/pt-variable-advisor 2014-09-25 13:48:22 +0000 | |||
1514 | +++ bin/pt-variable-advisor 2014-11-14 14:12:25 +0000 | |||
1515 | @@ -44,7 +44,7 @@ | |||
1516 | 44 | { | 44 | { |
1517 | 45 | package Percona::Toolkit; | 45 | package Percona::Toolkit; |
1518 | 46 | 46 | ||
1520 | 47 | our $VERSION = '2.2.11'; | 47 | our $VERSION = '2.2.12'; |
1521 | 48 | 48 | ||
1522 | 49 | use strict; | 49 | use strict; |
1523 | 50 | use warnings FATAL => 'all'; | 50 | use warnings FATAL => 'all'; |
1524 | @@ -6138,6 +6138,6 @@ | |||
1525 | 6138 | 6138 | ||
1526 | 6139 | =head1 VERSION | 6139 | =head1 VERSION |
1527 | 6140 | 6140 | ||
1529 | 6141 | pt-variable-advisor 2.2.11 | 6141 | pt-variable-advisor 2.2.12 |
1530 | 6142 | 6142 | ||
1531 | 6143 | =cut | 6143 | =cut |
1532 | 6144 | 6144 | ||
1533 | === modified file 'bin/pt-visual-explain' | |||
1534 | --- bin/pt-visual-explain 2014-09-25 13:48:22 +0000 | |||
1535 | +++ bin/pt-visual-explain 2014-11-14 14:12:25 +0000 | |||
1536 | @@ -1577,6 +1577,14 @@ | |||
1537 | 1577 | $parse = 0; | 1577 | $parse = 0; |
1538 | 1578 | next LINE; | 1578 | next LINE; |
1539 | 1579 | } | 1579 | } |
1540 | 1580 | |||
1541 | 1581 | if ( $parse | ||
1542 | 1582 | && !$self->has('version-check') | ||
1543 | 1583 | && $line =~ /version-check/ | ||
1544 | 1584 | ) { | ||
1545 | 1585 | next LINE; | ||
1546 | 1586 | } | ||
1547 | 1587 | |||
1548 | 1580 | if ( $parse | 1588 | if ( $parse |
1549 | 1581 | && (my($opt, $arg) = $line =~ m/^\s*([^=\s]+?)(?:\s*=\s*(.*?)\s*)?$/) | 1589 | && (my($opt, $arg) = $line =~ m/^\s*([^=\s]+?)(?:\s*=\s*(.*?)\s*)?$/) |
1550 | 1582 | ) { | 1590 | ) { |
1551 | @@ -3243,6 +3251,6 @@ | |||
1552 | 3243 | 3251 | ||
1553 | 3244 | =head1 VERSION | 3252 | =head1 VERSION |
1554 | 3245 | 3253 | ||
1556 | 3246 | pt-visual-explain 2.2.11 | 3254 | pt-visual-explain 2.2.12 |
1557 | 3247 | 3255 | ||
1558 | 3248 | =cut | 3256 | =cut |
1559 | 3249 | 3257 | ||
1560 | === modified file 'config/deb/changelog' | |||
1561 | --- config/deb/changelog 2014-09-25 13:48:22 +0000 | |||
1562 | +++ config/deb/changelog 2014-11-14 14:12:25 +0000 | |||
1563 | @@ -1,3 +1,16 @@ | |||
1564 | 1 | percona-toolkit (2.2.12) unstable; urgency=low | ||
1565 | 2 | |||
1566 | 3 | * Fixed bug 1376561: pt-archiver is not able to archive all the rows when a table has a hash partition | ||
1567 | 4 | * Fixed bug 1328686: pt-heartbeat check-read-only option does not prevent creates or inserts | ||
1568 | 5 | * Fixed bug 1269695: pt-online-schema-change does not allow ALTER for a table without a non-unique, while manual does not explain this | ||
1569 | 6 | * Fixed bug 1217466: pt-table-checksum refuses to run on PXC if server_id is the same on all nodes | ||
1570 | 7 | * Fixed bug 1373937: pt-table-checksum requires recursion when working with and XtraDB Cluster node | ||
1571 | 8 | * Fixed bug 1377888: pt-query-digest manual for --type binlog is ambiguous | ||
1572 | 9 | * Fixed bug 1349086: pt-stalk should also gather dmesg output | ||
1573 | 10 | * Fixed bug 1361293: Some scripts fail when no-version-check option is put in global config file | ||
1574 | 11 | |||
1575 | 12 | -- Percona Toolkit Developers <toolkit-dev@percona.com> Tue, 11 Nov 2014 13:02:51 +0000 | ||
1576 | 13 | |||
1577 | 1 | percona-toolkit (2.2.11) unstable; urgency=low | 14 | percona-toolkit (2.2.11) unstable; urgency=low |
1578 | 2 | 15 | ||
1579 | 3 | * Fixed bug 1262456: pt-query-digest doesn't report host details | 16 | * Fixed bug 1262456: pt-query-digest doesn't report host details |
1580 | 4 | 17 | ||
1581 | === modified file 'config/sphinx-build/conf.py' | |||
1582 | --- config/sphinx-build/conf.py 2014-09-25 13:48:22 +0000 | |||
1583 | +++ config/sphinx-build/conf.py 2014-11-14 14:12:25 +0000 | |||
1584 | @@ -50,7 +50,7 @@ | |||
1585 | 50 | # The short X.Y version. | 50 | # The short X.Y version. |
1586 | 51 | version = '2.2' | 51 | version = '2.2' |
1587 | 52 | # The full version, including alpha/beta/rc tags. | 52 | # The full version, including alpha/beta/rc tags. |
1589 | 53 | release = '2.2.11' | 53 | release = '2.2.12' |
1590 | 54 | 54 | ||
1591 | 55 | # The language for content autogenerated by Sphinx. Refer to documentation | 55 | # The language for content autogenerated by Sphinx. Refer to documentation |
1592 | 56 | # for a list of supported languages. | 56 | # for a list of supported languages. |
1593 | 57 | 57 | ||
1594 | === modified file 'docs/percona-toolkit.pod' | |||
1595 | --- docs/percona-toolkit.pod 2014-09-25 13:48:22 +0000 | |||
1596 | +++ docs/percona-toolkit.pod 2014-11-14 14:12:25 +0000 | |||
1597 | @@ -557,6 +557,6 @@ | |||
1598 | 557 | 557 | ||
1599 | 558 | =head1 VERSION | 558 | =head1 VERSION |
1600 | 559 | 559 | ||
1602 | 560 | Percona Toolkit v2.2.11 released 2014-09-25 | 560 | Percona Toolkit v2.2.12 released 2014-11-11 |
1603 | 561 | 561 | ||
1604 | 562 | =cut | 562 | =cut |
1605 | 563 | 563 | ||
1606 | === modified file 'docs/release_notes.rst' | |||
1607 | --- docs/release_notes.rst 2014-09-25 13:48:22 +0000 | |||
1608 | +++ docs/release_notes.rst 2014-11-14 14:12:25 +0000 | |||
1609 | @@ -1,6 +1,41 @@ | |||
1610 | 1 | Release Notes | 1 | Release Notes |
1611 | 2 | ************* | 2 | ************* |
1612 | 3 | 3 | ||
1613 | 4 | v2.2.12 released 2014-11-14 | ||
1614 | 5 | =========================== | ||
1615 | 6 | |||
1616 | 7 | Percona Toolkit 2.2.12 has been released. This release contains one new feature and seven bug fixes. | ||
1617 | 8 | |||
1618 | 9 | New Features: | ||
1619 | 10 | |||
1620 | 11 | * pt-stalk now gathers ``dmesg`` output from up to 60 seconds before the triggering event. | ||
1621 | 12 | |||
1622 | 13 | Bugs Fixed: | ||
1623 | 14 | |||
1624 | 15 | * Fixed bug 1376561: pt-archiver was not able to archive all the rows when a table had a hash partition. Fixed by implementing support for tables which have primary or unique indexes. | ||
1625 | 16 | |||
1626 | 17 | * Fixed bug 1217466: pt-table-checksum would refuses to run on Percona XtraDB Cluster if ``server_id`` was the same on all nodes. Fixed by using the ``wsrep_node_incoming_address`` as a unique identifier for cluster nodes, instead of relying on ``server_id``. | ||
1627 | 18 | |||
1628 | 19 | * Fixed bug 1269695: pt-online-schema-change documentation now contains more information about limitations on why it isn't running ``ALTER TABLE`` for a table which has only a non-unique index. | ||
1629 | 20 | |||
1630 | 21 | * Fixed bug 1328686: Running pt-hearbeat with --check-read-only option would cause an error when running on server with ``read_only`` option. Tool now waits for server ``read_only`` status to be disabled before starting to run. | ||
1631 | 22 | |||
1632 | 23 | * Fixed bug 1373937: pt-table-checksum now supports ``none`` as valid ``--recursion-method`` when using with Percona XtraDB Cluster. | ||
1633 | 24 | |||
1634 | 25 | * Fixed bug 1377888: Documentation was stating that pt-query-digest is able to parse a raw binary log file, while it can only parse a file which was decoded with ``mysqlbinlog`` tool before. Fixed by improving the documentation and adding a check for binary file and providing a relevant error message. | ||
1635 | 26 | |||
1636 | 27 | Changelog | ||
1637 | 28 | --------- | ||
1638 | 29 | |||
1639 | 30 | * Fixed bug 1376561: pt-archiver is not able to archive all the rows when a table has a hash partition | ||
1640 | 31 | * Fixed bug 1328686: pt-heartbeat check-read-only option does not prevent creates or inserts | ||
1641 | 32 | * Fixed bug 1269695: pt-online-schema-change does not allow ALTER for a table without a non-unique, while manual does not explain this | ||
1642 | 33 | * Fixed bug 1217466: pt-table-checksum refuses to run on PXC if server_id is the same on all nodes | ||
1643 | 34 | * Fixed bug 1373937: pt-table-checksum requires recursion when working with and XtraDB Cluster node | ||
1644 | 35 | * Fixed bug 1377888: pt-query-digest manual for --type binlog is ambiguous | ||
1645 | 36 | * Fixed bug 1349086: pt-stalk should also gather dmesg output | ||
1646 | 37 | * Fixed bug 1361293: Some scripts fail when no-version-check option is put in global config file | ||
1647 | 38 | |||
1648 | 4 | v2.2.11 released 2014-09-26 | 39 | v2.2.11 released 2014-09-26 |
1649 | 5 | =========================== | 40 | =========================== |
1650 | 6 | 41 | ||
1651 | 7 | 42 | ||
1652 | === modified file 'lib/Cxn.pm' | |||
1653 | --- lib/Cxn.pm 2013-12-05 00:14:17 +0000 | |||
1654 | +++ lib/Cxn.pm 2014-11-14 14:12:25 +0000 | |||
1655 | @@ -226,6 +226,19 @@ | |||
1656 | 226 | return $self->{hostname} || $self->{dsn_name} || 'unknown host'; | 226 | return $self->{hostname} || $self->{dsn_name} || 'unknown host'; |
1657 | 227 | } | 227 | } |
1658 | 228 | 228 | ||
1659 | 229 | # This is used to help remove_duplicate_cxns detect cluster nodes | ||
1660 | 230 | # (which often have unreliable server_id's) | ||
1661 | 231 | sub is_cluster_node { | ||
1662 | 232 | my ($self, $cxn) = @_; | ||
1663 | 233 | |||
1664 | 234 | my $sql = "SHOW VARIABLES LIKE 'wsrep\_on'"; | ||
1665 | 235 | PTDEBUG && _d($cxn->name, $sql); | ||
1666 | 236 | my $row = $cxn->dbh->selectrow_arrayref($sql); | ||
1667 | 237 | PTDEBUG && _d(Dumper($row)); | ||
1668 | 238 | return $row && $row->[1] && ($row->[1] eq 'ON' || $row->[1] eq '1') ? 1 : 0; | ||
1669 | 239 | |||
1670 | 240 | } | ||
1671 | 241 | |||
1672 | 229 | # There's two reasons why there might be dupes: | 242 | # There's two reasons why there might be dupes: |
1673 | 230 | # If the "master" is a cluster node, then a DSN table might have been | 243 | # If the "master" is a cluster node, then a DSN table might have been |
1674 | 231 | # used, and it may have all nodes' DSNs so the user can run the tool | 244 | # used, and it may have all nodes' DSNs so the user can run the tool |
1675 | @@ -233,7 +246,7 @@ | |||
1676 | 233 | # on the command line. | 246 | # on the command line. |
1677 | 234 | # On the other hand, maybe find_cluster_nodes worked, in which case | 247 | # On the other hand, maybe find_cluster_nodes worked, in which case |
1678 | 235 | # we definitely have a dupe for the master cxn, but we may also have a | 248 | # we definitely have a dupe for the master cxn, but we may also have a |
1680 | 236 | # dupe for every other node if this was unsed in conjunction with a | 249 | # dupe for every other node if this was used in conjunction with a |
1681 | 237 | # DSN table. | 250 | # DSN table. |
1682 | 238 | # So try to detect and remove those. | 251 | # So try to detect and remove those. |
1683 | 239 | sub remove_duplicate_cxns { | 252 | sub remove_duplicate_cxns { |
1684 | @@ -245,7 +258,11 @@ | |||
1685 | 245 | 258 | ||
1686 | 246 | for my $cxn ( @cxns ) { | 259 | for my $cxn ( @cxns ) { |
1687 | 247 | my $dbh = $cxn->dbh(); | 260 | my $dbh = $cxn->dbh(); |
1689 | 248 | my $sql = q{SELECT @@server_id}; | 261 | |
1690 | 262 | # Very often cluster nodes are configured with matching server_id's | ||
1691 | 263 | # So in that case we'll use its incoming address as its unique identifier | ||
1692 | 264 | # Note: this relies on "seen_ids" being populated using the same strategy | ||
1693 | 265 | my $sql = $self->is_cluster_node($cxn) ? q{SELECT @@wsrep_node_incoming_address} : q{SELECT @@server_id}; | ||
1694 | 249 | PTDEBUG && _d($sql); | 266 | PTDEBUG && _d($sql); |
1695 | 250 | my ($id) = $dbh->selectrow_array($sql); | 267 | my ($id) = $dbh->selectrow_array($sql); |
1696 | 251 | PTDEBUG && _d('Server ID for ', $cxn->name, ': ', $id); | 268 | PTDEBUG && _d('Server ID for ', $cxn->name, ': ', $id); |
1697 | 252 | 269 | ||
1698 | === modified file 'lib/OptionParser.pm' | |||
1699 | --- lib/OptionParser.pm 2014-05-24 21:36:33 +0000 | |||
1700 | +++ lib/OptionParser.pm 2014-11-14 14:12:25 +0000 | |||
1701 | @@ -1132,6 +1132,16 @@ | |||
1702 | 1132 | $parse = 0; | 1132 | $parse = 0; |
1703 | 1133 | next LINE; | 1133 | next LINE; |
1704 | 1134 | } | 1134 | } |
1705 | 1135 | |||
1706 | 1136 | # Silently ignore option [no]-version-check if it is unsupported and it comes from a config file | ||
1707 | 1137 | # TODO: Ideally , this should be generalized for all unsupported options that come from global files | ||
1708 | 1138 | if ( $parse | ||
1709 | 1139 | && !$self->has('version-check') | ||
1710 | 1140 | && $line =~ /version-check/ | ||
1711 | 1141 | ) { | ||
1712 | 1142 | next LINE; | ||
1713 | 1143 | } | ||
1714 | 1144 | |||
1715 | 1135 | if ( $parse | 1145 | if ( $parse |
1716 | 1136 | && (my($opt, $arg) = $line =~ m/^\s*([^=\s]+?)(?:\s*=\s*(.*?)\s*)?$/) | 1146 | && (my($opt, $arg) = $line =~ m/^\s*([^=\s]+?)(?:\s*=\s*(.*?)\s*)?$/) |
1717 | 1137 | ) { | 1147 | ) { |
1718 | 1138 | 1148 | ||
1719 | === modified file 'lib/Percona/Toolkit.pm' | |||
1720 | --- lib/Percona/Toolkit.pm 2014-09-24 15:06:32 +0000 | |||
1721 | +++ lib/Percona/Toolkit.pm 2014-11-14 14:12:25 +0000 | |||
1722 | @@ -18,7 +18,7 @@ | |||
1723 | 18 | # ########################################################################### | 18 | # ########################################################################### |
1724 | 19 | package Percona::Toolkit; | 19 | package Percona::Toolkit; |
1725 | 20 | 20 | ||
1727 | 21 | our $VERSION = '2.2.11'; | 21 | our $VERSION = '2.2.12'; |
1728 | 22 | 22 | ||
1729 | 23 | use strict; | 23 | use strict; |
1730 | 24 | use warnings FATAL => 'all'; | 24 | use warnings FATAL => 'all'; |
1731 | 25 | 25 | ||
1732 | === modified file 'lib/Percona/XtraDB/Cluster.pm' | |||
1733 | --- lib/Percona/XtraDB/Cluster.pm 2013-04-16 20:40:32 +0000 | |||
1734 | +++ lib/Percona/XtraDB/Cluster.pm 2014-11-14 14:12:25 +0000 | |||
1735 | @@ -132,8 +132,29 @@ | |||
1736 | 132 | sub remove_duplicate_cxns { | 132 | sub remove_duplicate_cxns { |
1737 | 133 | my ($self, %args) = @_; | 133 | my ($self, %args) = @_; |
1738 | 134 | my @cxns = @{$args{cxns}}; | 134 | my @cxns = @{$args{cxns}}; |
1741 | 135 | my $seen_ids = $args{seen_ids}; | 135 | my $seen_ids = $args{seen_ids} || {}; |
1742 | 136 | return Cxn->remove_duplicate_cxns(%args); | 136 | PTDEBUG && _d("Removing duplicates nodes from ", join(" ", map { $_->name } @cxns)); |
1743 | 137 | my @trimmed_cxns; | ||
1744 | 138 | |||
1745 | 139 | for my $cxn ( @cxns ) { | ||
1746 | 140 | my $dbh = $cxn->dbh(); | ||
1747 | 141 | # Very often cluster nodes are configured with matching server_id's | ||
1748 | 142 | # So in that case we'll use its incoming address as its unique identifier | ||
1749 | 143 | # Note: This relies on "seen_ids" being populated using the same strategy | ||
1750 | 144 | my $sql = $self->is_cluster_node($cxn) ? q{SELECT @@wsrep_node_incoming_address} : q{SELECT @@server_id}; | ||
1751 | 145 | PTDEBUG && _d($sql); | ||
1752 | 146 | my ($id) = $dbh->selectrow_array($sql); | ||
1753 | 147 | PTDEBUG && _d('Server ID for ', $cxn->name, ': ', $id); | ||
1754 | 148 | |||
1755 | 149 | if ( ! $seen_ids->{$id}++ ) { | ||
1756 | 150 | push @trimmed_cxns, $cxn | ||
1757 | 151 | } | ||
1758 | 152 | else { | ||
1759 | 153 | PTDEBUG && _d("Removing ", $cxn->name, | ||
1760 | 154 | ", ID ", $id, ", because we've already seen it"); | ||
1761 | 155 | } | ||
1762 | 156 | } | ||
1763 | 157 | return \@trimmed_cxns; | ||
1764 | 137 | } | 158 | } |
1765 | 138 | 159 | ||
1766 | 139 | sub same_cluster { | 160 | sub same_cluster { |
1767 | 140 | 161 | ||
1768 | === modified file 'lib/bash/collect.sh' | |||
1769 | --- lib/bash/collect.sh 2013-12-14 04:19:51 +0000 | |||
1770 | +++ lib/bash/collect.sh 2014-11-14 14:12:25 +0000 | |||
1771 | @@ -40,6 +40,7 @@ | |||
1772 | 40 | CMD_SYSCTL="${CMD_SYSCTL:-"$(_which sysctl)"}" | 40 | CMD_SYSCTL="${CMD_SYSCTL:-"$(_which sysctl)"}" |
1773 | 41 | CMD_TCPDUMP="${CMD_TCPDUMP:-"$(_which tcpdump)"}" | 41 | CMD_TCPDUMP="${CMD_TCPDUMP:-"$(_which tcpdump)"}" |
1774 | 42 | CMD_VMSTAT="${CMD_VMSTAT:-"$(_which vmstat)"}" | 42 | CMD_VMSTAT="${CMD_VMSTAT:-"$(_which vmstat)"}" |
1775 | 43 | CMD_DMESG="${CMD_DMESG:-"$(_which dmesg)"}" | ||
1776 | 43 | 44 | ||
1777 | 44 | # Try to find command manually. | 45 | # Try to find command manually. |
1778 | 45 | [ -z "$CMD_SYSCTL" -a -x "/sbin/sysctl" ] && CMD_SYSCTL="/sbin/sysctl" | 46 | [ -z "$CMD_SYSCTL" -a -x "/sbin/sysctl" ] && CMD_SYSCTL="/sbin/sysctl" |
1779 | @@ -146,6 +147,14 @@ | |||
1780 | 146 | if [ "$CMD_SYSCTL" ]; then | 147 | if [ "$CMD_SYSCTL" ]; then |
1781 | 147 | $CMD_SYSCTL -a >> "$d/$p-sysctl" & | 148 | $CMD_SYSCTL -a >> "$d/$p-sysctl" & |
1782 | 148 | fi | 149 | fi |
1783 | 150 | |||
1784 | 151 | # collect dmesg events from 60 seconds ago until present | ||
1785 | 152 | if [ "$CMD_DMESG" ]; then | ||
1786 | 153 | local UPTIME=`cat /proc/uptime | awk '{ print $1 }'` | ||
1787 | 154 | local START_TIME=$(echo "$UPTIME 60" | awk '{print ($1 - $2)}') | ||
1788 | 155 | $CMD_DMESG | perl -ne 'm/\[\s*(\d+)\./; if ($1 > '${START_TIME}') { print }' >> "$d/$p-dmesg" & | ||
1789 | 156 | fi | ||
1790 | 157 | |||
1791 | 149 | local cnt=$(($OPT_RUN_TIME / $OPT_SLEEP_COLLECT)) | 158 | local cnt=$(($OPT_RUN_TIME / $OPT_SLEEP_COLLECT)) |
1792 | 150 | if [ "$CMD_VMSTAT" ]; then | 159 | if [ "$CMD_VMSTAT" ]; then |
1793 | 151 | $CMD_VMSTAT $OPT_SLEEP_COLLECT $cnt >> "$d/$p-vmstat" & | 160 | $CMD_VMSTAT $OPT_SLEEP_COLLECT $cnt >> "$d/$p-vmstat" & |
1794 | 152 | 161 | ||
1795 | === modified file 'lib/bash/parse_options.sh' | |||
1796 | --- lib/bash/parse_options.sh 2014-07-10 20:15:13 +0000 | |||
1797 | +++ lib/bash/parse_options.sh 2014-11-14 14:12:25 +0000 | |||
1798 | @@ -347,6 +347,9 @@ | |||
1799 | 347 | # Skip blank lines. | 347 | # Skip blank lines. |
1800 | 348 | [ "$config_opt" = "" ] && continue | 348 | [ "$config_opt" = "" ] && continue |
1801 | 349 | 349 | ||
1802 | 350 | # Skip global option [no]version-check which don't apply | ||
1803 | 351 | echo "$config_opt" | grep -v 'version-check' >/dev/null 2>&1 || continue | ||
1804 | 352 | |||
1805 | 350 | # Options in a config file are not prefixed with --, | 353 | # Options in a config file are not prefixed with --, |
1806 | 351 | # but command line options are, so one or the other has | 354 | # but command line options are, so one or the other has |
1807 | 352 | # to add or remove the -- prefix. We add it for config | 355 | # to add or remove the -- prefix. We add it for config |
1808 | 353 | 356 | ||
1809 | === modified file 't/lib/OptionParser.t' | |||
1810 | --- t/lib/OptionParser.t 2014-05-24 21:36:33 +0000 | |||
1811 | +++ t/lib/OptionParser.t 2014-11-14 14:12:25 +0000 | |||
1812 | @@ -2141,6 +2141,29 @@ | |||
1813 | 2141 | 'prompt_no_echo outputs prompt to STDERR' | 2141 | 'prompt_no_echo outputs prompt to STDERR' |
1814 | 2142 | ); | 2142 | ); |
1815 | 2143 | 2143 | ||
1816 | 2144 | # ############################################################################# | ||
1817 | 2145 | # Issue 1361293: Global config file with no-version-check option makes tools | ||
1818 | 2146 | # that don't recognize the option fail. | ||
1819 | 2147 | # ############################################################################# | ||
1820 | 2148 | diag(`echo "no-version-check" > ~/.OptionParser.t.conf`); | ||
1821 | 2149 | $o = new OptionParser( | ||
1822 | 2150 | description => 'OptionParser.t parses command line options.', | ||
1823 | 2151 | usage => "$PROGRAM_NAME <options>" | ||
1824 | 2152 | ); | ||
1825 | 2153 | $o->get_specs("$trunk/bin/pt-slave-find"), # doesn't have version-check option | ||
1826 | 2154 | $output = output( | ||
1827 | 2155 | sub { | ||
1828 | 2156 | $o->get_opts(); | ||
1829 | 2157 | }, | ||
1830 | 2158 | stderr=>1 | ||
1831 | 2159 | ); | ||
1832 | 2160 | unlike( | ||
1833 | 2161 | $output, | ||
1834 | 2162 | qr/Unknown option: no-version-check/, | ||
1835 | 2163 | 'no-version-check ignored if unsupported and in config file. issue 1361293' | ||
1836 | 2164 | ); | ||
1837 | 2165 | diag(`rm -rf ~/.OptionParser.t.conf`); | ||
1838 | 2166 | |||
1839 | 2144 | 2167 | ||
1840 | 2145 | 2168 | ||
1841 | 2146 | # ############################################################################# | 2169 | # ############################################################################# |
1842 | 2147 | 2170 | ||
1843 | === added file 't/lib/samples/binlogs/raw_binlog.log' | |||
1844 | 2148 | Binary files t/lib/samples/binlogs/raw_binlog.log 1970-01-01 00:00:00 +0000 and t/lib/samples/binlogs/raw_binlog.log 2014-11-14 14:12:25 +0000 differ | 2171 | Binary files t/lib/samples/binlogs/raw_binlog.log 1970-01-01 00:00:00 +0000 and t/lib/samples/binlogs/raw_binlog.log 2014-11-14 14:12:25 +0000 differ |
1845 | === modified file 't/pt-archiver/basics.t' | |||
1846 | --- t/pt-archiver/basics.t 2012-11-21 16:21:30 +0000 | |||
1847 | +++ t/pt-archiver/basics.t 2014-11-14 14:12:25 +0000 | |||
1848 | @@ -161,7 +161,7 @@ | |||
1849 | 161 | my $t = time - $t0; | 161 | my $t = time - $t0; |
1850 | 162 | 162 | ||
1851 | 163 | ok( | 163 | ok( |
1853 | 164 | $t >= 2 && $t <= 3.5, | 164 | $t >= 2 && $t <= ($ENV{PERCONA_SLOW_BOX} ? 5 : 3), |
1854 | 165 | "--sleep between SELECT (bug 979092)" | 165 | "--sleep between SELECT (bug 979092)" |
1855 | 166 | ) or diag($output, "t=", $t); | 166 | ) or diag($output, "t=", $t); |
1856 | 167 | 167 | ||
1857 | 168 | 168 | ||
1858 | === modified file 't/pt-archiver/indexes.t' | |||
1859 | --- t/pt-archiver/indexes.t 2012-06-03 17:54:32 +0000 | |||
1860 | +++ t/pt-archiver/indexes.t 2014-11-14 14:12:25 +0000 | |||
1861 | @@ -97,7 +97,7 @@ | |||
1862 | 97 | 97 | ||
1863 | 98 | # Check ascending only first column | 98 | # Check ascending only first column |
1864 | 99 | $output = `$cmd --where 1=1 --dry-run --ascend-first --source D=test,t=table_5,F=$cnf --purge --limit 50 2>&1`; | 99 | $output = `$cmd --where 1=1 --dry-run --ascend-first --source D=test,t=table_5,F=$cnf --purge --limit 50 2>&1`; |
1866 | 100 | like ( $output, qr/WHERE \(1=1\) AND \(\(`a` >= \?\)\) LIMIT/, 'Can ascend just first column'); | 100 | like ( $output, qr/WHERE \(1=1\) AND \(\(`a` >= \?\)\) ORDER BY `a`,`b`,`c`,`d` LIMIT/, 'Can ascend just first column'); |
1867 | 101 | 101 | ||
1868 | 102 | # ############################################################################# | 102 | # ############################################################################# |
1869 | 103 | # Done. | 103 | # Done. |
1870 | 104 | 104 | ||
1871 | === modified file 't/pt-archiver/samples/issue-248.txt' | |||
1872 | --- t/pt-archiver/samples/issue-248.txt 2011-06-24 22:02:05 +0000 | |||
1873 | +++ t/pt-archiver/samples/issue-248.txt 2014-11-14 14:12:25 +0000 | |||
1874 | @@ -1,3 +1,3 @@ | |||
1877 | 1 | SELECT /*!40001 SQL_NO_CACHE */ `film_id`,`title`,`description`,`release_year`,`language_id`,`original_language_id`,`rental_duration`,`rental_rate`,`length`,`replacement_cost`,`rating`,`special_features`,`last_update` FROM `sakila`.`film` FORCE INDEX(`PRIMARY`) WHERE (film_id < 100) AND (`film_id` < '1000') LIMIT 1 | 1 | SELECT /*!40001 SQL_NO_CACHE */ `film_id`,`title`,`description`,`release_year`,`language_id`,`original_language_id`,`rental_duration`,`rental_rate`,`length`,`replacement_cost`,`rating`,`special_features`,`last_update` FROM `sakila`.`film` FORCE INDEX(`PRIMARY`) WHERE (film_id < 100) AND (`film_id` < '1000') ORDER BY `film_id` LIMIT 1 |
1878 | 2 | SELECT /*!40001 SQL_NO_CACHE */ `film_id`,`title`,`description`,`release_year`,`language_id`,`original_language_id`,`rental_duration`,`rental_rate`,`length`,`replacement_cost`,`rating`,`special_features`,`last_update` FROM `sakila`.`film` FORCE INDEX(`PRIMARY`) WHERE (film_id < 100) AND (`film_id` < '1000') AND ((`film_id` >= ?)) LIMIT 1 | 2 | SELECT /*!40001 SQL_NO_CACHE */ `film_id`,`title`,`description`,`release_year`,`language_id`,`original_language_id`,`rental_duration`,`rental_rate`,`length`,`replacement_cost`,`rating`,`special_features`,`last_update` FROM `sakila`.`film` FORCE INDEX(`PRIMARY`) WHERE (film_id < 100) AND (`film_id` < '1000') AND ((`film_id` >= ?)) ORDER BY `film_id` LIMIT 1 |
1879 | 3 | DELETE FROM `sakila`.`film` WHERE (`film_id` = ?) | 3 | DELETE FROM `sakila`.`film` WHERE (`film_id` = ?) |
1880 | 4 | 4 | ||
1881 | === modified file 't/pt-query-digest/binlog_analyses.t' | |||
1882 | --- t/pt-query-digest/binlog_analyses.t 2014-07-02 20:55:31 +0000 | |||
1883 | +++ t/pt-query-digest/binlog_analyses.t 2014-11-14 14:12:25 +0000 | |||
1884 | @@ -9,7 +9,7 @@ | |||
1885 | 9 | use strict; | 9 | use strict; |
1886 | 10 | use warnings FATAL => 'all'; | 10 | use warnings FATAL => 'all'; |
1887 | 11 | use English qw(-no_match_vars); | 11 | use English qw(-no_match_vars); |
1889 | 12 | use Test::More tests => 3; | 12 | use Test::More tests => 4; |
1890 | 13 | 13 | ||
1891 | 14 | use PerconaTest; | 14 | use PerconaTest; |
1892 | 15 | require "$trunk/bin/pt-query-digest"; | 15 | require "$trunk/bin/pt-query-digest"; |
1893 | @@ -46,6 +46,26 @@ | |||
1894 | 46 | 'Analysis for binlog011 - Handles 5.6 binlog with checksum CRC32', | 46 | 'Analysis for binlog011 - Handles 5.6 binlog with checksum CRC32', |
1895 | 47 | ) or diag($test_diff); | 47 | ) or diag($test_diff); |
1896 | 48 | 48 | ||
1897 | 49 | |||
1898 | 50 | |||
1899 | 51 | # ############################################################################# | ||
1900 | 52 | # Issue 1377888: refuse to parse raw binary log | ||
1901 | 53 | # ############################################################################# | ||
1902 | 54 | |||
1903 | 55 | my $output = output( | ||
1904 | 56 | sub { pt_query_digest::main(@args, "$trunk/t/lib/samples/binlogs/raw_binlog.log") }, | ||
1905 | 57 | stderr => 1 | ||
1906 | 58 | ); | ||
1907 | 59 | |||
1908 | 60 | like( | ||
1909 | 61 | $output, | ||
1910 | 62 | qr/mysqlbinlog/i, | ||
1911 | 63 | 'Refuses to parse raw binlog file' | ||
1912 | 64 | ); | ||
1913 | 65 | |||
1914 | 66 | |||
1915 | 67 | |||
1916 | 68 | |||
1917 | 49 | # ############################################################################# | 69 | # ############################################################################# |
1918 | 50 | # Done. | 70 | # Done. |
1919 | 51 | # ############################################################################# | 71 | # ############################################################################# |
1920 | 52 | 72 | ||
1921 | === modified file 't/pt-table-checksum/pxc.t' | |||
1922 | --- t/pt-table-checksum/pxc.t 2013-04-12 15:58:10 +0000 | |||
1923 | +++ t/pt-table-checksum/pxc.t 2014-11-14 14:12:25 +0000 | |||
1924 | @@ -81,6 +81,17 @@ | |||
1925 | 81 | "Dies if no other nodes are found" | 81 | "Dies if no other nodes are found" |
1926 | 82 | ); | 82 | ); |
1927 | 83 | 83 | ||
1928 | 84 | |||
1929 | 85 | ($output, $exit_status) = full_output( | ||
1930 | 86 | sub { pt_table_checksum::main(@args, '--recursion-method', 'none') }, | ||
1931 | 87 | stderr => 1, | ||
1932 | 88 | ); | ||
1933 | 89 | |||
1934 | 90 | ok ( | ||
1935 | 91 | $output =~ qr/WARNING/i && !$exit_status, | ||
1936 | 92 | "Warns but doesn't die if --recursion-method=none - issue #1373937" | ||
1937 | 93 | ); | ||
1938 | 94 | |||
1939 | 84 | for my $args ( | 95 | for my $args ( |
1940 | 85 | ["using recusion-method=dsn", '--recursion-method', "dsn=$node1_dsn,D=dsns,t=dsns"], | 96 | ["using recusion-method=dsn", '--recursion-method', "dsn=$node1_dsn,D=dsns,t=dsns"], |
1941 | 86 | ["using recursion-method=cluster", '--recursion-method', 'cluster'] | 97 | ["using recursion-method=cluster", '--recursion-method', 'cluster'] |
1942 | @@ -144,54 +155,89 @@ | |||
1943 | 144 | "Node3 not changed" | 155 | "Node3 not changed" |
1944 | 145 | ); | 156 | ); |
1945 | 146 | 157 | ||
1992 | 147 | for my $args ( | 158 | sub test_recursion_methods { |
1993 | 148 | ["using recusion-method=dsn", '--recursion-method', "dsn=$node1_dsn,D=dsns,t=dsns"], | 159 | my $same_ids = shift; |
1994 | 149 | ["using recursion-method=cluster", '--recursion-method', 'cluster'] | 160 | |
1995 | 150 | ) | 161 | my ($orig_id_1, $orig_id_2, $orig_id_3); |
1996 | 151 | { | 162 | |
1997 | 152 | my $test = shift @$args; | 163 | if ($same_ids) { |
1998 | 153 | 164 | # save original values | |
1999 | 154 | $output = output( | 165 | my $sql = 'SELECT @@server_id'; |
2000 | 155 | sub { pt_table_checksum::main(@args, | 166 | ($orig_id_1) = $node1->selectrow_array($sql); |
2001 | 156 | @$args) | 167 | ($orig_id_2) = $node2->selectrow_array($sql); |
2002 | 157 | }, | 168 | ($orig_id_3) = $node3->selectrow_array($sql); |
2003 | 158 | stderr => 1, | 169 | # set server_id value to 1 on all nodes |
2004 | 159 | ); | 170 | $sql = 'SET GLOBAL server_id = 1'; |
2005 | 160 | 171 | $node1->do($sql); | |
2006 | 161 | is( | 172 | $node2->do($sql); |
2007 | 162 | PerconaTest::count_checksum_results($output, 'errors'), | 173 | $node3->do($sql); |
2008 | 163 | 0, | 174 | } |
2009 | 164 | "1 diff: no errors ($test)" | 175 | |
2010 | 165 | ); | 176 | for my $args ( |
2011 | 166 | 177 | ["using recusion-method=dsn", '--recursion-method', "dsn=$node1_dsn,D=dsns,t=dsns"], | |
2012 | 167 | is( | 178 | ["using recursion-method=cluster", '--recursion-method', 'cluster'] |
2013 | 168 | PerconaTest::count_checksum_results($output, 'skipped'), | 179 | ) |
2014 | 169 | 0, | 180 | { |
2015 | 170 | "1 diff: no skips ($test)" | 181 | my $test = shift @$args; |
2016 | 171 | ); | 182 | $test = $same_ids ? $test.' - Nodes with different ids' : $test.' - Nodes with same ids'; |
2017 | 172 | 183 | ||
2018 | 173 | is( | 184 | $output = output( |
2019 | 174 | PerconaTest::count_checksum_results($output, 'diffs'), | 185 | sub { pt_table_checksum::main(@args, |
2020 | 175 | 1, | 186 | @$args) |
2021 | 176 | "1 diff: 1 diff ($test)" | 187 | }, |
2022 | 177 | ) or diag($output); | 188 | stderr => 1, |
2023 | 178 | 189 | ); | |
2024 | 179 | # 11-17T13:02:54 0 1 26 1 0 0.021 test.t | 190 | |
2025 | 180 | like( | 191 | is( |
2026 | 181 | $output, | 192 | PerconaTest::count_checksum_results($output, 'errors'), |
2027 | 182 | qr/^\S+\s+ # ts | 193 | 0, |
2028 | 183 | 0\s+ # errors | 194 | "1 diff: no errors ($test)" |
2029 | 184 | 1\s+ # diffs | 195 | ); |
2030 | 185 | 26\s+ # rows | 196 | |
2031 | 186 | \d+\s+ # chunks | 197 | is( |
2032 | 187 | 0\s+ # skipped | 198 | PerconaTest::count_checksum_results($output, 'skipped'), |
2033 | 188 | \S+\s+ # time | 199 | 0, |
2034 | 189 | test.t$ # table | 200 | "1 diff: no skips ($test)" |
2035 | 190 | /xm, | 201 | ); |
2036 | 191 | "1 diff: it's in test.t ($test)" | 202 | |
2037 | 192 | ); | 203 | is( |
2038 | 204 | PerconaTest::count_checksum_results($output, 'diffs'), | ||
2039 | 205 | 1, | ||
2040 | 206 | "1 diff: 1 diff ($test)" | ||
2041 | 207 | ) or diag($output); | ||
2042 | 208 | |||
2043 | 209 | # 11-17T13:02:54 0 1 26 1 0 0.021 test.t | ||
2044 | 210 | like( | ||
2045 | 211 | $output, | ||
2046 | 212 | qr/^\S+\s+ # ts | ||
2047 | 213 | 0\s+ # errors | ||
2048 | 214 | 1\s+ # diffs | ||
2049 | 215 | 26\s+ # rows | ||
2050 | 216 | \d+\s+ # chunks | ||
2051 | 217 | 0\s+ # skipped | ||
2052 | 218 | \S+\s+ # time | ||
2053 | 219 | test.t$ # table | ||
2054 | 220 | /xm, | ||
2055 | 221 | "1 diff: it's in test.t ($test)" | ||
2056 | 222 | ); | ||
2057 | 223 | } | ||
2058 | 224 | |||
2059 | 225 | if ($same_ids) { | ||
2060 | 226 | # reset server_id's to original values | ||
2061 | 227 | $node1->do("SET GLOBAL server_id = $orig_id_1"); | ||
2062 | 228 | $node2->do("SET GLOBAL server_id = $orig_id_2"); | ||
2063 | 229 | $node3->do("SET GLOBAL server_id = $orig_id_3"); | ||
2064 | 230 | } | ||
2065 | 231 | |||
2066 | 193 | } | 232 | } |
2067 | 194 | 233 | ||
2068 | 234 | # test recursion methods | ||
2069 | 235 | test_recursion_methods(0); | ||
2070 | 236 | |||
2071 | 237 | # test recursion methods when all nodes have the same id | ||
2072 | 238 | test_recursion_methods(1); | ||
2073 | 239 | |||
2074 | 240 | |||
2075 | 195 | # ############################################################################# | 241 | # ############################################################################# |
2076 | 196 | # cluster, node1 -> slave, run on node1 | 242 | # cluster, node1 -> slave, run on node1 |
2077 | 197 | # ############################################################################# | 243 | # ############################################################################# |
2078 | @@ -232,7 +278,7 @@ | |||
2079 | 232 | # Wait for the slave to apply the binlogs from node1 (its master). | 278 | # Wait for the slave to apply the binlogs from node1 (its master). |
2080 | 233 | # Then change it so it's not consistent. | 279 | # Then change it so it's not consistent. |
2081 | 234 | PerconaTest::wait_for_table($slave_dbh, 'test.t'); | 280 | PerconaTest::wait_for_table($slave_dbh, 'test.t'); |
2083 | 235 | $sb->wait_for_slaves('cslave1'); | 281 | $sb->wait_for_slaves(master => 'node1', slave => 'cslave1'); |
2084 | 236 | $slave_dbh->do("update test.t set c='zebra' where c='z'"); | 282 | $slave_dbh->do("update test.t set c='zebra' where c='z'"); |
2085 | 237 | 283 | ||
2086 | 238 | $output = output( | 284 | $output = output( |