Merge lp:~percona-toolkit-dev/percona-toolkit/pt-table-checksum-requires-recursion-when-working-with-XtraDB-Cluster-node-1373937 into lp:~percona-toolkit-dev/percona-toolkit/release-2.2.12

Proposed by Frank Cizmich
Status: Merged
Merged at revision: 632
Proposed branch: lp:~percona-toolkit-dev/percona-toolkit/pt-table-checksum-requires-recursion-when-working-with-XtraDB-Cluster-node-1373937
Merge into: lp:~percona-toolkit-dev/percona-toolkit/release-2.2.12
Diff against target: 66 lines (+24/-7)
2 files modified
bin/pt-table-checksum (+12/-6)
t/pt-table-checksum/pxc.t (+12/-1)
To merge this branch: bzr merge lp:~percona-toolkit-dev/percona-toolkit/pt-table-checksum-requires-recursion-when-working-with-XtraDB-Cluster-node-1373937
Reviewer Review Type Date Requested Status
Daniel Nichter Needs Fixing
Review via email: mp+238014@code.launchpad.net

Description of the change

Now accepts --recurse-method=none on PXC , for when a user wants to checksum only one server for special purposes
(see https://bugs.launchpad.net/percona-toolkit/+bug/1373937 )

New behavior: Issues a warning but runs anyway.

Updated Docs

Created Test

To post a comment you must log in.
Revision history for this message
Daniel Nichter (daniel-nichter) :
review: Needs Fixing
630. By Frank Cizmich

removed warning. changed Doc

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/pt-table-checksum'
2--- bin/pt-table-checksum 2014-09-25 13:48:22 +0000
3+++ bin/pt-table-checksum 2014-11-05 19:37:33 +0000
4@@ -9363,9 +9363,11 @@
5
6 if ( $cluster_name_for{$master_cxn} ) {
7 if ( !@$slaves ) {
8- die $master_cxn->name() . " is a cluster node but no other nodes "
9- . "or regular replicas were found. Use --recursion-method=dsn "
10- . "to specify the other nodes in the cluster.\n";
11+ if ( ($o->get('recursion-method')->[0] || '') ne 'none' ) {
12+ die $master_cxn->name() . " is a cluster node but no other nodes "
13+ . "or regular replicas were found. Use --recursion-method=dsn "
14+ . "to specify the other nodes in the cluster.\n";
15+ }
16 }
17
18 # Make sure the master and all node are in the same cluster.
19@@ -12240,9 +12242,13 @@
20 The C<dsn> column contains a replica DSN like it would be given on the command
21 line, for example: C<"h=replica_host,u=repl_user,p=repl_pass">.
22
23-The C<none> method prevents the tool from connecting to any replicas.
24-This effectively disables all the L<"REPLICA CHECKS"> because there will
25-not be any replicas to check. Therefore, this method is not recommended.
26+The C<none> method makes the tool ignore all slaves and cluster nodes. This
27+method is not recommended because it effectively disables the
28+L<"REPLICA CHECKS"> and no differences can be found. It is useful, however, if
29+you only need to write checksums on the master or a single cluster node. The
30+safer alternative is C<--no-replicate-check>: the tool finds replicas and
31+cluster nodes, performs the L<"REPLICA CHECKS">, but does not check for
32+differences. See L<"--[no]replicate-check">.
33
34 =item --replicate
35
36
37=== modified file 't/pt-table-checksum/pxc.t'
38--- t/pt-table-checksum/pxc.t 2013-04-12 15:58:10 +0000
39+++ t/pt-table-checksum/pxc.t 2014-11-05 19:37:33 +0000
40@@ -81,6 +81,17 @@
41 "Dies if no other nodes are found"
42 );
43
44+
45+($output, $exit_status) = full_output(
46+ sub { pt_table_checksum::main(@args, '--recursion-method', 'none') },
47+ stderr => 1,
48+);
49+
50+ok (
51+ $output =~ qr/WARNING/i && !$exit_status,
52+ "Warns but doesn't die if --recursion-method=none - issue #1373937"
53+);
54+
55 for my $args (
56 ["using recusion-method=dsn", '--recursion-method', "dsn=$node1_dsn,D=dsns,t=dsns"],
57 ["using recursion-method=cluster", '--recursion-method', 'cluster']
58@@ -232,7 +243,7 @@
59 # Wait for the slave to apply the binlogs from node1 (its master).
60 # Then change it so it's not consistent.
61 PerconaTest::wait_for_table($slave_dbh, 'test.t');
62- $sb->wait_for_slaves('cslave1');
63+ $sb->wait_for_slaves(master => 'node1', slave => 'cslave1');
64 $slave_dbh->do("update test.t set c='zebra' where c='z'");
65
66 $output = output(

Subscribers

People subscribed via source and target branches

to all changes: