If a backend server, which has an active connection with a client, is removed, it remains in the hgm container until the client closes the connection. However, this can lead to a crash if the 'read_only_actions' function creates a server that already exists in the container but is in an OFFLINE state.
To address this issue, the fix involves checking the host group container when a new server is added through 'read_only_actions.' If the server is found to be already present, it is marked as online instead of adding a new server.
proxy_info("Creating new server in HG %d : %s:%d , gtid_port=%d, weight=%d, status=%d\n",hostgroup_id,srv->address,srv->port,srv->gtid_port,srv->weight,srv->status);
proxy_info("Creating new server in HG %d : %s:%d , gtid_port=%d, weight=%d, status=%d\n",hostgroup_id,srv->address,srv->port,srv->gtid_port,srv->weight,srv->status);
}
proxy_debug(PROXY_DEBUG_MYSQL_CONNPOOL,5,"Adding new server %s:%d , weight=%d, status=%d, mem_ptr=%p into hostgroup=%d\n",srv->address,srv->port,srv->weight,srv->status,srv,hostgroup_id);
proxy_debug(PROXY_DEBUG_MYSQL_CONNPOOL,5,"Adding new server %s:%d , weight=%d, status=%d, mem_ptr=%p into hostgroup=%d\n",srv->address,srv->port,srv->weight,srv->status,srv,hostgroup_id);