Is it feasible to ignore if the table exists on the slave and still check for slave lag? The workaround is recursion-method=none but slave will lag since it's no longer checked.
Based on the code, it looks like if the tool detects if slave(s) exist, it will check if the created table is on the slave:
if ( $slaves && scalar @$slaves ) {
foreach my $slave (@$slaves) {
my ($pr, $pr_first_report);
if ( $o->get('progress') ) {
$pr = new Progress( jobsize => scalar @$slaves,
spec => $o->get('progress'),
name => "Waiting for " . $slave->name(),
); $pr_first_report = sub { print "Waiting forever for new table $new_tbl->{name} to replicate "
. "to " . $slave->name() . "...\n";
};
} $pr->start() if $pr;
my $has_table = 0;
while ( !$has_table ) { $has_table = $tp->check_table(
dbh => $slave->dbh(),
db => $new_tbl->{db},
tbl => $new_tbl->{tbl}
);
last if $has_table; $pr->update(
sub { return 0; }, first_report => $pr_first_report,
) if $pr;
sleep 1;
}
}
}
But when checking for replication lag it only checks "Seconds behind master".
sub get_slave_lag {
my ( $self, $dbh ) = @_;
my $stat = $self->get_slave_status($dbh);
return unless $stat; # server is not a slave
return $stat->{seconds_behind_master};
}
So, is it possible to just ignore if the table exists on the slave or is this difficult to fix?
Carlos,
Is it feasible to ignore if the table exists on the slave and still check for slave lag? The workaround is recursion- method= none but slave will lag since it's no longer checked.
Based on the code, it looks like if the tool detects if slave(s) exist, it will check if the created table is on the slave:
if ( $slaves && scalar @$slaves ) {
jobsize => scalar @$slaves, 'progress' ),
$pr_ first_report = sub {
print "Waiting forever for new table $new_tbl->{name} to replicate "
$pr-> start() if $pr;
$has_ table = $tp->check_table(
$pr- >update(
first_ report => $pr_first_report,
foreach my $slave (@$slaves) {
my ($pr, $pr_first_report);
if ( $o->get('progress') ) {
$pr = new Progress(
spec => $o->get(
name => "Waiting for " . $slave->name(),
);
. "to " . $slave->name() . "...\n";
};
}
my $has_table = 0;
while ( !$has_table ) {
dbh => $slave->dbh(),
db => $new_tbl->{db},
tbl => $new_tbl->{tbl}
);
last if $has_table;
sub { return 0; },
) if $pr;
sleep 1;
}
}
}
But when checking for replication lag it only checks "Seconds behind master".
sub get_slave_lag { get_slave_ status( $dbh); {seconds_ behind_ master} ;
my ( $self, $dbh ) = @_;
my $stat = $self->
return unless $stat; # server is not a slave
return $stat->
}
So, is it possible to just ignore if the table exists on the slave or is this difficult to fix?