-
Notifications
You must be signed in to change notification settings - Fork 5
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
[DPE-1454] Update database ownership #227
Conversation
src/relations/pgbouncer_provider.py
Outdated
delete_db = database not in dbs.values() | ||
if database and delete_db: | ||
self.charm.backend.remove_auth_function(dbs=[database]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the K8s PR, it seems that the auth_function
is not being removed correctly.
juju deploy postgresql --channel 14/edge
juju deploy ./pgbouncer_ubuntu-22.04-amd64.charm
juju deploy data-integrator app1
juju relate pgbouncer postgresql
juju config app1 database-name=test
juju relate app1 pgbouncer
juju run postgresql/leader get-password
psql "host={postgresql-unit-ip} user=operator dbname=test password={password}”
# Run SELECT specific_schema FROM information_schema.routines WHERE routine_name='get_auth'; which outputs pgbouncer_auth_relation_7.
juju run app1/leader get-credentials
psql "host={ip-from-get-credentials} user={user-from-get-credentials} dbname={database-name-from-get-credentials} password={password-from-get-credentials}”
# The connection works.
juju remove-relation app1 pgbouncer
psql "host={postgresql-unit-ip} user=operator dbname=test password={password}”
# Run SELECT specific_schema FROM information_schema.routines WHERE routine_name='get_auth'; which still outputs pgbouncer_auth_relation_7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unfortunately more complicated case than k8s, since the cleanup hooks are unreliable due to subordination. There's DPE-3948 to try to make things more consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Issue
Cannot drop db objects when rerelating to pgbouncer
Solution
Port of canonical/pgbouncer-k8s-operator#287