MINOR: server: allow init-state for dynamic servers

Commit 50322df introduced the init-state keyword, but it didn't enable
it for dynamic servers. However, this feature is perfectly desirable
for virtual servers too, where someone would like a server inlived
through "set server be1/srv1 state ready" to be put out of maintenance
in down state until the next health check succeeds.
At reading the code, it seems that it's only a matter of allowing this
keyword for dynamic servers, as current code path calls
srv_adm_set_ready() which incidentally triggers a call to
_srv_update_status_adm().
This commit is contained in:
Damien Claisse 2024-09-10 14:52:42 +00:00 committed by Willy Tarreau
parent 33deb4babe
commit ce6a621ae3
2 changed files with 3 additions and 2 deletions

View File

@ -17571,7 +17571,8 @@ init-state { fully-up | up | down | fully-down }
The server's init-state is considered when the HAProxy instance is
(re)started, a new server is detected (for example via service discovery /
DNS resolution), a server exits maintenance, etc.
DNS resolution), a dynamic server is inlived, a server exits maintenance,
etc.
Examples:
# pass client traffic ONLY to Redis "master" node

View File

@ -2323,7 +2323,7 @@ static struct srv_kw_list srv_kws = { "ALL", { }, {
{ "hash-key", srv_parse_hash_key, 1, 1, 1 }, /* Configure how chash keys are computed */
{ "id", srv_parse_id, 1, 0, 1 }, /* set id# of server */
{ "init-addr", srv_parse_init_addr, 1, 1, 0 }, /* */
{ "init-state", srv_parse_init_state, 1, 1, 0 }, /* Set the initial state of the server */
{ "init-state", srv_parse_init_state, 1, 1, 1 }, /* Set the initial state of the server */
{ "log-bufsize", srv_parse_log_bufsize, 1, 1, 0 }, /* Set the ring bufsize for log server (only for log backends) */
{ "log-proto", srv_parse_log_proto, 1, 1, 0 }, /* Set the protocol for event messages, only relevant in a log or ring section */
{ "maxconn", srv_parse_maxconn, 1, 1, 1 }, /* Set the max number of concurrent connection */