canonical / mongodb-operator

Charmed solution for MongoDB
Apache License 2.0
12 stars 14 forks source link

flakey relation broken for shards on `sharding` interface #297

Closed MiaAltieri closed 11 months ago

MiaAltieri commented 11 months ago

Steps to reproduce

Run tox -e sharding-integration, the flakey behavior may reveal itself or you can run again

Expected behavior

Removal to run seemlessly

Actual behavior

stop hook fails

Why it is failing

Deferred relation-broken events no longer have access to remote-app data during after they have been defered. On the first time they have been deferred there is no issue. So when the event is defered:

    mongos_hosts = event.relation.data[event.relation.app].get(HOSTS_KEY, None)`

gives the error

KeyError: 'Cannot index relation data with "None". Are you trying to access remote app data during a relation-broken event? This is not allowed.'

Versions

Juju CLI: 3.1.6

github-actions[bot] commented 11 months ago

https://warthogs.atlassian.net/browse/DPE-2888