mirror of
https://gitee.com/wangbin579/cetus.git
synced 2024-12-03 12:27:42 +08:00
Auto create connections when add backends
This commit is contained in:
parent
cac785e2e7
commit
89f721bdf7
@ -237,6 +237,7 @@ network_backends_add(network_backends_t *bs, const gchar *address,
|
||||
}
|
||||
|
||||
set_backend_config(new_backend, srv);
|
||||
network_connection_pool_create_conns(srv);
|
||||
network_backends_into_group(bs, new_backend);
|
||||
g_message("added %s backend: %s, state: %s", backend_type_t_str[type], address, backend_state_t_str[state]);
|
||||
|
||||
|
@ -4835,6 +4835,14 @@ network_connection_pool_create_conns(chassis *srv)
|
||||
for (i = 0; i < network_backends_count(g->backends); i++) {
|
||||
network_backend_t *backend = network_backends_get(g->backends, i);
|
||||
if (backend != NULL) {
|
||||
if (backend->state != BACKEND_STATE_UP && backend->state != BACKEND_STATE_UNKNOWN) {
|
||||
continue;
|
||||
}
|
||||
int total = backend->pool->cur_idle_connections + backend->connected_clients;
|
||||
if (total > 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (j = 0; j < backend->config->mid_conn_pool; j++) {
|
||||
server_connection_state_t *scs = network_mysqld_self_con_init(srv);
|
||||
if (srv->disable_dns_cache)
|
||||
|
Loading…
Reference in New Issue
Block a user