return ERR_ALERT | ERR_FATAL;
}
- eb32_insert(&curproxy->conf.used_server_id, &newsrv->conf.id);
newsrv->flags |= SRV_F_FORCED_ID;
return 0;
}
if (parse_flags & SRV_PARSE_TEMPLATE)
_srv_parse_tmpl_init(newsrv, curproxy);
+ /* If the server id is fixed, insert it in the proxy used_id tree.
+ * This is needed to detect a later duplicate id via srv_parse_id.
+ *
+ * If no is specified, a dynamic one is generated in
+ * check_config_validity.
+ */
+ if (newsrv->flags & SRV_F_FORCED_ID)
+ eb32_insert(&curproxy->conf.used_server_id, &newsrv->conf.id);
+
HA_DIAG_WARNING_COND((curproxy->cap & PR_CAP_LB) && !newsrv->uweight,
"configured with weight of 0 will never be selected by load balancing algorithms\n");
}
/* insert the server in the backend trees */
- if (!(srv->flags & SRV_F_FORCED_ID)) {
- eb32_insert(&be->conf.used_server_id, &srv->conf.id);
- ebis_insert(&be->conf.used_server_name, &srv->conf.name);
- }
+ eb32_insert(&be->conf.used_server_id, &srv->conf.id);
+ ebis_insert(&be->conf.used_server_name, &srv->conf.name);
thread_release();