K8SPG-1051 add pg 19 - #1699
Conversation
47cf684
| major-upgrade-15-to-16 | ||
| major-upgrade-16-to-17 | ||
| major-upgrade-17-to-18 | ||
| major-upgrade-18-to-19 |
There was a problem hiding this comment.
should we run this test also on every pr?
| major-upgrade-18-to-19 | ||
| major-upgrade-14-to-15-postgis | ||
| major-upgrade-15-to-16-postgis | ||
| major-upgrade-16-to-17-postgis |
There was a problem hiding this comment.
do we need a postgis test as well? for all the other versions we have it.
There was a problem hiding this comment.
@nmarukovich @gkech we have PostGIS in the community image by default. Maybe we need to have a major-upgrade-18-to-19-postgis test only for now?
There was a problem hiding this comment.
we don't have postgis for community images.
There was a problem hiding this comment.
Pull request overview
Adds PostgreSQL 19 (beta) “tech preview” support to the Percona PostgreSQL Operator by widening CRD validation bounds to 19, adding a safety validation to prevent enabling extensions without available PG19 beta packages, and introducing an E2E major-upgrade suite for 18→19 along with release image plumbing.
Changes:
- Bump CRD/schema validation maximums for PostgreSQL versions to 19 (and upgrade bounds accordingly).
- Add
PerconaPGCluster.Validate()guard to block enablingpg_cronandset_userfor PG 19 beta. - Add
major-upgrade-18-to-19KUTTL E2E suite plus release image variables for PG19 components.
Reviewed changes
Copilot reviewed 33 out of 35 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/apis/upstream.pgv2.percona.com/v1beta1/postgrescluster_types.go | Raise upstream PostgresCluster postgresVersion maximum validation to 19. |
| pkg/apis/upstream.pgv2.percona.com/v1beta1/pgupgrade_types.go | Raise upstream PGUpgrade toPostgresVersion maximum validation to 19. |
| pkg/apis/pgv2.percona.com/v2/perconapgupgrade_types.go | Extend Percona PGUpgrade version bounds to allow 18→19 upgrades. |
| pkg/apis/pgv2.percona.com/v2/perconapgcluster_types.go | Allow PG19 in spec and add PG19 beta extension enablement validation. |
| Makefile | Teach after-release-versions to maintain PG19 image variables. |
| e2e-tests/tests/major-upgrade-18-to-19/conf/major-upgrade-18-to-19.yaml | Suite config for the new 18→19 major-upgrade test. |
| e2e-tests/tests/major-upgrade-18-to-19/00-deploy-operator.yaml | Deploy operator/client/secrets for the 18→19 suite. |
| e2e-tests/tests/major-upgrade-18-to-19/00-assert.yaml | Assert operator/CRD readiness for the 18→19 suite. |
| e2e-tests/tests/major-upgrade-18-to-19/01-create-cluster.yaml | Create initial PG18 cluster and configure pg_cron for pre-upgrade. |
| e2e-tests/tests/major-upgrade-18-to-19/01-assert.yaml | Assert initial cluster resources are ready. |
| e2e-tests/tests/major-upgrade-18-to-19/02-write-data.yaml | Seed data and create extension before upgrade. |
| e2e-tests/tests/major-upgrade-18-to-19/03-read-from-primary.yaml | Read data pre-upgrade and persist as ConfigMap. |
| e2e-tests/tests/major-upgrade-18-to-19/03-assert.yaml | Assert pre-upgrade read output. |
| e2e-tests/tests/major-upgrade-18-to-19/04-upgrade.yaml | Trigger PerconaPGUpgrade from 18 to 19 with PG19 images. |
| e2e-tests/tests/major-upgrade-18-to-19/04-assert.yaml | Assert upgrade succeeded and cluster reports PG19. |
| e2e-tests/tests/major-upgrade-18-to-19/05-post-upgrade.yaml | Run post-upgrade maintenance tasks and cleanup script. |
| e2e-tests/tests/major-upgrade-18-to-19/06-write-data.yaml | Write additional data post-upgrade. |
| e2e-tests/tests/major-upgrade-18-to-19/07-run-backup.yaml | Trigger a manual full backup post-upgrade. |
| e2e-tests/tests/major-upgrade-18-to-19/07-assert.yaml | Assert backup job + CR succeeded. |
| e2e-tests/tests/major-upgrade-18-to-19/09-write-data.yaml | Write more data after backup. |
| e2e-tests/tests/major-upgrade-18-to-19/10-run-restore.yaml | Trigger restore after upgrade flow. |
| e2e-tests/tests/major-upgrade-18-to-19/10-assert.yaml | Assert restore succeeded and cluster health signals are ready. |
| e2e-tests/tests/major-upgrade-18-to-19/11-read-from-primary.yaml | Read data after restore and persist as ConfigMap. |
| e2e-tests/tests/major-upgrade-18-to-19/11-assert.yaml | Assert post-restore data includes all expected rows. |
| e2e-tests/tests/major-upgrade-18-to-19/99-remove-cluster-gracefully.yaml | Cleanup test resources and ensure operator stability. |
| e2e-tests/run-release.csv | Add 18→19 suite to release test run list. |
| e2e-tests/release_versions | Add PG19 image variables for release test runs. |
| deploy/cw-bundle.yaml | Regenerated bundle YAML reflecting PG19 schema bounds. |
| deploy/crd.yaml | Regenerated CRD YAML reflecting PG19 schema bounds. |
| deploy/bundle.yaml | Regenerated bundle YAML reflecting PG19 schema bounds. |
| config/crd/bases/upstream.pgv2.percona.com_postgresclusters.yaml | Raise upstream PostgresCluster CRD maximum to 19. |
| config/crd/bases/upstream.pgv2.percona.com_pgupgrades.yaml | Raise upstream PGUpgrade CRD maximum to 19. |
| config/crd/bases/pgv2.percona.com_perconapgclusters.yaml | Raise PerconaPGCluster CRD maximum to 19 and upgrade bounds accordingly. |
| build/crd/percona/generated/pgv2.percona.com_perconapgupgrades.yaml | Regenerated PerconaPGUpgrade CRD with updated bounds. |
| build/crd/percona/generated/pgv2.percona.com_perconapgclusters.yaml | Regenerated PerconaPGCluster CRD with updated bounds. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if ptr.Deref(ext.enabled, false) { | ||
| return errors.Errorf("spec.extensions.%s.enabled cannot be set for PostgreSQL %d: extension packages are not built for beta releases", ext.name, cr.Spec.PostgresVersion) | ||
| } |
| // Extension packages are not built for PostgreSQL 19 (beta) yet; loading them | ||
| // via shared_preload_libraries would make postgres fail to start. | ||
| // pgAudit is the exception: the PG 19 community image compiles it from source. | ||
| // Remove this check once PostgreSQL 19 goes GA and the extensions are available. | ||
| if cr.Spec.PostgresVersion >= 19 { | ||
| for _, ext := range []struct { | ||
| name string | ||
| enabled *bool | ||
| }{ | ||
| {"pg_cron", cr.Spec.Extensions.PGCron.Enabled}, | ||
| {"set_user", cr.Spec.Extensions.SetUser.Enabled}, | ||
| } { | ||
| if ptr.Deref(ext.enabled, false) { | ||
| return errors.Errorf("spec.extensions.%s.enabled cannot be set for PostgreSQL %d: extension packages are not built for beta releases", ext.name, cr.Spec.PostgresVersion) | ||
| } | ||
| } | ||
| } |
3e24bdb
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 34 out of 36 changed files in this pull request and generated no new comments.
Suppressed comments (3)
pkg/apis/pgv2.percona.com/v2/perconapgcluster_types.go:513
-
- Problem: This validation blocks
spec.extensions.pg_cron.enabled/spec.extensions.set_user.enabledfor PG19+, but it still allows the same unsupported extensions to be requested viaspec.extensions.custom, which will likely still lead to missing packages and a failing PostgreSQL start.
- Problem: This validation blocks
- Why it matters: Users (and the new major-upgrade-18-to-19 KUTTL suite) can bypass the intended block and hit runtime failures instead of getting a clear validation error.
- Fix: Also reject
spec.extensions.customentries with namespg_cronandset_userwhenspec.postgresVersion >= 19.
e2e-tests/tests/major-upgrade-18-to-19/02-write-data.yaml:20
-
- Problem: This step creates the
pg_cronextension, but the PR description statespg_cronis blocked for PostgreSQL 19 beta due to missing packages.
- Problem: This step creates the
- Why it matters: Keeping
pg_croninstalled/required prior to upgrading to PG19 can prevent the upgraded PostgreSQL from starting. - Fix: Remove this
CREATE EXTENSION pg_cronstep from the PG18→PG19 suite (or replace it with an extension supported on PG19 beta).
run_psql_local \
'\c postgres \\\ CREATE EXTENSION pg_cron' \
"postgres:$(get_psql_user_pass major-upgrade-18-to-19-pguser-postgres)@$(get_psql_user_host major-upgrade-18-to-19-pguser-postgres)"
e2e-tests/tests/major-upgrade-18-to-19/01-create-cluster.yaml:24
-
- Problem: This suite enables
pg_cronviashared_preload_librariesandspec.extensions.custom, but the PR description and webhook validation indicatepg_cronpackages are not available for PostgreSQL 19 beta.
- Problem: This suite enables
- Why it matters: After the upgrade to PG19, PostgreSQL is likely to fail to start if
pg_cronremains inshared_preload_libraries. - Fix: Remove the
pg_cronpreload/custom-extension configuration from this PG18→PG19 upgrade suite (or switch to an extension known to be available on PG19 beta, e.g. pgAudit).
.spec.patroni.removeDataDirectoryOnDivergedTimelines = true |
.spec.patroni.dynamicConfiguration.postgresql.parameters.shared_preload_libraries = \"pg_cron\" |
.spec.extensions.custom += [{\"name\": \"pg_cron\", \"version\": \"1.6.6\"}]" \
hors
left a comment
There was a problem hiding this comment.
@nmarukovich please check major-upgrade-18-to-19 test
on it. |
commit: 2ecd69d |
CHANGE DESCRIPTION
Problem:
Add PostgreSQL 19 (beta) support as tech preview: CRD bounds bumped to 19, major-upgrade-18-to-19 e2e suite added, pg_cron/set_user blocked for 19 (no beta packages). Requires pgBackRest 2.59.
https://cloud.cd.percona.com/job/pg-community-docker-build/
https://github.com/Percona-Lab/jenkins-pipelines/pull/4302/changes
percona/percona-docker#1373
Cause:
Short explanation of the root cause of the issue if applicable.
Solution:
Short explanation of the solution we are providing with this PR.
CHECKLIST
Jira
Needs Doc) and QA (Needs QA)?Tests
Config/Logging/Testability