MXS-2313: Expose only two rank values

The rank can now only be used to define two groups of servers: primary and
secondary servers. This limits the exposure and reduces the number of
possibilities that can arise from the use of this parameter thus making it
more predictable.
This commit is contained in:
Markus Mäkelä
2019-03-13 09:45:00 +02:00
parent 6f8bfd7d11
commit 3eef2648e1
4 changed files with 23 additions and 4 deletions

View File

@ -621,9 +621,11 @@ bool runtime_alter_server(Server* server, const char* key, const char* value)
}
if (strcmp(key, CN_RANK) == 0)
{
if (auto i = get_positive_int(value))
auto v = config_enum_to_value(value, rank_values);
if (v != MXS_UNKNOWN_ENUM_VALUE)
{
server->set_rank(i);
server->set_rank(v);
}
else
{