Moved the slave replication wait to execute earlier

This commit is contained in:
Brian Fraser fraserb@gmail.com
2012-06-06 13:28:59 -03:00
parent 4d2560c24c
commit 02eb9b7a0a

View File

@@ -5546,6 +5546,20 @@ sub main {
}
};
for my $slave (@$slaves) {
PTDEBUG && _d('Waiting until', $slave->name(),
'replicates the table');
my $slave_has_repl_table;
do {
$slave_has_repl_table = $tp->check_table(
dbh => $slave->dbh(),
db => $new_tbl->{db},
tbl => $new_tbl->{tbl},
);
sleep 0.5 unless $slave_has_repl_table;
} while ( !$slave_has_repl_table );
}
# #####################################################################
# Step 2: Alter the new, empty table. This should be very quick,
# or die if the user specified a bad alter statement.
@@ -5680,18 +5694,6 @@ sub main {
PTDEBUG && _d('Getting table row estimate on replicas');
my @too_large;
foreach my $slave ( @$slaves ) {
PTDEBUG && _d('Waiting until', $slave->name(),
'replicates the table');
my $slave_has_repl_table;
do {
sleep 0.5;
$slave_has_repl_table = $tp->check_table(
dbh => $slave->dbh(),
db => $tbl->{db},
tbl => $tbl->{tbl}
);
} while ( !$slave_has_repl_table );
my ($n_rows) = NibbleIterator::get_row_estimate(
Cxn => $slave,
tbl => $tbl,