Fix low disk space maintenance
The setting didn't work because the code updated a status flag which would be overwritten before being read. Also, promotion code now checks that the server is not in maintenance.
This commit is contained in:
@ -1121,9 +1121,8 @@ bool MariaDBServer::can_be_demoted_failover(string* reason_out)
|
||||
return demotable;
|
||||
}
|
||||
|
||||
bool MariaDBServer::can_be_promoted(OperationType op,
|
||||
const MariaDBServer* demotion_target,
|
||||
std::string* reason_out)
|
||||
bool MariaDBServer::can_be_promoted(OperationType op, const MariaDBServer* demotion_target,
|
||||
string* reason_out)
|
||||
{
|
||||
bool promotable = false;
|
||||
string reason;
|
||||
@ -1134,6 +1133,10 @@ bool MariaDBServer::can_be_promoted(OperationType op,
|
||||
{
|
||||
reason = "it is already the master.";
|
||||
}
|
||||
else if (!is_usable())
|
||||
{
|
||||
reason = "it is down or in maintenance.";
|
||||
}
|
||||
else if (sstatus == NULL)
|
||||
{
|
||||
reason = string_printf("it is not replicating from '%s'.", demotion_target->name());
|
||||
|
Reference in New Issue
Block a user