Detect destroying a service vs removing a unit?

Stuart Bishop stuart.bishop at canonical.com
Wed Dec 17 17:01:15 UTC 2014


Hi.

Can anyone think of a way for a peer relationship-broken hook to
detect that the entire service is being destroyed, rather than just a
unit or two being removed?

I have just added a peer relationship-broken hook to my Cassandra
charm, so when a unit is removed the node is decommissioned properly
by streaming all its data to the remaining nodes. This works fine when
removing one unit. It works less fine when removing two or more units
at once (I can only decommission one node at a time), but I have
enough assistance from Cassandra to coordinate things despite the lack
of a peer relation at this point. It fails badly when I destroy a
service. All the units run their broken hooks, and they decommission
themselves one at a time streaming their data to the remaining nodes,
which will shortly be decommissioned themselves. It actually works,
eventually, if the last node has enough disk space available but I
expect on any real deployments the tear down will fail due to a lack
of disk space.

-- 
Stuart Bishop <stuart.bishop at canonical.com>



More information about the Juju mailing list