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

Add option for ignoring "no_master" setting when manually failover #123

Closed NickNYU closed 1 year ago

NickNYU commented 5 years ago

Abstract

Lightly changes are made to provider an optional "force-switch" when manually failover the Mysql cluster.

Reason

The decision would be taken for some scenarios as below:

  1. I have auto-failover running as well as I want to manually switch the master by some time. And I'd like it to be a "forced-switch" rather than following the original configuration.
  2. Even if the delay is high, "no_master" is made by MHA manager itself(as the new_master I pointed to, might be a "oldest server"), I would have the opportunity to ignore it, as long as the "recover_new_master" works.

Changes

  1. An option input for ignoring the "no_master" keyword, so that my target new master is always guaranteed to be chosen for a new epoch
  2. Additional global variable "new_master_ignore_no_master" will have effect on the decider whether "candidate is bad or not"
  3. A field and "Set" method is added to "ServerManager.pm"