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

Failover might not work when Master_Log_File changed #143

Open hydeperion opened 3 years ago

hydeperion commented 3 years ago

According to the manual, if a slave behinds master more than 100MB of relay logs, MHA does not choice the slave as a new master. https://github.com/yoshinorim/mha4mysql-manager/wiki/Parameters#check_repl_delay

I think it is implemented in here. https://github.com/yoshinorim/mha4mysql-manager/blob/master/lib/MHA/ServerManager.pm#L1122

However, if only "Master_Log_File" is being read a new file at the time of failover, MHA may not choice the slave as a new master even if the delay of Relay_Master_Log_File is less than 100MB.

I’ve done a test under the following conditions.

# to do test easily

# in MySQL master conf
max_binlog_size = 12M

# in MHA conf
ping_interval=1

Then the following log was output, and failover did not work.