Relationship hooks not firing when a unit is removed and added back

Bug #1101115 reported by Liam Young
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pyjuju
Triaged
Low
Unassigned

Bug Description

When I remove a unit with remove-unit and then subsequently add another unit the relationship hooks don't fire. I've tested this with a dummy-website charm and the haproxy charm from charm store. I don't believe this is a charm error as it looks like juju is simply not calling the relationship hooks.

I have ppa as my juju-origin in environments.yaml and have 0.6-0juju1~precise1 on the client and the units. I'm deploying against openstack.

I have reproduced this error by initially deploying 2 dummy-website units, adding 2 more, removing 2 and adding 2 again so without going down to 0 dummy-website units. Its also reproducible by adding and removing a single unit:

$ mkdir precise
$ cd precise/
$ bzr branch lp:~gnuoy/+junk/dummy-website
Branched 1 revision.
$ cd ../
$ juju bootstrap --constraints "instance-type=m1.small" 2>/dev/null
$ juju deploy haproxy 2>/dev/null
$ export JUJU_REPOSITORY=$PWD
$ juju deploy local:dummy-website 2>/dev/null
$ juju add-relation haproxy:reverseproxy dummy-website:website 2>/dev/null

# Check what hooks were run...

$ juju ssh dummy-website/0 "grep 'Running hook' /var/lib/juju/units/dummy-website-0/charm.log" 2>/dev/null
2013-01-18 07:59:09,760: hook.executor@DEBUG: Running hook: /var/lib/juju/units/dummy-website-0/charm/hooks/install
2013-01-18 07:59:09,890: hook.executor@DEBUG: Running hook: /var/lib/juju/units/dummy-website-0/charm/hooks/config-changed
2013-01-18 07:59:09,975: hook.executor@DEBUG: Running hook: /var/lib/juju/units/dummy-website-0/charm/hooks/start
2013-01-18 07:59:10,246: hook.executor@DEBUG: Running hook: /var/lib/juju/units/dummy-website-0/charm/hooks/website-relation-joined
2013-01-18 07:59:11,133: hook.executor@DEBUG: Running hook: /var/lib/juju/units/dummy-website-0/charm/hooks/config-changed
2013-01-18 07:59:11,179: hook.executor@DEBUG: Running hook: /var/lib/juju/units/dummy-website-0/charm/hooks/website-relation-changed

# Check we have an entry in haproxy for the dummy-website

$ juju ssh haproxy/0 "cat /etc/haproxy/haproxy.cfg | grep -E \"^\s*server\"" 2>/dev/null
    server 10_55_63_122__8080 10.55.63.122:8080 maxconn 100

# Remove the dummy-website unit and check it has gone from haproxy

$ juju remove-unit dummy-website/0 2>/dev/null
$ juju ssh haproxy/0 "cat /etc/haproxy/haproxy.cfg | grep -E \"^\s*server\"" 2>/dev/null

# Add a dummy-website unit
$ juju add-unit dummy-website 2>/dev/null

# Check What hooks were run, note that website-relation hooks have not fired

$ juju ssh dummy-website/1 "grep 'Running hook' /var/lib/juju/units/dummy-website-1/charm.log" 2>/dev/null
2013-01-18 08:44:24,347: hook.executor@DEBUG: Running hook: /var/lib/juju/units/dummy-website-1/charm/hooks/install
2013-01-18 08:44:24,490: hook.executor@DEBUG: Running hook: /var/lib/juju/units/dummy-website-1/charm/hooks/config-changed
2013-01-18 08:44:24,555: hook.executor@DEBUG: Running hook: /var/lib/juju/units/dummy-website-1/charm/hooks/start
2013-01-18 08:44:24,893: hook.executor@DEBUG: Running hook: /var/lib/juju/units/dummy-website-1/charm/hooks/config-changed

# Unsuprisingly no entry in haproxy for new unit

$ juju ssh haproxy/0 "cat /etc/haproxy/haproxy.cfg | grep -E \"^\s*server\"" 2>/dev/null
$

Haw Loeung (hloeung)
tags: added: canonical-webops-juju
Curtis Hovey (sinzui)
Changed in juju:
importance: Undecided → Low
status: New → Triaged
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.