Feature Request: -about-to-depart hook
Mario Splivalo
mario.splivalo at canonical.com
Mon Jan 26 13:54:49 UTC 2015
Hello!
Currently juju provides relation-departed hook, which will fire on all
units that are part of relation, and relation-broken hook, which will
fire on unit that just departed the relation.
The problem arises when we have a multi-unit service peered. Consider
MongoDB charm where we usually have replicaset formed with three or more
units:
When a unit is destroyed (with 'juju remove-unit') first relation-broken
hook will fire between the departing unit and all the 'staying' units.
Then, on the departed unit relation-broken hook is fired. But, if we
need to do some work on the departing unit before it leaves the
relation, there is no way to do so. When 'relation-departed' hook is
called there is no way of telling (if we make observation from within
the hook) if we are running on unit that is departing, or on unit that
is 'staying' within the relation.
A '-before-departed' hook would, I think, solve. First a
'-before-departed' hook will be fired on the departing unit. Then
'-departed' hook will fire against departing and staying units. And,
lastly, as it is now, the -broken hook will fire.
Ignoring the, most likely, wrong nomenclature of the proposed hook, what
are your opinions on the matter?
Mario
More information about the Juju-dev
mailing list