MXS-2314 Monitor decides whether servers are added to services

When the servers of a service are defined by a monitor, then
at startup all servers of the monitor should be added to relevant
services. Likewise, when a server is added to or removed from a
monitor at runtime, those changes should affect services as well.

However, whether that should happen or not depends upon the monitor.
In the case of the Clustrix monitor this should not happen as it
adds and removes servers depending on the runtime state of the
Clustrix cluster.
This commit is contained in:
Johan Wikman
2019-02-08 12:29:59 +02:00
parent ab93216064
commit cac1d76e48
7 changed files with 165 additions and 48 deletions

View File

@ -112,6 +112,16 @@ public:
* @brief Populate services with the servers of the monitors.
*/
static void populate_services();
static bool add_server(Monitor* mon, SERVER* server)
{
return Monitor::add_server(mon, server);
}
static void remove_server(Monitor* mon, SERVER* server)
{
Monitor::remove_server(mon, server);
}
};
@ -139,9 +149,6 @@ void monitor_show_all(DCB*);
void monitor_list(DCB*);
bool monitor_add_server(Monitor* mon, SERVER* server);
void monitor_remove_server(Monitor* mon, SERVER* server);
void monitor_set_journal_max_age(Monitor* mon, time_t value);
/**