1
0
mirror of http://git.haproxy.org/git/haproxy.git/ synced 2025-04-10 11:11:37 +00:00

MINOR: server: remove prev_deleted server list

This patch is a direct follow-up to the previous one. Thanks to watcher
type, it is not safe to assume that servers manipulated via stats dump
were not targetted by a "delete server" CLI command. As such,
prev_deleted list server member is now unneeded. This patch thus removes
any reference to it.
This commit is contained in:
Amaury Denoyelle 2024-11-27 11:11:12 +01:00
parent 071ae8ce3d
commit 9c91b30139
2 changed files with 0 additions and 30 deletions
include/haproxy
src

View File

@ -303,7 +303,6 @@ struct server {
unsigned int pp_opts; /* proxy protocol options (SRV_PP_*) */
struct mt_list global_list; /* attach point in the global servers_list */
struct server *next;
struct mt_list prev_deleted; /* deleted servers with 'next' ptr pointing to us */
int cklen; /* the len of the cookie, to speed up checks */
int rdr_len; /* the length of the redirection prefix */
char *cookie; /* the id set in the cookie */

View File

@ -2966,7 +2966,6 @@ struct server *new_server(struct proxy *proxy)
LIST_INIT(&srv->srv_rec_item);
LIST_INIT(&srv->ip_rec_item);
LIST_INIT(&srv->pp_tlvs);
MT_LIST_INIT(&srv->prev_deleted);
event_hdl_sub_list_init(&srv->e_subs);
srv->rid = 0; /* rid defaults to 0 */
@ -3074,13 +3073,6 @@ struct server *srv_drop(struct server *srv)
guid_remove(&srv->guid);
/* make sure we are removed from our 'next->prev_deleted' list
* This doesn't require full thread isolation as we're using mt lists
* However this could easily be turned into regular list if required
* (with the proper use of thread isolation)
*/
MT_LIST_DELETE(&srv->prev_deleted);
task_destroy(srv->warmup);
task_destroy(srv->srvrq_check);
@ -6073,7 +6065,6 @@ static int cli_parse_delete_server(char **args, char *payload, struct appctx *ap
{
struct proxy *be;
struct server *srv;
struct server *prev_del;
struct ist be_name, sv_name;
struct mt_list back;
struct sess_priv_conns *sess_conns = NULL;
@ -6191,26 +6182,6 @@ static int cli_parse_delete_server(char **args, char *payload, struct appctx *ap
*/
_srv_detach(srv);
/* Some deleted servers could still point to us using their 'next',
* migrate them as needed
*/
MT_LIST_FOR_EACH_ENTRY_LOCKED(prev_del, &srv->prev_deleted, prev_deleted, back) {
/* update its 'next' ptr */
prev_del->next = srv->next;
if (srv->next) {
/* now it is our 'next' responsibility */
MT_LIST_APPEND(&srv->next->prev_deleted, &prev_del->prev_deleted);
}
else
mt_list_unlock_self(&prev_del->prev_deleted);
/* unlink from our list */
prev_del = NULL;
}
/* we ourselves need to inform our 'next' that we will still point it */
if (srv->next)
MT_LIST_APPEND(&srv->next->prev_deleted, &srv->prev_deleted);
/* remove srv from addr_node tree */
eb32_delete(&srv->conf.id);
ebpt_delete(&srv->conf.name);