diff --git a/bin/pt-online-schema-change b/bin/pt-online-schema-change index 1726541b..8ff14b98 100755 --- a/bin/pt-online-schema-change +++ b/bin/pt-online-schema-change @@ -11934,6 +11934,13 @@ ignored. You can change the list of hosts while OSC is executing: if you change the contents of the DSN table, OSC will pick it up very soon. +=item --skip-check-slave-lag + +type: DSN; repeatable: yes + +DSN to skip when checking slave lag. It can be used multiple times. +Example: --skip-check-slave-lag h=127.1,P=12345 --skip-check-slave-lag h=127.1,P=12346 + =item --slave-user type: string diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index dd075730..338c1bee 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -9707,14 +9707,6 @@ sub main { } } - if ( $slave_lag_cxns && scalar @$slave_lag_cxns ) { - for my $slave (@$slave_lag_cxns) { - printf("Checking lag on %s -> %s:%s\n", $slave->name(), $slave->{dsn}->{h}, $slave->{dsn}->{P}); - } - } else { - print "Not checking slave lag because no slaves were found or they were set to be skipped\n"; - } - # ##################################################################### # Possibly check replication slaves and exit. # ##################################################################### diff --git a/t/pt-online-schema-change/bugs.t b/t/pt-online-schema-change/bugs.t index 5f93d6d6..df7d68a2 100644 --- a/t/pt-online-schema-change/bugs.t +++ b/t/pt-online-schema-change/bugs.t @@ -603,6 +603,26 @@ is( $master_dbh->do("DROP DATABASE IF EXISTS test"); +# Use the same data than the previous test +$master_dbh->do("DROP DATABASE IF EXISTS test"); + +$sb->load_file('master', "$sample/bug-1613915.sql"); +$output = output( + sub { pt_online_schema_change::main(@args, "$master_dsn,D=test,t=o1", + '--execute', + '--alter', "ADD COLUMN c INT", + '--chunk-size', '10', + '--skip-check-slave-lag', "h=127.0.0.1,P=".$sb->port_for('slave1'), + ), + }, +); + +$output = output( + sub { pt_table_checksum::main(@args, + '--skip-check-slave-lag', "h=127.0.0.1,P=".$sb->port_for('slave1'), + ), + }, +); # ############################################################################# # Done. # ############################################################################# diff --git a/t/pt-table-checksum/basics.t b/t/pt-table-checksum/basics.t index 788fcc08..0af7483c 100644 --- a/t/pt-table-checksum/basics.t +++ b/t/pt-table-checksum/basics.t @@ -59,7 +59,6 @@ sub reset_repl_db { $master_dbh->do("use $repl_db"); } - # ############################################################################ # Default checksum and results. The tool does not technically require any # options on well-configured systems (which the test env cannot be). With diff --git a/t/pt-table-checksum/bugs.t b/t/pt-table-checksum/bugs.t index ac489006..43778079 100644 --- a/t/pt-table-checksum/bugs.t +++ b/t/pt-table-checksum/bugs.t @@ -184,9 +184,9 @@ $output = output( chomp($output); -like( +is( $output, - qr/Checking lag on h=127.0.0.1,P=12346 -> 127.0.0.1:12346/, + '', "Bug 1074179: ignore-tables-regex works with --replicate-check-only" ); # ############################################################################# diff --git a/t/pt-table-checksum/resume.t b/t/pt-table-checksum/resume.t index 7ab947c3..d45c286e 100644 --- a/t/pt-table-checksum/resume.t +++ b/t/pt-table-checksum/resume.t @@ -100,7 +100,7 @@ $output = output( is( $output, - "", + '', "Resume with nothing to do" ); @@ -267,13 +267,13 @@ is_deeply( like( $first_tbl, qr/sakila.payment$/, - "Resumed from sakila.payment" + "Resuming from sakila.payment" ); like( $output, - qr/^Resuming from sakila.payment chunk 7, timestamp 2011-10-15 13:00:28\n/, - "Resumed from sakila.payment chunk 7" + qr/^Resuming from sakila.payment chunk 7, timestamp 2011-10-15 13:00:28/s, + "Resuming from sakila.payment chunk 7" ); is( @@ -564,7 +564,7 @@ $output = output( (undef, undef, $first_tbl) = split /\n/, $output; like( $first_tbl, - qr/test.t1$/, + qr/test.t1/, "Resumed from test.t1" ); @@ -622,7 +622,7 @@ $output = output( (undef, undef, $first_tbl) = split /\n/, $output; like( $first_tbl, - qr/test.t1$/, + qr/test.t1/, "Resumed from test.t1" );