]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: server: properly support and propagate the maintenance status
authorWilly Tarreau <w@1wt.eu>
Fri, 16 May 2014 09:25:16 +0000 (11:25 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 22 May 2014 09:27:00 +0000 (11:27 +0200)
commita0066ddbda7b4521239ed87131a4d61cbfcd20ae
tree5187d3c9b60ba688e189926a812b0d21d1098d01
parent4aac7db940878ad1ca5d8e5366ad80c01fab60e0
MEDIUM: server: properly support and propagate the maintenance status

This change now involves a new flag SRV_ADMF_IMAINT to note that the
maintenance status of a server is inherited from another server. Thus,
we know at each server level in the chain if it's running, in forced
maintenance or in a maintenance status because it tracks another server,
or even in both states.

Disabling a server propagates this flag down to other servers. Enabling
a server flushes the flag down. A server becomes up again once both of
its flags are cleared.

Two new functions "srv_adm_set_maint()" and "srv_adm_set_ready()" are used to
manipulate this maintenance status. They're used by the CLI and the stats
page.

Now the stats page always says "MAINT" instead of "MAINT(via)" and it's
only the chk/down field which reports "via x/y" when the status is
inherited from another server, but it doesn't say it when a server was
forced into maintenance. The CSV output indicates "MAINT (via x/y)"
instead of only "MAINT(via)". This is the most accurate representation.

One important thing is that now entering/leaving maintenance for a
tracking server correctly follows the state of the tracked server.
include/proto/server.h
src/cfgparse.c
src/dumpstats.c
src/server.c