mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 06:11:32 +02:00
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.
This commit is contained in:
parent
caa6a1bb46
commit
54a4730c65
@ -75,8 +75,8 @@ enum srv_state {
|
||||
enum srv_admin {
|
||||
SRV_ADMF_FMAINT = 0x01, /* the server was explicitly forced into maintenance */
|
||||
SRV_ADMF_IMAINT = 0x02, /* the server has inherited the maintenance status from a tracked server */
|
||||
SRV_ADMF_MAINT = 0x03, /* mask to check if any maintenance flag is present */
|
||||
SRV_ADMF_CMAINT = 0x04, /* the server is in maintenance because of the configuration */
|
||||
SRV_ADMF_MAINT = 0x07, /* mask to check if any maintenance flag is present */
|
||||
SRV_ADMF_FDRAIN = 0x08, /* the server was explicitly forced into drain state */
|
||||
SRV_ADMF_IDRAIN = 0x10, /* the server has inherited the drain status from a tracked server */
|
||||
SRV_ADMF_DRAIN = 0x18, /* mask to check if any drain flag is present */
|
||||
|
@ -1278,6 +1278,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
|
||||
}
|
||||
else if (!defsrv && !strcmp(args[cur_arg], "disabled")) {
|
||||
newsrv->admin |= SRV_ADMF_CMAINT;
|
||||
newsrv->admin |= SRV_ADMF_FMAINT;
|
||||
newsrv->state = SRV_ST_STOPPED;
|
||||
newsrv->check.state |= CHK_ST_PAUSED;
|
||||
newsrv->check.health = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user