Changing ports for backend, haproxy reload fails to pick up
Bug #1918082 reported by
Haw Loeung
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Content Cache Charm |
Triaged
|
High
|
Haw Loeung |
Bug Description
Hi,
When changing backends to use different ports, or enable "backend-tls", haproxy reload fails to pick up the change. It seems to do with loading backends from the saved state file (/run/haproxy/
We should figure out how to detect this and work around it (may also be a bug opened upstream).
Related branches
~hloeung/content-cache-charm:haproxy-config
- James Simpson: Approve
- Canonical IS Reviewers: Pending requested
-
Diff: 116 lines (+42/-2)4 files modifiedlib/haproxy.py (+4/-0)
reactive/content_cache.py (+6/-1)
tests/unit/test_content_cache.py (+12/-1)
tests/unit/test_haproxy.py (+20/-0)
Changed in content-cache-charm: | |
status: | New → Triaged |
importance: | Undecided → High |
Changed in content-cache-charm: | |
assignee: | nobody → Haw Loeung (hloeung) |
status: | Triaged → In Progress |
Changed in content-cache-charm: | |
status: | In Progress → Fix Committed |
Changed in content-cache-charm: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
One idea floating around is to parse the state file and look for inconsistencies then exclude those and re-write it. It's a text file:
| $ cat /run/haproxy/ saved-server- state 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 srv_use_ssl srv_check_port srv_check_addr srv_agent_addr srv_agent_port cached- mysite- com 1 server_1 127.0.0.1 2 0 1 1 175487 15 3 61 6 0 0 0 - 6127 - 0 0 - - 0 cached- mysite- 2-com 1 server_1 127.0.0.1 2 0 1 1 175487 15 3 61 6 0 0 0 - 6128 - 0 0 - - 0 cached- mysite- 3-com 1 server_1 127.0.0.1 2 0 1 1 175487 15 3 61 6 0 0 0 - 6130 - 0 0 - - 0
| 1
| # be_id be_name srv_id srv_name srv_addr srv_op_state srv_admin_state srv_uweight srv_iweight srv_time_
| 34 backend-
| 35 backend-
| 36 backend-
| ...