]> git.kaiwu.me - haproxy.git/commit
BUG/MAJOR: can't enable a server through the stat socket
authorBaptiste Assmann <bedis9@gmail.com>
Fri, 18 Sep 2015 08:30:03 +0000 (10:30 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 18 Sep 2015 10:38:23 +0000 (12:38 +0200)
commit54a4730c65b5f912bfc32fcd86f5e69999f65ac7
treec41b04c3df68a02b858bbdd2db4dcad7866fe700
parentcaa6a1bb46e1f87823c7faa25230933f97eb766e
BUG/MAJOR: can't enable a server through the stat socket

When a server is disabled in the configuration using the "disabled"
keyword, a single flag is positionned: SRV_ADMF_CMAINT (use to be
SRV_ADMF_FMAINT)..
That said, when providing the first version of this code, we also
changed the SRV_ADMF_MAINT mask to match any of the possible MAINT
cases: SRV_ADMF_FMAINT, SRV_ADMF_IMAINT, SRV_ADMF_CMAINT

Since SRV_ADMF_CMAINT is never (and is not supposed to be) altered at
run time, once a server has this flag set up, it can never ever be
enabled again using the stats socket.

In order to fix this, we should:
- consider SRV_ADMF_CMAINT as a simple flag to report the state in the
  old configuration file (will be used after a reload to deduce the
  state of the server in a new running process)
- enabling both SRV_ADMF_CMAINT and SRV_ADMF_FMAINT when the keyword
  "disabled" is in use in the configuration
- update the mask SRV_ADMF_MAINT as it was before, to only match
  SRV_ADMF_FMAINT and SRV_ADMF_IMAINT.

The following patch perform the changes above.
It allows fixing the regression without breaking the way the up coming
feature (seamless server state accross reloads) is going to work.

Note: this is 1.6-only, no backport needed.
include/types/server.h
src/server.c