MXS-2169 Allow unsafe failover when 'enforce_simple_topology' is on

If gtid of master is unknown (as is typical when master is down when MaxScale
starts) the domain id is guessed from the slaves instead. This is usually
safe.
This commit is contained in:
Esa Korhonen
2019-05-14 13:48:31 +03:00
parent 0f714e9ad4
commit 650230455a
6 changed files with 153 additions and 44 deletions

View File

@ -314,14 +314,19 @@ public:
*/
bool can_be_demoted_switchover(std::string* reason_out);
enum class FailoverType
{
SAFE,
RISKY
};
/**
* Check if the server can be demoted by failover.
*
* @param operation Switchover or failover
* @param failover_mode Is failover with guessed gtid domain allowed
* @param reason_out Output explaining why server cannot be demoted
* @return True if server can be demoted
*/
bool can_be_demoted_failover(std::string* reason_out);
bool can_be_demoted_failover(FailoverType failover_mode, std::string* reason_out);
/**
* Check if the server can be promoted by switchover or failover.