Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

leader-settings-changed firing before unit departure #708

Closed
MiaAltieri opened this issue Mar 1, 2022 · 6 comments
Closed

leader-settings-changed firing before unit departure #708

MiaAltieri opened this issue Mar 1, 2022 · 6 comments
Assignees

Comments

@MiaAltieri
Copy link

Hi team. I had some weird behavior for this set up / situation

For Example. If you have these units:

A *
B
C

and A departs then you get these events hooks for each unit:
A: leader-settings-changed , mongodb-storage-detaching, mongodb-relation-departed(for A-B), mongodb-relation-departed(for A-C), stop, remove
B: mongodb-relation-departed (for A-B)
C: mongodb-relation-departed (for A-C),

According to @wallyworld and @rwcarlsen this is unexpected behaviour and should be looked into. As requested, this is my repo/branch where I observed this behaviour. It can be observed by first creating the necessary environment according to CONTRIBUTING.md. Once the environment has been created you can reproduce this with:

# pack and deploy
charmcraft pack
juju deploy -n3 ./*charm

# in a separate session
juju debug-hooks <leader_unit>

# remove unit 
juju remove-unit <leader_unit
@rwcarlsen
Copy link
Contributor

rwcarlsen commented Mar 1, 2022

If @wallyworld could clarify exactly what juju should be doing here that would help inform the best approach for dealing with things in the ops framework.

@jameinel
Copy link
Member

jameinel commented Mar 1, 2022 via email

@rwcarlsen
Copy link
Contributor

FWIW these docs suggest that the leader-settings changed event should be firing like this.

@rwcarlsen rwcarlsen self-assigned this Mar 4, 2022
@rwcarlsen
Copy link
Contributor

I hunted in the juju code for a bit and couldn't find anywhere that triggered a leader-settings-changed hook for unit departure. But my eyes and brain aren't very trained on reading the juju codebase yet. So maybe that doc page is just wrong (or out of date)...

@MiaAltieri
Copy link
Author

@jameinel bug filed

@jnsgruk
Copy link
Member

jnsgruk commented Mar 11, 2022

Nice, thanks all. Will close this for now and we can track this issue in the bug that Mia filed :)

@jnsgruk jnsgruk closed this as completed Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants