mha4mysql-manager icon indicating copy to clipboard operation
mha4mysql-manager copied to clipboard

Failover might not work when Master_Log_File changed

Open hydeperion opened this issue 4 years ago • 0 comments

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.

  • MHA log
Mon Sep  7 11:40:32 2020 - [warning]  Slave ???????????(???.??.???.??:????) SQL Thread delays too much. 
  Latest log file:binarylog.000169:3532034, 
 Current log file:binarylog.000168:5175698.           <-- the difference is about 10.5MB
This server is not selected as a new master because recovery will take long time.
 .
 .
Mon Sep  7 11:40:32 2020 - [error][/usr/local/share/perl5/MHA/MasterFailover.pm, ln794] None of existing slaves matches as a new master. Maybe preferred node is misconfigured or all slaves are too behind.
 .
 .
Started automated(non-interactive) failover.
None of existing slaves matches as a new master. Maybe preferred node is misconfigured or all slaves are too behind.
Got Error so couldn't continue failover from here.

hydeperion avatar Sep 11 '20 09:09 hydeperion