yoshinorim / mha4mysql-manager

Development tree of Master High Availability Manager and tools for MySQL (MHA), Manager part
http://code.google.com/p/mysql-master-ha/
GNU General Public License v2.0
1.46k stars 501 forks source link

Fix masterha_check_repl #66

Open okumin opened 8 years ago

okumin commented 8 years ago

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_dodb is set to $->{Replicate_Do_DB}(empty string) and
    • replicate_dodb ne $->{Replicate_Do_DB} is false
  2. the second slave does not filter and current replicate_do_db is ""
    • replicate_dodb is set to $->{Replicate_Do_DB}(empty string) and
    • replicate_dodb ne $->{Replicate_Do_DB} is false
  3. the third slave filters and current replicate_do_db is ""
    • replicate_dodb is set to $->{Replicate_Do_DB}(some db) and
    • replicate_dodb ne $->{Replicate_Do_DB} is false