MXS-1444: Add monitor parameter alteration

The parameter handling for monitors can now be done in a consistent manner
by establishing a rule that the monitor owns the parameter object as long
as it is running. This will allow parameters to be added and removed
safely both from outside and inside monitors.

Currently this functionality is only used by mysqlmon to disable failover
after an attempt to perform a failover has failed.
This commit is contained in:
Markus Mäkelä
2017-10-02 14:14:54 +03:00
parent 267a45ad63
commit 7ca8db14de
3 changed files with 54 additions and 4 deletions

View File

@ -1878,6 +1878,8 @@ monitorMain(void *arg)
MXS_ALERT("Failed to perform failover, disabling failover functionality. "
"To enable failover functionality, manually set 'failover' to "
"'true' for monitor '%s' via MaxAdmin or the REST API.", mon->name);
mon_alter_parameter(handle->monitor, CN_FAILOVER, "false");
handle->failover = false;
}
}