test(ci): operator Fedora PostgreSQL 15 to 18 dump/restore upgrade path#5145
test(ci): operator Fedora PostgreSQL 15 to 18 dump/restore upgrade path#5145zdrapela wants to merge 6 commits into
Conversation
Exercise RHIDP-14594 on e2e-ocp-operator-nightly: dump/wipe/restore operator-managed Fedora Postgres (RELATED_IMAGE_postgresql), prove catalog data survives, and wait for Backstage pod replacement before Playwright.
|
/test e2e-ocp-operator-nightly |
PR Summary by QodoCI: verify operator-local Fedora PostgreSQL 15→18 dump/restore upgrade path
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5145 +/- ##
==========================================
- Coverage 63.69% 59.96% -3.74%
==========================================
Files 123 111 -12
Lines 2424 2198 -226
Branches 572 527 -45
==========================================
- Hits 1544 1318 -226
- Misses 878 879 +1
+ Partials 2 1 -1
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
46 rules✅ Skills:
e2e-verify-fix, e2e-diagnose-and-fix✅ Cross-repo context Explored:
repo: redhat-developer/rhdh-chart (sha: e476f298) Explored:
repo: redhat-developer/rhdh-operator (sha: cde4968e) Not relevant to this PR:
redhat-developer/rhdh-plugins Not relevant to this PR:
redhat-developer/rhdh-local 1. Wrong default proof repo
|
Full install+CRD cycles with OLM diagnostics, always use 3 attempts on OCP operator nightly, and satisfy prefer-unicode-regexp in the proof spec.
|
/test e2e-ocp-operator-nightly |
Auto-detected OLM v1 can exit successfully without registering the Backstage CRD. Use classic Subscription install, stream script output, and fail fast if Subscription/rhdh is missing after install.
|
/test e2e-ocp-operator-nightly |
Lightspeed default flavour pulls a missing OCI digest and CrashLoops install-dynamic-plugins before PG upgrade verification can run.
|
/test e2e-ocp-operator-nightly |
OLM was reverting oc set env on the operator Deployment back to the CSV RHEL postgresql-15 image, so the post-wipe STS never came up on Fedora 18.
|
/test e2e-ocp-operator-nightly |
|
@zdrapela: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Backstage CRD can appear before the operator Deployment exists; pin via Subscription first, then wait for the controller env to match.
|
/test e2e-ocp-operator-nightly |
|



Summary
Companion to #5141 (Helm Fedora dump/restore) and #5139 (RHEL Helm
POSTGRESQL_UPGRADE=copy) for RHIDP-14594.This PR exercises the Operator-local Fedora PostgreSQL path on
e2e-ocp-operator-nightly:PG15 → (CI verification) →
pg_dumpall/ wipe PVC / restore → PG18 → (CI verification)RELATED_IMAGE_postgresql=quay.io/fedora/postgresql-15:latestquay.io/fedora/postgresql-18:latest(viaoc set envon the operator controller).ci/pipelines/jobs/ocp-operator.sh(handle_ocp_operator) +.ci/pipelines/lib/postgres.shshowcase-operator-pg15,showcase-operator-pg18Why dump/restore (and why skip PG16)
Same Fedora constraints as #5141:
quay.io/fedora/postgresql-18advertisesPOSTGRESQL_PREV_VERSION=16but shipspostgresql-17binsquay.io/fedora/postgresql-17imageThe Operator already defaults to Fedora PG15 for local DB (
RELATED_IMAGE_postgresql), so this is the natural community/operator path.Documentation A — General guidance (operators / docs)
Use this for product/community docs. Do not restate the full PostgreSQL upgrade procedure — follow upstream and only call out RHDH Operator / OpenShift specifics.
Upstream procedure (source of truth)
Major-version upgrades that move data with a logical dump are documented here:
pg_dumpall→ new cluster →psqlrestore)pg_upgrade, logical replication) are not what this Fedora operator-local path usesAlso useful:
pg_dumpall/ SQL dumpWhen this RHDH guidance applies
spec.database.enableLocalDb: true, default)quay.io/fedora/postgresql-*viaRELATED_IMAGE_postgresqlon the operator Deployment / CSV)POSTGRESQL_UPGRADE=copyis not reliable (see Summary)RHDH Operator / OpenShift delta (on top of upstream dump/restore)
Map the upstream dump/restore steps onto the operator-managed local DB as follows:
SHOW server_versionand the current Postgres container image onbackstage-psql-<cr-name>-0.pg_dumpall(logical backup of all DBs/roles). Keep the dump until verification succeeds.Note: Upstream prefers dumping with the newer client when both majors can run in parallel. With a single PVC this path dumps from the old pod before wipe.
RELATED_IMAGE_postgresqlon the RHDH operator controller Deployment toquay.io/fedora/postgresql-18:latestand wait for the operator rollout to complete. The operator injects this image into the local DB StatefulSet on reconcile.backstage-psql-<cr-name>StatefulSet and its PVC so the next reconcile caninitdba fresh PG18 datadir. Keep thebackstage-psql-secret-<cr-name>Secret so RHDH credentials stay valid.postgresql-18and is Ready. Do not setPOSTGRESQL_UPGRADE(this is not a copy upgrade).psql(see upstream). Image init may already create roles/globals; tolerate benign “already exists” errors, then confirm application databases.ALTER DATABASE … REFRESH COLLATION VERSIONonpostgres,template1, and user databases (common post-major cleanup; not a substitute for upstream migration notes).backstage-<cr-name>Deployment and wait until the previous pod UID is gone and a new Ready pod exists before trusting the instance.fedora/postgresql-18, then run your normal RHDH smoke checks.What not to do on Fedora (operator-local)
POSTGRESQL_UPGRADE=copy/hardlinkfor this Fedora jump.backstage-psql-secret-<cr-name>) when wiping the PVC unless you also reconfigure RHDH.RELATED_IMAGE_postgresql— the operator will reconcile the image back from the env var.CI flow (this PR)
CI entrypoints
handle_ocp_operatorin.ci/pipelines/jobs/ocp-operator.shset_operator_postgresql_related_imagewait_for_postgres_readypg_dumpallpostgres_dumpall_to_filepostgres_wipe_persistent_volumepostgres_restore_dumpall_filerefresh_postgres_collation_versionsget_rhdh_pod_uid/ensure_rhdh_pod_replacedseed_pg_upgrade_data_proof/assert_pg_upgrade_data_proof_apie2e-tests/playwright/e2e/pg-upgrade-data-proof.spec.ts(PG_UPGRADE_DATA_PROOF=1)Test plan
/test e2e-ocp-operator-nightly— PG15 and PG18 Playwright phases greenshowcase-operator-pg15andshowcase-operator-pg18Related
Made with Cursor