MXS-2329 Change warning into info
Currently it's too laborious to use duration suffixes when saving generated configs and also to handle suffixes when changes are made dynamically using maxctrl. It will be trivial to do that when the new configuration mechanism has been taken into use everywhere. That will not happen before MaxScale 2.5. So, in MaxScale 2.4 duration suffixes will be accepted in manually created configuration files, but no warning will be logged if a suffix is not used.
This commit is contained in:
parent
ccb3ea6157
commit
2115322737
@ -128,7 +128,8 @@ Please see the
|
||||
[configuration guide](../Getting-Started/Configuration-Guide.md#durations)
|
||||
for details.
|
||||
|
||||
_Not_ providing an explicit unit has been deprecated in MaxScale 2.4.
|
||||
_Not_ providing an explicit unit is strongly discouraged as it will be
|
||||
deprecated in MaxScale 2.5.
|
||||
|
||||
### Query Classifier Cache
|
||||
|
||||
|
@ -247,7 +247,7 @@ static bool get_milliseconds(const char* zName,
|
||||
const char* zValue,
|
||||
const char* zDisplay_value,
|
||||
time_t* pMilliseconds);
|
||||
|
||||
static void log_duration_suffix_warning(const char* zName, const char* zValue);
|
||||
|
||||
int config_get_ifaddr(unsigned char* output);
|
||||
static int config_get_release_string(char* release);
|
||||
@ -4513,11 +4513,7 @@ bool config_param_is_valid(const MXS_MODULE_PARAM* params,
|
||||
break;
|
||||
|
||||
case mxs::config::DURATION_IN_DEFAULT:
|
||||
MXS_WARNING("Specifying durations without a suffix denoting the unit "
|
||||
"has been deprecated: '%s=%s'. Use the suffixes 'h' (hour), "
|
||||
"'m' (minute) 's' (second) or 'ms' (milliseconds). "
|
||||
"For instance, '%s=%ss' or '%s=%sms.",
|
||||
key, value, key, value, key, value);
|
||||
log_duration_suffix_warning(key, value);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -5143,6 +5139,14 @@ static bool duration_is_valid(const char* zValue, mxs::config::DurationUnit* pUn
|
||||
return valid;
|
||||
}
|
||||
|
||||
static void log_duration_suffix_warning(const char* zName, const char* zValue)
|
||||
{
|
||||
MXS_INFO("Specifying durations without a suffix denoting the unit "
|
||||
"is strongly discouraged as it will be deprecated in the "
|
||||
"future: %s=%s. Use the suffixes 'h' (hour), 'm' (minute), "
|
||||
"'s' (second) or 'ms' (milliseconds).", zName, zValue);
|
||||
}
|
||||
|
||||
static bool get_seconds(const char* zName, const char* zValue, std::chrono::seconds* pSeconds)
|
||||
{
|
||||
bool valid = false;
|
||||
@ -5160,9 +5164,7 @@ static bool get_seconds(const char* zName, const char* zValue, std::chrono::seco
|
||||
break;
|
||||
|
||||
case mxs::config::DURATION_IN_DEFAULT:
|
||||
MXS_WARNING("Specifying durations without a suffix denoting the unit "
|
||||
"has been deprecated: %s=%s. Use the suffixes 'h' (hour), "
|
||||
"'m' (minute) 's' (second) or 'ms' (milliseconds).", zName, zValue);
|
||||
log_duration_suffix_warning(zName, zValue);
|
||||
default:
|
||||
*pSeconds = seconds;
|
||||
valid = true;
|
||||
@ -5170,7 +5172,7 @@ static bool get_seconds(const char* zName, const char* zValue, std::chrono::seco
|
||||
}
|
||||
else
|
||||
{
|
||||
MXS_ERROR("Invalid timeout value for '%s': %s", zName, zValue);
|
||||
MXS_ERROR("Invalid duration %s: %s=%s", zValue, zName, zValue);
|
||||
}
|
||||
|
||||
return valid;
|
||||
@ -5208,9 +5210,7 @@ static bool get_milliseconds(const char* zName,
|
||||
{
|
||||
if (unit == mxs::config::DURATION_IN_DEFAULT)
|
||||
{
|
||||
MXS_WARNING("Specifying durations without a suffix denoting the unit "
|
||||
"has been deprecated: %s=%s. Use the suffixes 'h' (hour), "
|
||||
"'m' (minute) 's' (second) or 'ms' (milliseconds).", zName, zDisplay_value);
|
||||
log_duration_suffix_warning(zName, zDisplay_value);
|
||||
}
|
||||
|
||||
*pMilliseconds = milliseconds;
|
||||
|
@ -3383,8 +3383,8 @@ void write_master_config(FILE* config_file, const ChangeMasterConfig& config)
|
||||
fprintf(config_file, "master_tls_version=%s\n", config.ssl_version.c_str());
|
||||
}
|
||||
|
||||
fprintf(config_file, "master_heartbeat_period=%ds\n", config.heartbeat_period);
|
||||
fprintf(config_file, "master_connect_retry=%ds\n", config.connect_retry);
|
||||
fprintf(config_file, "master_heartbeat_period=%d\n", config.heartbeat_period);
|
||||
fprintf(config_file, "master_connect_retry=%d\n", config.connect_retry);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user