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

CORE-250: upgrade Postgres to 16.6 #177

Merged
merged 2 commits into from
Jan 13, 2025
Merged

Conversation

davidangb
Copy link
Collaborator

@davidangb davidangb commented Jan 10, 2025

Upgrades unit tests and local development to Postgres 16.6.

The unit tests passed 10 times in a row in GHA for this PR (I re-ran it manually). I do see intermittent unit test failures when running locally - but they're not consistent, and different test cases fail on different runs. I am inclined to write that off as an environmental issue. When running locally, unit tests pass about half the time with only one test causing each failure.

We could go all the way to Postgres 17. However, Postgres 16 is the GCP default (see here) and in my opinion this is not the place to push the envelope, nor would Janitor particularly benefit from the newer version. Postgres 16 does not hit extended support charges until February 1, 2029.

@davidangb davidangb changed the title CORE-250: upgrade Postgres to 14.15 CORE-250: upgrade Postgres to 16.6 Jan 10, 2025
@@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12.3
image: postgres:16.6
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

16.6 is the version supplied by Google for CloudSQL: https://cloud.google.com/sql/docs/postgres/db-versions

CREATE ROLE dbuser WITH LOGIN ENCRYPTED PASSWORD 'dbpwd';
CREATE ROLE dbuser_stairway WITH LOGIN ENCRYPTED PASSWORD 'dbpwd_stairway';

CREATE DATABASE testdb OWNER dbuser;
CREATE DATABASE testdb_stairway OWNER dbuser_stairway;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change is necessary due to permission lockdown as of Postgres 15. https://www.percona.com/blog/public-schema-security-upgrade-in-postgresql-15/ is a good writeup of this change. Without the fix, Liquibase fails to create tables in these dbs, leading to widespread failures of everything else.

This only affects unit tests, which use a blank/empty database each time. In live environments, when we upgrade from Postgres 12 to 16, permissions should be preserved:

Upgrading a cluster or restoring a database dump will preserve public's existing permissions.

https://www.postgresql.org/docs/release/15.0/

@davidangb davidangb marked this pull request as ready for review January 13, 2025 15:21
@davidangb davidangb requested review from a team, kevinpalis and samanehsan and removed request for a team January 13, 2025 15:21
Copy link

@kevinpalis kevinpalis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@davidangb davidangb merged commit 5eeed0e into master Jan 13, 2025
3 checks passed
@davidangb davidangb deleted the da_CORE-250_postgres16 branch January 13, 2025 19:56
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

Successfully merging this pull request may close these issues.

3 participants