MXS-2167: Add support for extra_port

This allows MaxScale to connect to the server even when max_connections
has been reached.
This commit is contained in:
Markus Mäkelä
2018-11-15 12:51:36 +02:00
parent 598edea203
commit cbe1483028
7 changed files with 40 additions and 0 deletions

View File

@ -154,6 +154,7 @@ SERVER* server_alloc(const char* name, MXS_CONFIG_PARAMETER* params)
server->name = my_name;
server->port = config_get_integer(params, CN_PORT);
server->extra_port = config_get_integer(params, CN_EXTRA_PORT);
server->protocol = my_protocol;
server->authenticator = my_authenticator;
server->monuser[0] = '\0';
@ -1034,6 +1035,18 @@ void server_update_port(SERVER* server, unsigned short port)
}
}
/*
* Update the extra_port value of a specific server
*
* @param server The server to update
* @param port The new extra_port value
*
*/
void server_update_extra_port(SERVER* server, unsigned short port)
{
mxb::atomic::store(&server->extra_port, port, mxb::atomic::RELAXED);
}
static struct
{
const char* str;