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

Conversation

okumin
Copy link

@okumin okumin commented May 26, 2016

masterha_check_repl has not worked
when replication filters are given to only tailing servers,
like test cases added to tests/t/t_filter_incorrect.sh.

This is because perl evaluates the empty string as false and
unless block is executed despite another server has a configuration
to declare that it never filters.

For example, there are three slaves and
only last server has a filtering setting for replicate_do_db,
masterha_check_repl succeeds like the followings.

  1. the first slave does not filter and current replicate_do_db is undefined
    • replicate_do_db is set to $_->{Replicate_Do_DB}(empty string) and
    • replicate_do_db ne $_->{Replicate_Do_DB} is false
  2. the second slave does not filter and current replicate_do_db is ""
    • replicate_do_db is set to $_->{Replicate_Do_DB}(empty string) and
    • replicate_do_db ne $_->{Replicate_Do_DB} is false
  3. the third slave filters and current replicate_do_db is ""
    • replicate_do_db is set to $_->{Replicate_Do_DB}(some db) and
    • replicate_do_db ne $_->{Replicate_Do_DB} is false

`masterha_check_repl` has not worked
when replication filters are given to only tailing servers,
like test cases added to tests/t/t_filter_incorrect.sh.

This is because perl evaluates the empty string as `false` and
`unless` block is executed despite another server has a configuration
to declare that it never filters.

For example, there are three slaves and
only last server has a filtering setting for replicate_do_db,
`masterha_check_repl` succeeds like the followings.

1. the first slave does not filter and current replicate_do_db is undefined
    * replicate_do_db is set to $_->{Replicate_Do_DB}(empty string) and
    * replicate_do_db ne $_->{Replicate_Do_DB} is false
2. the second slave does not filter and current replicate_do_db is ""
    * replicate_do_db is set to $_->{Replicate_Do_DB}(empty string) and
    * replicate_do_db ne $_->{Replicate_Do_DB} is false
3. the third slave filters and current replicate_do_db is ""
    * replicate_do_db is set to $_->{Replicate_Do_DB}(some db) and
    * replicate_do_db ne $_->{Replicate_Do_DB} is false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant