litmus_paper icon indicating copy to clipboard operation
litmus_paper copied to clipboard

Exclude servers in MAINT status in haproxy_backends_health

Open calerogers opened this issue 4 years ago • 0 comments

Servers apart of a backend that are in one of the MAINT statuses should not count negatively during haproxy weight calculation. This skews weighting as they are grouped with DOWN servers even though they are purposely put in this status.

One use case where this was unexpected is using the server-template directive which allows (and recommends for future scaling) provisioning more server slots than there are servers to fill it with. These placeholder servers are marked as MAINT (resolution).

For example, say I provision 10 server slots, but there are only 2 servers returned via DNS to fill them with, currently that would calculate to 20 health because it is measuring the other 8 idle servers as DOWN, when in reality there is 2 of 2 expected servers up, which should measure as 100.

calerogers avatar Sep 25 '20 19:09 calerogers