test(ci): fedora helm PostgreSQL 15 to 18 dump/restore upgrade path#5141
test(ci): fedora helm PostgreSQL 15 to 18 dump/restore upgrade path#5141zdrapela wants to merge 12 commits into
Conversation
Validate the sclorg-supported two-hop path (POSTGRESQL_UPGRADE=copy) for RHIDP-14594 evidence on e2e-ocp-helm.
Avoid racing Playwright against a recreating postgresql pod after removing POSTGRESQL_UPGRADE. Log server_version for upgrade evidence.
Start from fedora/postgresql-15 (not rhel9 default), require the expected image before Ready, raise upgrade timeouts, enlarge PVC for copy mode, and dump pod logs when a hop stalls.
Command substitution was swallowing oc describe/logs on hop failure, and psql warnings were being treated as database names during collation refresh.
fedora/postgresql-18 advertises PREV_VERSION=16 but only ships postgresql-17 binaries, so POSTGRESQL_UPGRADE=copy from 16 never becomes Ready.
Exercise PG15 → tests → PG16 → tests → PG18 → tests, and always persist pod logs plus Playwright output under unique ARTIFACT_DIR subdirs per hop.
Use fedora/postgresql-* images. Keep POSTGRESQL_UPGRADE=copy for 15→16; use dump/restore for 16→18 because fedora/postgresql-18 lacks PG16 bins. Persist unique ARTIFACT_DIR outputs after each major.
|
/test e2e-ocp-helm |
1 similar comment
|
/test e2e-ocp-helm |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5141 +/- ##
==========================================
- Coverage 63.69% 59.96% -3.74%
==========================================
Files 123 111 -12
Lines 2424 2198 -226
Branches 573 547 -26
==========================================
- Hits 1544 1318 -226
Misses 878 878
Partials 2 2
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) Not relevant to this PR:
redhat-developer/rhdh-plugins Not relevant to this PR:
redhat-developer/rhdh-operator Not relevant to this PR:
redhat-developer/rhdh-local 1.
|
Fedora copy upgrades are unsupported; jump straight from postgresql-15 to postgresql-18 via pg_dumpall / wipe PVC / restore.
|
Updated: skip PG16 entirely — Fedora dump/restore 15 → 18 directly. /test e2e-ocp-helm |
|
The container image build workflow finished with status: |
PR Summary by QodoCI: exercise Helm internal PostgreSQL 15→16→18 Fedora upgrade with Playwright per hop
AI Description
Diagram
High-Level Assessment
Files changed (8)
|
Multi-phase PG upgrade CI left kubectl redis port-forwards bound on 16379 because stop() only signaled the shell parent. Spawn detached, kill the process group, use direct kubectl args, and fail fast when OVERALL_RESULT is already non-zero after a phase.
|
Fix for multi-phase Playwright: tear down redis port-forward process groups + fail fast when a phase already set /test e2e-ocp-helm |
|
/test e2e-ocp-helm |
|
/test e2e-ocp-helm |
…grades Capture the Backstage pod UID before dump/restore, wait until the previous UID is gone before Playwright, and seed a unique catalog Component on PG15 verified via API + UI after the PG18 restore.
|
/test e2e-ocp-helm |
In-cluster http://*.svc targets return 201 for location create but never ingest entities under Backstage URL reader / SSRF restrictions. Use a GitHub blob URL at PULL_PULL_SHA instead.
|
/test e2e-ocp-helm |
The Catalog table renders metadata.title ("PG Upgrade Data Proof"), so
exact-match on metadata.name never appears after search.
|
/test e2e-ocp-helm |
|



Summary
Companion to #5139 (RHEL
POSTGRESQL_UPGRADE=copy15→16→18) for RHIDP-14594.This PR exercises the Fedora / community chart-managed PostgreSQL path:
PG15 → (CI verification) →
pg_dumpall/ wipe PVC / restore → PG18 → (CI verification)quay.io/fedora/postgresql-15→quay.io/fedora/postgresql-18.ci/pipelines/value_files/values_showcase_15.yaml→values_showcase_18.yaml.ci/pipelines/jobs/ocp-pull.sh(handle_ocp_pull) +.ci/pipelines/lib/postgres.shshowcase-pg15,showcase-pg18(pod logs + Postgres diagnostics per phase)Why dump/restore (and why skip PG16)
Upstream does not support in-container upgrades on Fedora (sclorg/postgresql-container@b86ea1a; upgrade tests only cover RHEL/c9s/c10s). The image’s
POSTGRESQL_UPGRADE=copy|hardlinkflow (container README — Upgrading Database) needs matching previous-version binaries inside the image.In practice for Fedora images today:
quay.io/fedora/postgresql-18advertisesPOSTGRESQL_PREV_VERSION=16but shipspostgresql-17bins (no clean 16→18 hop)quay.io/fedora/postgresql-17image to bridge majorsProduct/RHEL path remains the two-hop copy upgrade in #5139.
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 / 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 chart path usesAlso useful:
pg_dumpall/ SQL dumpWhen this RHDH guidance applies
postgresql.enabled: true)quay.io/fedora/postgresql-*), not RHELPOSTGRESQL_UPGRADE=copyis not reliable (see Summary)RHDH / OpenShift delta (on top of upstream dump/restore)
Map the upstream dump/restore steps onto the chart-managed DB as follows:
SHOW server_versionand the current Postgres container image.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.
initdba fresh PG18 datadir. Keep the Postgres password Secret so RHDH credentials stay valid.postgresql.image→quay.io/fedora/postgresql-18. 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).fedora/postgresql-18, then run your normal RHDH smoke checks.What not to do on Fedora
POSTGRESQL_UPGRADE=copy/hardlinkfor this Fedora jump.Documentation B — Exact process (as implemented in this PR)
Assumptions match CI: OpenShift, Helm release
rhdh, namespaceshowcase, values under.ci/pipelines/value_files/.CI also seeds a catalog entity and runs Playwright before/after the cutover. That is test evidence for this PR, not part of the upgrade procedure in Documentation A.
Flow (CI)
Complete upgrade script (mirrors CI helpers)
Required env (fail fast if unset):
HELM_CHART_URLhelm::installCHART_VERSIONCLUSTER_ROUTER_BASEglobal.clusterRouterBaseIMAGE_REGISTRY/IMAGE_REPO/TAG_NAME--setflags (helm::get_image_params)Optional:
NS(defaultshowcase),RELEASE(defaultrhdh),DUMPFILE,VALUES_DIR,CATALOG_INDEX_*.CI entrypoints (source of truth in this PR)
handle_ocp_pullin.ci/pipelines/jobs/ocp-pull.shwait_for_postgres_readypg_dumpallpostgres_dumpall_to_filepostgres_wipe_persistent_volumehelm::install+helm::get_image_paramspostgres_restore_dumpall_filerefresh_postgres_collation_versionsget_rhdh_pod_uid/ensure_rhdh_pod_replaced/wait_for_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)Values delta (Postgres image only)
No
POSTGRESQL_UPGRADEenv is set on the Fedora path.CI-only persistence proof (not required for the upgrade itself)
Used in this PR to prove catalog rows survive dump/restore:
POST /api/catalog/locationswith a public GitHub blob URL to.ci/pipelines/resources/pg-upgrade/catalog-info.yamlGET …/entities/by-name/component/default/pg-upgrade-data-proofstill containsRHIDP-14594Test plan
/test e2e-ocp-helm— PG15 and PG18 Playwright phases greenshowcase-pg15andshowcase-pg18Related