I’m seeking clarification and discussion on the hooks relation-departed
and relation-broken
. This surfaced as a documentation issue at the beginning of the year.
Apparently one can still do relation_set once -relation-departed is run but how will the other side react to that to read this new relation data? Will it receive another -relation-changed event or not? It is not clear at all.
What are the ordering guarantees for relation-departed in this case?
To make use of relation_set in -departed more information is needed. If there are two applications A and B in would be useful to know what happens after Juju remove-relation A B:
- Do all units in A get a chance to run relation-departed before all units in B? Or there is no order to that?
- Can relation-set be used on all A and B units? How will they receive relation data updates before -relation-broken?
- Is there a guarantee that no -broken event will be triggered while there are still -departed events to be processed on individual units of A or B?
It would make sense to me if something like that was described:
- Any A or B unit can do relation_set in -relation-departed
OR relation_set cannot be used in -relation-departed; - Any A or B unit can do relation_get in -relation-broken to retrieve settings set in -relation-departed
OR relation_get and relation_set cannot be used in -relation-broken
OR there is no way to do a relation_set after -relation-departed
I think it is a valid use-case to send some data over a relation after an operator runs remove-relation because there may be some information needed on A or B units from the other side for proper cleanup besides the information already present on a given relation when -relation-departed fires.