BUG/MINOR: server: Remove RMAINT from admin state when loading server state
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 12 Feb 2021 16:36:08 +0000 (17:36 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 26 Feb 2021 15:54:29 +0000 (16:54 +0100)
The RMAINT admin state is dynamic and should be remove from the
srv_admin_state parameter when a server state is loaded from a server-state
file. Otherwise an erorr is reported, the server-state line is ignored and
the server state is not updated.

This patch should fix the issue #576. It must be backported as far as 1.8.

(cherry picked from commit eaab7325a797e61d16a80b2969ab5f9cbd9679c5)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit c611103c9db2ebb842596557d593b1f775c0d628)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 79e52ed584b86a2317b46b159cb644dbd456b1cf)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>

src/server.c

index d3d3d14..6aeca68 100644 (file)
@@ -2929,7 +2929,7 @@ static void srv_update_state(struct server *srv, int version, char **params)
                        /* inherited statuses will be recomputed later.
                         * Also disable SRV_ADMF_HMAINT flag (set from stats socket fqdn).
                         */
-                       srv_admin_state &= ~SRV_ADMF_IDRAIN & ~SRV_ADMF_IMAINT & ~SRV_ADMF_HMAINT;
+                       srv_admin_state &= ~SRV_ADMF_IDRAIN & ~SRV_ADMF_IMAINT & ~SRV_ADMF_HMAINT & ~SRV_ADMF_RMAINT;
 
                        if ((p == params[2]) || errno == EINVAL || errno == ERANGE ||
                            (srv_admin_state != 0 &&