MXS-1468: Fix created monitor serialization

When servers were added to monitors that were created at runtime, the
server list serialization overwrote the original persisted configuration
of the monitor. To solve this problem, the serialization of the server
list and the monitor parameters were combined.
This commit is contained in:
Markus Mäkelä
2017-10-11 11:30:58 +03:00
parent e94dc2aade
commit eac6d239fc
2 changed files with 29 additions and 93 deletions

View File

@ -45,7 +45,7 @@ bool runtime_link_server(SERVER *server, const char *target)
{
if (monitorAddServer(monitor, server))
{
monitor_serialize_servers(monitor);
monitor_serialize(monitor);
rval = true;
}
}
@ -80,7 +80,7 @@ bool runtime_unlink_server(SERVER *server, const char *target)
else if (monitor)
{
monitorRemoveServer(monitor, server);
monitor_serialize_servers(monitor);
monitor_serialize(monitor);
}
const char *type = service ? "service" : "monitor";