haproxy doesn't aggregate relation data from multiple units

Bug #1270953 reported by Andreas Hasenack
12
This bug affects 2 people
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:reverseproxy andreas-webapp:website

This is the website-relation-changed hook on andreas-webapp:
"""
#!/bin/sh
host=$(unit-get private-address)
port=80
relation-set "services=
- { service_name: message,
    service_options: [mode http, balance leastconn, option httpchk GET / HTTP/1.0],
    servers: [[message, $host, $port, check inter 5000 rise 2 fall 5 maxconn 4],
              [message, $host, $(($port+1)), 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/haproxy.cfg.before 2014-01-20 21:25:40.653634221 +0000
+++ /etc/haproxy/haproxy.cfg 2014-01-20 21:28:25.933632737 +0000
@@ -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.

Tags: landscape

Related branches

David Britton (dpb)
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
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Sample webapp charm descibed in the ticket that can be used to reproduce the problem.

Changed in haproxy (Juju Charms Collection):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.