mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-04-01 02:00:14 +08:00
Moved the slave replication wait to execute earlier
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user