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

Failover might not work when Master_Log_File changed #143

Open
hydeperion opened this issue Sep 11, 2020 · 0 comments
Open

Failover might not work when Master_Log_File changed #143

hydeperion opened this issue Sep 11, 2020 · 0 comments

Comments

@hydeperion
Copy link

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.
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

No branches or pull requests

1 participant