]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MAJOR: checks: add support for a new "drain" administrative mode
authorWilly Tarreau <w@1wt.eu>
Thu, 22 May 2014 14:14:34 +0000 (16:14 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 23 May 2014 12:29:11 +0000 (14:29 +0200)
commitbfc7b7acd8de4b19c86a4c53f17049e0c088a753
tree552ede65cdb749fb6ad4feeea0f23a28a0f01732
parent9943d3117ef294a20ec693f5b09a3b34aff83526
MAJOR: checks: add support for a new "drain" administrative mode

This patch adds support for a new "drain" mode. So now we have 3 admin
modes for a server :
  - READY
  - DRAIN
  - MAINT

The drain mode disables load balancing but leaves the server up. It can
coexist with maint, except that maint has precedence. It is also inherited
from tracked servers, so just like maint, it's represented with 2 bits.

New functions were designed to set/clear each flag and to propagate the
changes to tracking servers when relevant, and to log the changes. Existing
functions srv_set_adm_maint() and srv_set_adm_ready() were replaced to make
use of the new functions.

Currently the drain mode is not yet used, however the whole logic was tested
with all combinations of set/clear of both flags in various orders to catch
all corner cases.
include/proto/backend.h
include/proto/server.h
include/types/server.h
src/dumpstats.c
src/server.c