Add juju action to 'drain', so allow existing connections to finish but not accept new
Bug #1876060 reported by
Haw Loeung
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Content Cache Charm |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
Hi,
Mostly used for if/when we have some sort of frontend in front of content-cache units (HAProxy in front, Azure LB, etc.). We should have an action to trigger on a unit to drain the queue. So allow existing connections to finish and not accept new.
We'll need to see if HAProxy has a flag to do this and implement it as a juju action.
Changed in content-cache-charm: | |
status: | New → Triaged |
importance: | Undecided → Low |
importance: | Low → Wishlist |
To post a comment you must log in.
It's possible with 'set server backend/serv state drain' (with 'show servers state' to show the current status). Then 'set server backend/serv state ready' to restore.
e.g.
Current:
| ubuntu@ juju-87625f- hloeung- 13:~$ echo "show servers state" | sudo -u haproxy socat stdio $(awk '/stats socket/ { print $3 }' /etc/haproxy/ haproxy. cfg) 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 srv_fqdn srv_port srvrecord cached- archive- ubuntu- com 1 server_1 127.0.0.1 2 0 1 1 99487 15 3 6 6 0 0 0 - 6080 -
| 1
| # be_id be_name srv_id srv_name srv_addr srv_op_state srv_admin_state srv_uweight srv_iweight srv_time_
| 7 backend-
Drain:
| ubuntu@ juju-87625f- hloeung- 13:~$ echo "set server backend- cached- archive- ubuntu- com/server_ 1 state drain" | sudo -u haproxy socat stdio $(awk '/stats socket/ { print $3 }' /etc/haproxy/ haproxy. cfg) juju-87625f- hloeung- 13:~$ echo "show servers state" | sudo -u haproxy socat stdio $(awk '/stats socket/ { print $3 }' /etc/haproxy/ haproxy. cfg) 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 srv_fqdn srv_port srvrecord cached- archive- ubuntu- com 1 server_1 127.0.0.1 2 8 1 1 5 15 3 6 6 0 0 0 - 6080 -
| ubuntu@
| 1
| # be_id be_name srv_id srv_name srv_addr srv_op_state srv_admin_state srv_uweight srv_iweight srv_time_
| 7 backend-
| ...
Restore / undrain:
| ubuntu@ juju-87625f- hloeung- 13:~$ echo "set server backend- cached- archive- ubuntu- com/server_ 1 state ready" | sudo -u haproxy socat stdio $(awk '/stats socket/ { print $3 }' /etc/haproxy/ haproxy. cfg) juju-87625f- hloeung- 13:~$ echo "show servers state" | sudo -u haproxy socat stdio $(awk '/stats socket/ { print $3 }' /etc/haproxy/ haproxy. cfg) 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 srv_fqdn srv_port srvrecord cached- archive- ubuntu- com 1 server_1 127.0.0.1 2 0 1 1 71 15 3 6 6 0 0 0 - 6080 -
| ubuntu@
| 1
| # be_id be_name srv_id srv_name srv_addr srv_op_state srv_admin_state srv_uweight srv_iweight srv_time_
| 7 backend-