haproxy doesn't aggregate relation data from multiple units
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
haproxy (Juju Charms Collection) |
Fix Released
|
Undecided
|
David Britton |
Bug Description
Setting the services via relation data is broken when you have more than one unit.
For example, I created a simple fake webapp charm and related it to haproxy:
juju deploy haproxy
juju deploy andreas-webapp
juju add-relation haproxy:
This is the website-
"""
#!/bin/sh
host=$(unit-get private-address)
port=80
relation-set "services=
- { service_name: message,
service_
servers: [[message, $host, $port, check inter 5000 rise 2 fall 5 maxconn 4],
}
"
"""
After the first unit was related, this is the haproxy backend entry:
"""
backend message
mode http
balance leastconn
option httpchk GET / HTTP/1.0
server message 10.55.32.119:80 check inter 5000 rise 2 fall 5 maxconn 4
server message 10.55.32.119:81 check inter 5000 rise 2 fall 5 maxconn 4
"""
Now I add another unit of my webapp:
juju add-unit andreas-webapp
Here is a diff of the haproxy.cfg file after the second unit established the relation:
--- /etc/haproxy/
+++ /etc/haproxy/
@@ -26,8 +26,8 @@
mode http
balance leastconn
option httpchk GET / HTTP/1.0
- server message 10.55.32.119:80 check inter 5000 rise 2 fall 5 maxconn 4
- server message 10.55.32.119:81 check inter 5000 rise 2 fall 5 maxconn 4
+ server message 10.55.32.174:80 check inter 5000 rise 2 fall 5 maxconn 4
+ server message 10.55.32.174:81 check inter 5000 rise 2 fall 5 maxconn 4
frontend haproxy-0-80
bind 0.0.0.0:80
The haproxy charm just replaced the data, instead of adding/aggregating it.
Related branches
- Marco Ceppi (community): Approve
- Sidnei da Silva (community): Approve
-
Diff: 186 lines (+75/-25)3 files modifiedhooks/hooks.py (+26/-20)
hooks/tests/test_peer_hooks.py (+2/-2)
hooks/tests/test_reverseproxy_hooks.py (+47/-3)
Changed in haproxy (Juju Charms Collection): | |
assignee: | nobody → David Britton (davidpbritton) |
summary: |
- haproxy doesn't aggregate relation data servers from multiple units + haproxy doesn't aggregate relation data from multiple units |
tags: | added: landscape |
description: | updated |
description: | updated |
Changed in haproxy (Juju Charms Collection): | |
status: | New → Fix Released |
Sample webapp charm descibed in the ticket that can be used to reproduce the problem.