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

Don't get new tuning options when upgrading from revision 323 to 331 #250

Closed
mthaddon opened this issue Oct 13, 2023 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@mthaddon
Copy link

mthaddon commented Oct 13, 2023

Steps to reproduce

juju deploy postgresql --channel=14/edge --revision=323 pg-upgraded
juju deploy postgresql --channel=14/edge --revision=331 pg-not-upgraded
# Wait for units to deploy

# We wouldn't expect this unit to have shared_buffers yet in this file
juju ssh pg-upgraded/0 sudo grep shared_buff /var/snap/charmed-postgresql/common/var/lib/postgresql/postgresql.conf
# It doesn't

# We would expect this unit to have shared_buffers in this file
juju ssh pg-not-upgraded/0 sudo grep shared_buff /var/snap/charmed-postgresql/common/var/lib/postgresql/postgresql.conf
$ shared_buffers = '12550MB'

juju refresh pg-upgraded --revision=331 --channel=14/edge



# Wait for upgrade to finish

machine-0: 15:42:11 INFO juju.downloader downloading from ch:amd64/jammy/postgresql-331
machine-0: 15:42:11 INFO juju.downloader download complete ("ch:amd64/jammy/postgresql-331")
machine-0: 15:42:11 INFO juju.downloader download verified ("ch:amd64/jammy/postgresql-331")
unit-pg-upgraded-0: 15:42:17 INFO juju.worker.uniter found queued "upgrade-charm" hook
unit-pg-upgraded-0: 15:42:17 INFO unit.pg-upgraded/0.juju-log Running legacy hooks/upgrade-charm.
unit-pg-upgraded-0: 15:42:18 ERROR unit.pg-upgraded/0.juju-log Cluster upgrade failed, ensure pre-upgrade checks are ran first.
unit-pg-upgraded-0: 15:42:18 INFO juju.worker.uniter.operation ran "upgrade-charm" hook (via hook dispatching script: dispatch)
unit-pg-upgraded-0: 15:42:18 INFO juju.worker.uniter found queued "config-changed" hook
unit-pg-not-upgraded-0: 15:42:19 WARNING unit.pg-not-upgraded/0.juju-log No relation: certificates
unit-pg-upgraded-0: 15:42:19 INFO juju.worker.uniter.operation ran "config-changed" hook (via hook dispatching script: dispatch)
unit-pg-not-upgraded-0: 15:41:18 WARNING unit.pg-not-upgraded/0.upgrade-relation-changed error: snap "charmed-postgresql" has no "exporter" configuration option
unit-pg-not-upgraded-0: 15:41:18 WARNING unit.pg-not-upgraded/0.juju-log upgrade:5: Early exit update_config: Trying to reset metrics service with no configuration set
unit-pg-not-upgraded-0: 15:41:19 INFO juju.worker.uniter.operation ran "upgrade-relation-changed" hook (via hook dispatching script: dispatch)
unit-pg-not-upgraded-0: 15:41:20 INFO unit.pg-not-upgraded/0.juju-log database-peers:3: Starting cluster topology observer process
unit-pg-not-upgraded-0: 15:41:20 INFO unit.pg-not-upgraded/0.juju-log database-peers:3: Started cluster topology observer process with PID 18184
unit-pg-not-upgraded-0: 15:41:21 INFO juju.worker.uniter.operation ran "database-peers-relation-changed" hook (via hook dispatching script: dispatch)
unit-pg-upgraded-0: 15:42:11 INFO juju.worker.uniter.charm downloading ch:amd64/jammy/postgresql-331 from API server
unit-pg-not-upgraded-0: 15:42:19 INFO juju.worker.uniter.operation ran "update-status" hook (via hook dispatching script: dispatch)
^C

# We would now expect this unit to have shared_buffers in this file
juju ssh pg-upgraded/0 sudo grep shared_buff /var/snap/charmed-postgresql/common/var/lib/postgresql/postgresql.conf
# It doesn't

Expected behavior

Upgraded charm should have new tuning options

Actual behavior

Versions

Operating system: 22.04

Juju CLI: 3.1.6

Juju agent: 3.1.6

Charm revision:

LXD: 5.18

Log output

As above

Additional context

@mthaddon mthaddon added the bug Something isn't working label Oct 13, 2023
@github-actions
Copy link
Contributor

@mthaddon
Copy link
Author

Here's the output of /var/snap/charmed-postgresql/current/etc/patroni/patroni.yaml in case that's relevant https://pastebin.ubuntu.com/p/ycc8fWrN7C/

@marceloneppel
Copy link
Member

Thanks for the report and all the logs, Tom.

The latest revision from 14/edge channel has the fix for this issue.

You can try with the following commands (note that you need to run the pre-upgrade-check action before refreshing the charm):

juju deploy postgresql --channel=14/edge --revision=323 pg-upgraded
juju deploy postgresql --channel=14/edge --revision=336 pg-not-upgraded

juju ssh pg-upgraded/0 sudo grep shared_buff /var/snap/charmed-postgresql/common/var/lib/postgresql/postgresql.conf

juju ssh pg-not-upgraded/0 sudo grep shared_buff /var/snap/charmed-postgresql/common/var/lib/postgresql/postgresql.conf

juju run pg-upgraded/leader pre-upgrade-check
juju refresh pg-upgraded --revision=336 --channel=14/edge

juju ssh pg-upgraded/0 sudo grep shared_buff /var/snap/charmed-postgresql/common/var/lib/postgresql/postgresql.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants