Fix writeq_high_water and writeq_low_water

The parameters were never read at startup and could not be modified at
runtime. Also the values were only read once at startup.
This commit is contained in:
Markus Mäkelä
2018-10-19 13:09:39 +03:00
parent d89cfc1810
commit 4be5d9267d
4 changed files with 126 additions and 38 deletions

View File

@ -870,6 +870,46 @@ bool runtime_alter_maxscale(const char* name, const char* value)
config_runtime_error("Invalid size value for '%s': %s", CN_QUERY_CLASSIFIER_CACHE_SIZE, value);
}
}
else if (key == CN_WRITEQ_HIGH_WATER)
{
uint64_t size = 0;
if (!get_suffixed_size(value, &size))
{
config_runtime_error("Invalid value for %s: %s", CN_WRITEQ_HIGH_WATER, value);
}
else if (size < MIN_WRITEQ_HIGH_WATER)
{
config_runtime_error("The specified '%s' is smaller than the minimum allowed size %lu.",
CN_WRITEQ_HIGH_WATER, MIN_WRITEQ_HIGH_WATER);
}
else
{
rval = true;
config_set_writeq_high_water(size);
MXS_NOTICE("'%s' set to: %lu", CN_WRITEQ_HIGH_WATER, size);
}
}
else if (key == CN_WRITEQ_LOW_WATER)
{
uint64_t size = 0;
if (!get_suffixed_size(value, &size))
{
config_runtime_error("Invalid value for '%s': %s", CN_WRITEQ_LOW_WATER, value);
}
else if (size < MIN_WRITEQ_LOW_WATER)
{
config_runtime_error("The specified '%s' is smaller than the minimum allowed size %lu.",
CN_WRITEQ_LOW_WATER, MIN_WRITEQ_LOW_WATER);
}
else
{
rval = true;
config_set_writeq_low_water(size);
MXS_NOTICE("'%s' set to: %lu", CN_WRITEQ_LOW_WATER, size);
}
}
else
{
config_runtime_error("Unknown global parameter: %s=%s", name, value);