diff --git a/server/core/config.c b/server/core/config.c index 3af8f5caa..cc50e1b99 100644 --- a/server/core/config.c +++ b/server/core/config.c @@ -846,9 +846,6 @@ int error_count = 0; char *user; char *passwd; unsigned long interval = 0; - int replication_heartbeat = 0; - int detect_stale_master = 0; - int disable_master_failback = 0; int connect_timeout = 0; int read_timeout = 0; int write_timeout = 0; @@ -861,18 +858,6 @@ int error_count = 0; interval = strtoul(config_get_value(obj->parameters, "monitor_interval"), NULL, 10); } - if (config_get_value(obj->parameters, "detect_replication_lag")) { - replication_heartbeat = atoi(config_get_value(obj->parameters, "detect_replication_lag")); - } - - if (config_get_value(obj->parameters, "detect_stale_master")) { - detect_stale_master = atoi(config_get_value(obj->parameters, "detect_stale_master")); - } - - if (config_get_value(obj->parameters, "disable_master_failback")) { - disable_master_failback = atoi(config_get_value(obj->parameters, "disable_master_failback")); - } - if (config_get_value(obj->parameters, "backend_connect_timeout")) { connect_timeout = atoi(config_get_value(obj->parameters, "backend_connect_timeout")); } diff --git a/server/include/monitor.h b/server/include/monitor.h index 5c76a4afa..e114f3424 100644 --- a/server/include/monitor.h +++ b/server/include/monitor.h @@ -135,11 +135,7 @@ extern void monitorStopAll(); extern void monitorShowAll(DCB *); extern void monitorShow(DCB *, MONITOR *); extern void monitorList(DCB *); -extern void monitorSetId(MONITOR *, unsigned long); extern void monitorSetInterval (MONITOR *, unsigned long); -extern void monitorSetReplicationHeartbeat(MONITOR *, int); -extern void monitorDetectStaleMaster(MONITOR *, int); -extern void monitorDisableMasterFailback(MONITOR *, int); extern void monitorSetNetworkTimeout(MONITOR *, int, int); extern RESULTSET *monitorGetList(); #endif diff --git a/server/include/service.h b/server/include/service.h index 8b55ce32b..c95a73095 100644 --- a/server/include/service.h +++ b/server/include/service.h @@ -182,6 +182,8 @@ extern int serviceSetTimeout(SERVICE *, int ); extern void serviceWeightBy(SERVICE *, char *); extern char *serviceGetWeightingParameter(SERVICE *); extern int serviceEnableLocalhostMatchWildcardHost(SERVICE *, int); +int serviceStripDbEsc(SERVICE* service, int action); +int serviceAuthAllServers(SERVICE *service, int action); extern void service_update(SERVICE *, char *, char *, char *); extern int service_refresh_users(SERVICE *); extern void printService(SERVICE *); diff --git a/server/modules/monitor/galera_mon.c b/server/modules/monitor/galera_mon.c index dff68c217..ebc359991 100644 --- a/server/modules/monitor/galera_mon.c +++ b/server/modules/monitor/galera_mon.c @@ -155,7 +155,7 @@ CONFIG_PARAMETER* params = (CONFIG_PARAMETER*)opt; handle->shutdown = 0; handle->defaultUser = NULL; handle->defaultPasswd = NULL; - handle->id = config_get_gateway_id(); + handle->id = MONITOR_DEFAULT_ID; handle->interval = MONITOR_INTERVAL; handle->disableMasterFailback = 0; handle->master = NULL; diff --git a/server/modules/monitor/mm_mon.c b/server/modules/monitor/mm_mon.c index 5e9bdd542..a71d2cc7d 100644 --- a/server/modules/monitor/mm_mon.c +++ b/server/modules/monitor/mm_mon.c @@ -146,7 +146,7 @@ CONFIG_PARAMETER* params = (CONFIG_PARAMETER*)opt; handle->shutdown = 0; handle->defaultUser = NULL; handle->defaultPasswd = NULL; - handle->id = config_get_gateway_id(); + handle->id = MONITOR_DEFAULT_ID; handle->interval = MONITOR_INTERVAL; handle->replicationHeartbeat = 0; handle->detectStaleMaster = 0; diff --git a/server/modules/monitor/ndbcluster_mon.c b/server/modules/monitor/ndbcluster_mon.c index c146d3f09..8f7d00964 100644 --- a/server/modules/monitor/ndbcluster_mon.c +++ b/server/modules/monitor/ndbcluster_mon.c @@ -142,7 +142,7 @@ CONFIG_PARAMETER* params = (CONFIG_PARAMETER*)opt; handle->shutdown = 0; handle->defaultUser = NULL; handle->defaultPasswd = NULL; - handle->id = config_get_gateway_id(); + handle->id = MONITOR_DEFAULT_ID; handle->interval = MONITOR_INTERVAL; handle->connect_timeout=DEFAULT_CONNECT_TIMEOUT; handle->read_timeout=DEFAULT_READ_TIMEOUT; diff --git a/server/modules/routing/debugcmd.c b/server/modules/routing/debugcmd.c index b4a13167f..d85f96422 100644 --- a/server/modules/routing/debugcmd.c +++ b/server/modules/routing/debugcmd.c @@ -1207,7 +1207,14 @@ restart_monitor(DCB *dcb, MONITOR *monitor) static void enable_monitor_replication_heartbeat(DCB *dcb, MONITOR *monitor) { - monitorSetReplicationHeartbeat(monitor, 1); + CONFIG_PARAMETER param; + const char* name = "detect_replication_lag"; + const char* value = "1"; + param.name = (char*)name; + param.value = (char*)value; + param.next = NULL; + monitorStop(monitor); + monitorStart(monitor,¶m); } /** @@ -1219,7 +1226,14 @@ enable_monitor_replication_heartbeat(DCB *dcb, MONITOR *monitor) static void disable_monitor_replication_heartbeat(DCB *dcb, MONITOR *monitor) { - monitorSetReplicationHeartbeat(monitor, 0); + CONFIG_PARAMETER param; + const char* name = "detect_replication_lag"; + const char* value = "0"; + param.name = (char*)name; + param.value = (char*)value; + param.next = NULL; + monitorStop(monitor); + monitorStart(monitor,¶m); } /**