Merge lp:~percona-toolkit-dev/percona-toolkit/fix-pt-osc-find-new-table-bug-1195628 into lp:~percona-toolkit-dev/percona-toolkit/release-2.2.6

Proposed by Daniel Nichter
Status: Merged
Approved by: Daniel Nichter
Approved revision: 594
Merged at revision: 598
Proposed branch: lp:~percona-toolkit-dev/percona-toolkit/fix-pt-osc-find-new-table-bug-1195628
Merge into: lp:~percona-toolkit-dev/percona-toolkit/release-2.2.6
Diff against target: 151 lines (+63/-13)
5 files modified
bin/pt-online-schema-change (+55/-9)
t/pt-online-schema-change/ansi_quotes.t (+1/-1)
t/pt-online-schema-change/basics.t (+3/-1)
t/pt-online-schema-change/charset.t (+2/-2)
t/pt-online-schema-change/samples/stats-execute-5.5.txt (+2/-0)
To merge this branch: bzr merge lp:~percona-toolkit-dev/percona-toolkit/fix-pt-osc-find-new-table-bug-1195628
Reviewer Review Type Date Requested Status
Daniel Nichter Approve
Review via email: mp+196802@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Daniel Nichter (daniel-nichter) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/pt-online-schema-change'
--- bin/pt-online-schema-change 2013-11-08 01:47:46 +0000
+++ bin/pt-online-schema-change 2013-11-27 00:28:21 +0000
@@ -8031,8 +8031,22 @@
8031 },8031 },
8032 );8032 );
8033 PTDEBUG && _d(scalar @$slaves, 'slaves found');8033 PTDEBUG && _d(scalar @$slaves, 'slaves found');
8034 if ( scalar @$slaves ) {
8035 print "Found " . scalar(@$slaves) . " slaves:\n";
8036 foreach my $cxn ( @$slaves ) {
8037 print " " . $cxn->name() . "\n";
8038 }
8039 }
8040 elsif ( ($o->get('recursion-method') || '') ne 'none') {
8041 print "No slaves found. See --recursion-method if host "
8042 . $cxn->name() . " has slaves.\n";
8043 }
8044 else {
8045 print "Ignoring all slaves because --recursion-method=none "
8046 . "was specified\n";
8047 }
80348048
8035 if ( $o->get('check-slave-lag') ) {8049 if ( my $dsn = $o->get('check-slave-lag') ) {
8036 PTDEBUG && _d('Will use --check-slave-lag to check for slave lag');8050 PTDEBUG && _d('Will use --check-slave-lag to check for slave lag');
8037 my $cxn = $make_cxn->(8051 my $cxn = $make_cxn->(
8038 dsn_string => $o->get('check-slave-lag'),8052 dsn_string => $o->get('check-slave-lag'),
@@ -8044,6 +8058,16 @@
8044 PTDEBUG && _d('Will check slave lag on all slaves');8058 PTDEBUG && _d('Will check slave lag on all slaves');
8045 $slave_lag_cxns = $slaves;8059 $slave_lag_cxns = $slaves;
8046 }8060 }
8061 if ( $slave_lag_cxns && scalar @$slave_lag_cxns ) {
8062 print "Will check slave lag on:\n";
8063 foreach my $cxn ( @$slave_lag_cxns ) {
8064 print " " . $cxn->name() . "\n";
8065 }
8066 }
8067 else {
8068 print "Not checking slave lag because no slaves were found "
8069 . "and --check-slave-lag was not specified.\n";
8070 }
80478071
8048 # #####################################################################8072 # #####################################################################
8049 # Check for replication filters.8073 # Check for replication filters.
@@ -8513,14 +8537,36 @@
8513 }8537 }
8514 };8538 };
85158539
8516 for my $slave (@$slaves) {8540 if ( $slaves && scalar @$slaves ) {
8517 PTDEBUG && _d('Waiting until', $slave->name(),8541 foreach my $slave (@$slaves) {
8518 'replicates the table');8542 my ($pr, $pr_first_report);
8519 sleep 0.5 while ! $tp->check_table(8543 if ( $o->get('progress') ) {
8520 dbh => $slave->dbh(),8544 $pr = new Progress(
8521 db => $new_tbl->{db},8545 jobsize => scalar @$slaves,
8522 tbl => $new_tbl->{tbl}8546 spec => $o->get('progress'),
8523 );8547 name => "Waiting for " . $slave->name(),
8548 );
8549 $pr_first_report = sub {
8550 print "Waiting forever for new table $new_tbl->{name} to replicate "
8551 . "to " . $slave->name() . "...\n";
8552 };
8553 }
8554 $pr->start() if $pr;
8555 my $has_table = 0;
8556 while ( !$has_table ) {
8557 $has_table = $tp->check_table(
8558 dbh => $slave->dbh(),
8559 db => $new_tbl->{db},
8560 tbl => $new_tbl->{tbl}
8561 );
8562 last if $has_table;
8563 $pr->update(
8564 sub { return 0; },
8565 first_report => $pr_first_report,
8566 ) if $pr;
8567 sleep 1;
8568 }
8569 }
8524 }8570 }
85258571
8526 # --plugin hook8572 # --plugin hook
85278573
=== modified file 't/pt-online-schema-change/ansi_quotes.t'
--- t/pt-online-schema-change/ansi_quotes.t 2013-03-02 17:17:23 +0000
+++ t/pt-online-schema-change/ansi_quotes.t 2013-11-27 00:28:21 +0000
@@ -61,7 +61,7 @@
61 $exit_status,61 $exit_status,
62 0,62 0,
63 "--dry-run exit 0 (bug 1058285)"63 "--dry-run exit 0 (bug 1058285)"
64);64) or diag($output);
6565
66unlike(66unlike(
67 $output,67 $output,
6868
=== modified file 't/pt-online-schema-change/basics.t'
--- t/pt-online-schema-change/basics.t 2013-10-10 02:13:49 +0000
+++ t/pt-online-schema-change/basics.t 2013-11-27 00:28:21 +0000
@@ -13,6 +13,7 @@
13use Time::HiRes qw(sleep);13use Time::HiRes qw(sleep);
1414
15$ENV{PTTEST_FAKE_TS} = 1;15$ENV{PTTEST_FAKE_TS} = 1;
16$ENV{PERCONA_TOOLKIT_TEST_USE_DSN_NAMES} = 1;
1617
17use PerconaTest;18use PerconaTest;
18use Sandbox;19use Sandbox;
@@ -704,7 +705,8 @@
704 no_diff(705 no_diff(
705 sub { pt_online_schema_change::main(@args, "$dsn,D=bug_1045317,t=bits",706 sub { pt_online_schema_change::main(@args, "$dsn,D=bug_1045317,t=bits",
706 '--execute', '--statistics',707 '--execute', '--statistics',
707 '--alter', "modify column val ENUM('M','E','H') NOT NULL")708 '--alter', "modify column val ENUM('M','E','H') NOT NULL",
709 '--recursion-method', 'none')
708 },710 },
709 ($sandbox_version ge '5.5' && $db_flavor !~ m/XtraDB Cluster/711 ($sandbox_version ge '5.5' && $db_flavor !~ m/XtraDB Cluster/
710 ? "$sample/stats-execute-5.5.txt"712 ? "$sample/stats-execute-5.5.txt"
711713
=== modified file 't/pt-online-schema-change/charset.t'
--- t/pt-online-schema-change/charset.t 2013-06-26 17:47:19 +0000
+++ t/pt-online-schema-change/charset.t 2013-11-27 00:28:21 +0000
@@ -56,10 +56,10 @@
56my @create = split("\n\n", $output);56my @create = split("\n\n", $output);
5757
58like(58like(
59 $create[1],59 $create[1] || '',
60 qr/DEFAULT CHARSET=utf8/,60 qr/DEFAULT CHARSET=utf8/,
61 "Can alter charset of new table"61 "Can alter charset of new table"
62);62) or diag($output);
6363
64# #############################################################################64# #############################################################################
65# Done.65# Done.
6666
=== modified file 't/pt-online-schema-change/samples/stats-execute-5.5.txt'
--- t/pt-online-schema-change/samples/stats-execute-5.5.txt 2013-06-25 19:52:03 +0000
+++ t/pt-online-schema-change/samples/stats-execute-5.5.txt 2013-11-27 00:28:21 +0000
@@ -1,3 +1,5 @@
1No slaves found. See --recursion-method if host h=127.1,P=12345 has slaves.
2Not checking slave lag because no slaves were found and --check-slave-lag was not specified.
1Operation, tries, wait:3Operation, tries, wait:
2 copy_rows, 10, 0.254 copy_rows, 10, 0.25
3 create_triggers, 10, 15 create_triggers, 10, 1

Subscribers

People subscribed via source and target branches

to all changes: