Hi
I run haproxy with 'load-server-state-from-file'. Before reloading
haproxy I dump the state using:
echo show servers state |nc -U admin.sock > /etc/haproxy/state/global
I noticed a buggy behaviour with this:
1. Check that the backend is 'DOWN'.
2. Dump the state using the command above (the 'DOWN' state is written
into the file).
3. Remove the health check of the backend.
4. Reload haproxy.
5. The backend will now be 'DOWN' forever, as the initial state taken
from the file is 'DOWN' and no health checks are running.
I attached an example configuration and an example state file. To
reproduce the issue:
1. Start haproxy.
2. Open the Stats page.
3. Place the state file.
4. Remove the 'check' from the configuration.
5. Reload haproxy.
6. Start the backend.
7. Reload the Stats page and notice that the backend still is 'DOWN'.
Tim
1
# be_id be_name srv_id srv_name srv_addr srv_op_state srv_admin_state srv_uweight srv_iweight srv_time_since_last_change srv_check_status srv_check_result srv_check_health srv_check_state srv_agent_state bk_f_forced_id srv_f_forced_id
3 bk_http 1 nginx 172.17.0.3 0 0 1 1 374 7 0 0 7 0 0 0
global
stats socket /admin.sock mode 666 level admin
server-state-file global
server-state-base /etc/haproxy/state/
defaults
log global
timeout connect 5s
timeout client 50s
timeout server 50s
load-server-state-from-file global
frontend fe_http
mode http
bind :::80 v4v6
default_backend bk_http
backend bk_http
mode http
option httpchk GET /
server nginx 172.17.0.3:80 check
listen stats
bind :1936
mode http
stats enable
stats uri /
stats hide-version
I run haproxy with 'load-server-state-from-file'. Before reloading
haproxy I dump the state using:
echo show servers state |nc -U admin.sock > /etc/haproxy/state/global
I noticed a buggy behaviour with this:
1. Check that the backend is 'DOWN'.
2. Dump the state using the command above (the 'DOWN' state is written
into the file).
3. Remove the health check of the backend.
4. Reload haproxy.
5. The backend will now be 'DOWN' forever, as the initial state taken
from the file is 'DOWN' and no health checks are running.
I attached an example configuration and an example state file. To
reproduce the issue:
1. Start haproxy.
2. Open the Stats page.
3. Place the state file.
4. Remove the 'check' from the configuration.
5. Reload haproxy.
6. Start the backend.
7. Reload the Stats page and notice that the backend still is 'DOWN'.
Tim
1
# be_id be_name srv_id srv_name srv_addr srv_op_state srv_admin_state srv_uweight srv_iweight srv_time_since_last_change srv_check_status srv_check_result srv_check_health srv_check_state srv_agent_state bk_f_forced_id srv_f_forced_id
3 bk_http 1 nginx 172.17.0.3 0 0 1 1 374 7 0 0 7 0 0 0
global
stats socket /admin.sock mode 666 level admin
server-state-file global
server-state-base /etc/haproxy/state/
defaults
log global
timeout connect 5s
timeout client 50s
timeout server 50s
load-server-state-from-file global
frontend fe_http
mode http
bind :::80 v4v6
default_backend bk_http
backend bk_http
mode http
option httpchk GET /
server nginx 172.17.0.3:80 check
listen stats
bind :1936
mode http
stats enable
stats uri /
stats hide-version