Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix masterha_check_repl #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions lib/MHA/ServerManager.pm
Original file line number Diff line number Diff line change
Expand Up @@ -407,19 +407,19 @@ sub validate_repl_filter($$) {
my $replicate_wild_do_table;
my $replicate_wild_ignore_table;
foreach (@slaves) {
$replicate_do_db = $_->{Replicate_Do_DB} unless ($replicate_do_db);
$replicate_do_db = $_->{Replicate_Do_DB} unless (defined($replicate_do_db));
$replicate_ignore_db = $_->{Replicate_Ignore_DB}
unless ($replicate_ignore_db);
$replicate_do_table = $_->{Replicate_Do_Table} unless ($replicate_do_table);
unless (defined($replicate_ignore_db));
$replicate_do_table = $_->{Replicate_Do_Table} unless (defined($replicate_do_table));
$replicate_ignore_table = $_->{Replicate_Ignore_Table}
unless ($replicate_ignore_table);
unless (defined($replicate_ignore_table));
$replicate_wild_do_table = $_->{Replicate_Wild_Do_Table}
unless ($replicate_wild_do_table);
unless (defined($replicate_wild_do_table));
$replicate_wild_ignore_table = $_->{Replicate_Wild_Ignore_Table}
unless ($replicate_wild_ignore_table);
unless (defined($replicate_wild_ignore_table));
if ( $_->{log_bin} ) {
$binlog_do_db = $_->{Binlog_Do_DB} unless ($binlog_do_db);
$binlog_ignore_db = $_->{Binlog_Ignore_DB} unless ($binlog_ignore_db);
$binlog_do_db = $_->{Binlog_Do_DB} unless (defined($binlog_do_db));
$binlog_ignore_db = $_->{Binlog_Ignore_DB} unless (defined($binlog_ignore_db));
}
if ( $replicate_do_db ne $_->{Replicate_Do_DB}
|| $replicate_ignore_db ne $_->{Replicate_Ignore_DB}
Expand Down
18 changes: 18 additions & 0 deletions tests/t/t_filter_incorrect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,24 @@ fail_if_zero $0 $?
./run.sh
fail_if_zero $0 $?

./stop_s1.sh
./start_s1.sh

./stop_s4.sh
./start_s4.sh --binlog-do-db=aaa
masterha_check_repl --conf=$CONF > /dev/null 2>&1
fail_if_zero $0 $?

./run.sh
fail_if_zero $0 $?

./stop_s4.sh
./start_s4.sh --replicate-ignore-db=aaa
masterha_check_repl --conf=$CONF > /dev/null 2>&1
fail_if_zero $0 $?

./run.sh
fail_if_zero $0 $?

echo "$0 [Pass]"