chore: upgrade pgautoupgrade to 18-alpine, pin PGDATA=/var/lib/postgresql/data #3
Reference in New Issue
Block a user
No description provided.
Delete Branch "upgrade-341922a"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Upgrade the
dbsidecar topgautoupgrade/pgautoupgrade:18-alpine(Postgres major 17→18, auto-upgraded in place by pgautoupgrade on container start). Theappservice (quay.io/hedgedoc/hedgedoc:1.11.0) is unchanged (up-to-date).Extends this PR's existing 16→17 bump: the branch now carries 16→17 (prior) + 17→18 (this commit), so the diff vs
mainshows 16→18 as two incremental pgautoupgrade cycles.Image-tag table
⚠️ Required config change:
PGDATApin (NOT a plain tag bump)pgautoupgrade 18-alpine changed its default
PGDATAfrom/var/lib/postgresql/data(17-alpine and earlier) to/var/lib/postgresql/18/docker. The recipe mounts thepostgresvolume at/var/lib/postgresql/data, so without an override 18-alpine ignores the mounted volume and fresh-inits an ephemeral cluster at/var/lib/postgresql/18/docker— i.e. the existing 17 data is not upgraded and is effectively abandoned (data loss from the app's perspective; the fresh cluster has no hedgedoc tables → "relation Sessions does not exist").This PR therefore adds
PGDATA=/var/lib/postgresql/datato thedbservice environment, pinning PGDATA back to the volume mount path. With the pin, pgautoupgrade 18-alpine correctly detects the 17 data on the volume and runs the in-placepg_upgrade17→18 (verified below). This preserves existing deployments' data and the recipe's existing volume layout (no volume-path migration needed).Operator action required
pg_upgrade --link; per upstream docs, backups are expected).dbcontainer runs the one-shot 17→18 major upgrade, then starts postgres 18. Subsequent starts skip the upgrade.postgres:17.7-alpinebut states no max version; postgres 18 is wire/protocol-compatible with 17 for clients (Sequelize ORM). Verified serving below.Verification (cc-ci direct deploy,
--chaos)Deployed
dev-hedgedocwith the postgres override and observed the live upgrade path:16-alpine(fresh init) →17-alpine: pgautoupgrade ranpg_upgrade16→17 cleanly ("Automatic upgrade process finished upgrading the data format to PostgreSQL 17.10").17-alpine→18-alpinewithPGDATA=/var/lib/postgresql/data: pgautoupgrade ranpg_upgrade17→18 cleanly — "Performing Consistency Checks → Performing Upgrade → Upgrade Complete → Automatic upgrade process finished upgrading the data format to PostgreSQL 18.4 → Upgrade to PostgreSQL 18.4 complete → database system is ready to accept connections".(Without the
PGDATApin, step 2 instead fresh-init'd an empty cluster at/var/lib/postgresql/18/dockerand the app errored on missing tables — hence the pin.)Upstream release notes
18-alpine/18.4-alpinetags are published; NB the Docker Hub overview copy still says "Supports PG 9.5 thru 17.x" (stale text — the 18 tags exist and the in-place 17→18 upgrade is verified working above). Breaking change in the image: defaultPGDATAmoved to/var/lib/postgresql/18/docker— hence thePGDATApin in this PR.Recommended release
This PR does NOT bump the
coop-cloud.${STACK_NAME}.versionlabel. After merge, the operator publishes with:(
-yminor: new db major (18) via pgautoupgrade's non-breaking in-place mechanism + requiredPGDATApin; app version unchanged.)Tested green on the cc-ci recipe CI server (full suite, cold, against this PR head). NOT merged — for operator review.
cc @trav @notplants
Tested green on the cc-ci recipe CI server (full suite, cold, against this PR head). NOT merged — for operator review.
cc @trav @notplants
!testme
🌻 cc-ci —
hedgedoc@341922a2✅ passedfull logs · dashboard
chore: upgrade pgautoupgrade from 16-alpine to 17-alpineto chore: upgrade pgautoupgrade to 18-alpine, pin PGDATA=/var/lib/postgresql/data!testme
🌻 cc-ci —
hedgedoc@c236531d✅ passedfull logs · dashboard
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.