Skip to content

K8SPG-1051 add pg 19 - #1699

Open
nmarukovich wants to merge 16 commits into
mainfrom
K8SPG-1051
Open

K8SPG-1051 add pg 19#1699
nmarukovich wants to merge 16 commits into
mainfrom
K8SPG-1051

Conversation

@nmarukovich

@nmarukovich nmarukovich commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

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

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are all needed new/changed options added to the Helm Chart?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported PG version?
  • Does the change support oldest and newest supported Kubernetes version?

egegunes
egegunes previously approved these changes Jul 28, 2026
eleo007
eleo007 previously approved these changes Jul 28, 2026
gkech
gkech previously approved these changes Jul 29, 2026
mayankshah1607
mayankshah1607 previously approved these changes Aug 3, 2026
pooknull
pooknull previously approved these changes Aug 6, 2026
egegunes
egegunes previously approved these changes Aug 11, 2026
mayankshah1607
mayankshah1607 previously approved these changes Aug 11, 2026
@egegunes egegunes added this to the v3.1.0 milestone Aug 13, 2026
Comment thread e2e-tests/run-release.csv
major-upgrade-15-to-16
major-upgrade-16-to-17
major-upgrade-17-to-18
major-upgrade-18-to-19

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should we run this test also on every pr?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added

Comment thread e2e-tests/run-release.csv
major-upgrade-18-to-19
major-upgrade-14-to-15-postgis
major-upgrade-15-to-16-postgis
major-upgrade-16-to-17-postgis

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do we need a postgis test as well? for all the other versions we have it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yeap I agree! Let's have it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we don't have postgis for community images.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 enabling pg_cron and set_user for PG 19 beta.
  • Add major-upgrade-18-to-19 KUTTL 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.

Comment on lines +397 to +399
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)
}
Comment on lines +385 to +401
// 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)
}
}
}
@nmarukovich
nmarukovich dismissed stale reviews from mayankshah1607, pooknull, and egegunes via 3e24bdb August 18, 2026 11:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

    1. Problem: This validation blocks spec.extensions.pg_cron.enabled/spec.extensions.set_user.enabled for PG19+, but it still allows the same unsupported extensions to be requested via spec.extensions.custom, which will likely still lead to missing packages and a failing PostgreSQL start.
  1. 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.
  2. Fix: Also reject spec.extensions.custom entries with names pg_cron and set_user when spec.postgresVersion >= 19.
    e2e-tests/tests/major-upgrade-18-to-19/02-write-data.yaml:20
    1. Problem: This step creates the pg_cron extension, but the PR description states pg_cron is blocked for PostgreSQL 19 beta due to missing packages.
  1. Why it matters: Keeping pg_cron installed/required prior to upgrading to PG19 can prevent the upgraded PostgreSQL from starting.
  2. Fix: Remove this CREATE EXTENSION pg_cron step 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

    1. Problem: This suite enables pg_cron via shared_preload_libraries and spec.extensions.custom, but the PR description and webhook validation indicate pg_cron packages are not available for PostgreSQL 19 beta.
  1. Why it matters: After the upgrade to PG19, PostgreSQL is likely to fail to start if pg_cron remains in shared_preload_libraries.
  2. Fix: Remove the pg_cron preload/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\"}]" \

gkech
gkech previously approved these changes Aug 18, 2026

@hors hors left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@nmarukovich please check major-upgrade-18-to-19 test

@nmarukovich

Copy link
Copy Markdown
Contributor Author

@nmarukovich please check major-upgrade-18-to-19 test

on it.

@JNKPercona

Copy link
Copy Markdown
Collaborator
Test Name Result Time
backup-enable-disable passed 00:00:00
builtin-extensions passed 00:00:00
custom-extensions passed 00:16:49
cert-manager-tls passed 00:13:13
cert-management-policy passed 00:00:00
custom-envs passed 00:00:00
custom-tls passed 00:00:00
database-init-sql passed 00:00:00
demand-backup passed 00:00:00
demand-backup-offline-snapshot passed 00:00:00
dynamic-configuration passed 00:00:00
extra-volumes passed 00:00:00
finalizers passed 00:00:00
init-deploy passed 00:00:00
huge-pages passed 00:00:00
logical-replica passed 00:11:35
major-upgrade-14-to-15 passed 00:00:00
major-upgrade-15-to-16 passed 00:11:26
major-upgrade-16-to-17 passed 00:00:00
major-upgrade-17-to-18 passed 00:16:11
major-upgrade-18-to-19 passed 00:00:00
ldap passed 00:00:00
ldap-tls passed 00:00:00
logcollection passed 00:00:00
monitoring passed 00:00:00
one-pod passed 00:00:00
repo-host-autogrow passed 00:00:00
operator-self-healing failure 01:30:13
pgbouncer passed 00:00:00
pg-tde passed 00:00:00
pg-tde-wal-encrypt passed 00:00:00
pitr passed 00:00:00
scaling passed 00:00:00
scheduled-backup passed 00:00:00
self-healing passed 00:00:00
sidecars passed 00:00:00
standby-pgbackrest passed 00:00:00
standby-streaming passed 00:00:00
start-from-backup passed 00:00:00
start-from-volumes passed 00:00:00
tablespaces passed 00:00:00
telemetry-transfer passed 00:00:00
upgrade-consistency passed 00:00:00
upgrade-minor passed 00:00:00
users passed 00:00:00
migration-from-crunchy-standby passed 00:00:00
migration-from-crunchy-pv passed 00:00:00
migration-from-crunchy-backup-restore passed 00:00:00
Summary Value
Tests Run 48/48
Job Duration 02:07:52
Total Test Time 02:39:29

commit: 2ecd69d
image: perconalab/percona-postgresql-operator:PR-1699-2ecd69de4

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.

9 participants