From 39b4928f29ffd3e169bcc1dbdec12cff023e91d1 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Wed, 29 Apr 2015 20:45:42 +0300 Subject: [PATCH 01/35] Switched back to old log names for 1.1 compability. --- log_manager/log_manager.cc | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/log_manager/log_manager.cc b/log_manager/log_manager.cc index 05f5044c6..8e6b28c2d 100644 --- a/log_manager/log_manager.cc +++ b/log_manager/log_manager.cc @@ -80,6 +80,9 @@ ssize_t log_ses_count[LOGFILE_LAST] = {0}; */ #define MAX_LOGSTRLEN BUFSIZ +/** Use the skygw_ prefix, only for 1.1 compatible builds*/ +#define OLD_LOGNAMES + /** * Path to directory in which all files are stored to shared memory * by the OS. @@ -308,7 +311,11 @@ const char* get_suffix_default(void) const char* get_debug_prefix_default(void) { - return "debug"; +#ifdef OLD_LOGNAMES + return "skygw_debug"; +#else + return "debug"; +#endif } const char* get_debug_suffix_default(void) @@ -318,7 +325,11 @@ const char* get_debug_suffix_default(void) const char* get_trace_prefix_default(void) { - return "trace"; +#ifdef OLD_LOGNAMES + return "skygw_trace"; +#else + return "trace"; +#endif } const char* get_trace_suffix_default(void) @@ -328,7 +339,11 @@ const char* get_trace_suffix_default(void) const char* get_msg_prefix_default(void) { - return "messages"; +#ifdef OLD_LOGNAMES + return "skygw_msg"; +#else + return "messages"; +#endif } const char* get_msg_suffix_default(void) @@ -338,7 +353,11 @@ const char* get_msg_suffix_default(void) const char* get_err_prefix_default(void) { - return "error"; +#ifdef OLD_LOGNAMES + return "skygw_err"; +#else + return "error"; +#endif } const char* get_err_suffix_default(void) From c3dbda9ffdb85bb682603f9ea0cdfc703222e37b Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Thu, 30 Apr 2015 10:58:35 +0300 Subject: [PATCH 02/35] Changed all atoi calls to config_truth_value when they were used to generate boolean values. --- server/core/config.c | 14 +++++++------- server/modules/filter/qlafilter.c | 2 +- server/modules/filter/slavelag.c | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/server/core/config.c b/server/core/config.c index 390e3153c..764a606c8 100644 --- a/server/core/config.c +++ b/server/core/config.c @@ -1308,7 +1308,7 @@ int i; } else if (strcmp(name, "ms_timestamp") == 0) { - skygw_set_highp(atoi(value)); + skygw_set_highp(config_truth_value(value)); } else { @@ -1316,7 +1316,7 @@ int i; { if (strcasecmp(name, lognames[i].logname) == 0) { - if (atoi(value)) + if (config_truth_value(value)) skygw_log_enable(lognames[i].logfile); else skygw_log_disable(lognames[i].logfile); @@ -1495,10 +1495,10 @@ SERVER *server; user, auth); if (enable_root_user) - serviceEnableRootUser(service, atoi(enable_root_user)); + serviceEnableRootUser(service, config_truth_value(enable_root_user)); if (connection_timeout) - serviceSetTimeout(service, atoi(connection_timeout)); + serviceSetTimeout(service, config_truth_value(connection_timeout)); if(auth_all_servers) @@ -1511,7 +1511,7 @@ SERVER *server; if (allow_localhost_match_wildcard_host) serviceEnableLocalhostMatchWildcardHost( service, - atoi(allow_localhost_match_wildcard_host)); + config_truth_value(allow_localhost_match_wildcard_host)); /** Read, validate and set max_slave_connections */ max_slave_conn_str = @@ -1651,7 +1651,7 @@ SERVER *server; user, auth); if (enable_root_user) - serviceEnableRootUser(obj->element, atoi(enable_root_user)); + serviceEnableRootUser(obj->element, config_truth_value(enable_root_user)); if (connection_timeout) serviceSetTimeout(obj->element, atoi(connection_timeout)); @@ -1659,7 +1659,7 @@ SERVER *server; if (allow_localhost_match_wildcard_host) serviceEnableLocalhostMatchWildcardHost( obj->element, - atoi(allow_localhost_match_wildcard_host)); + config_truth_value(allow_localhost_match_wildcard_host)); } } } diff --git a/server/modules/filter/qlafilter.c b/server/modules/filter/qlafilter.c index c9af0a839..5362cf61e 100644 --- a/server/modules/filter/qlafilter.c +++ b/server/modules/filter/qlafilter.c @@ -95,7 +95,7 @@ static FILTER_OBJECT MyObject = { * are logged. * * To this base a session number is attached such that each session will - * have a nique name. + * have a unique name. */ typedef struct { int sessions; /* The count of sessions */ diff --git a/server/modules/filter/slavelag.c b/server/modules/filter/slavelag.c index c12d7a2a7..eb6b9536d 100644 --- a/server/modules/filter/slavelag.c +++ b/server/modules/filter/slavelag.c @@ -41,10 +41,10 @@ extern __thread log_info_t tls_log_info; * Two optional parameters that define the behavior after a data modifying query * is executed: * - * count= Queries to route to master after data modification. - * time=