pt-osc chunk-size-limit=0 skips tables - lp1441928

This commit is contained in:
frank-cizmich
2015-08-07 16:58:20 -03:00
parent 66c74af47b
commit c6432f21ef
2 changed files with 20 additions and 1 deletions

View File

@@ -9068,7 +9068,7 @@ sub main {
tbl => $tbl,
);
PTDEBUG && _d('Table on',$slave->name(),'has', $n_rows, 'rows');
if ( $n_rows && $n_rows > ($tbl->{chunk_size} * $limit) ) {
if ( $limit && $n_rows && $n_rows > ($tbl->{chunk_size} * $limit) ) {
PTDEBUG && _d('Table too large on', $slave->name());
push @too_large, [$slave->name(), $n_rows || 0];
}

View File

@@ -715,6 +715,25 @@ ok(
"--statistics --execute"
) or diag($test_diff);
# #############################################################################
# --chunk-size-limit=0 must not skip tables that would be chunked
# in one nibble
# https://bugs.launchpad.net/percona-toolkit/+bug/1441928
# #############################################################################
($output, $exit) = full_output(
sub { pt_online_schema_change::main(@args,
"$dsn,D=sakila,t=actor", qw(--chunk-size-limit 0 --alter-foreign-keys-method drop_swap --execute --alter ENGINE=InnoDB)) },
stderr => 1,
);
like(
$output,
qr/Successfully altered/i,
"--chunk-size-limit=0 doesn't skip tables - lp1441928"
);
# #############################################################################
# --default-engine
# #############################################################################