Repository navigation
Postgres 16 → 18 (needs a dump/restore at deploy, see runbook) - #117
Merged
Merged
Conversation
Postgres 18 images keep PGDATA at /var/lib/postgresql/18/docker, so the volume mounts at /var/lib/postgresql. Prod gets a new pg18_data volume and the 16.x cluster in pg_data is kept untouched as the rollback copy; data moves by pg_dumpall/restore (see the PR for the runbook). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015bPJkYdnfm2KVcEzTiJuSM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warning
Draft on purpose. This needs a manual data migration at deploy time. Deploying it with a plain
up -dstarts Postgres 18 on an empty volume. The app would create a fresh schema and serve normally with no accounts, passkeys or history. Nothing would be destroyed (the old cluster stays inpg_data), but new writes would go to the empty database. Follow the runbook below.Stacked on #113. Merge that first, and this PR retargets to
mainby itself.Postgres 16.15 → 18.6 in prod (digest-pinned), and
16-alpine→18-alpinein dev, design and CI.Why a new volume
Postgres majors don't share an on-disk format, and the 18 image moved
PGDATAto/var/lib/postgresql/18/docker(the volume now mounts at/var/lib/postgresql). Prod gets a freshpg18_datavolume.pg_data(the 16.x cluster) is left untouched as the rollback copy. The data moves bypg_dumpall/restore, which is fine for an 83 MB database.Runbook (prod, about 2 minutes of downtime)
Rollback: check out the previous commit and
$C up -d postgres. It remountspg_datawith 16.x exactly as it was when you stopped it.The dump contains the
tensiesrole's password hash, which carries over into the restore. That's harmless in prod, where it's the samePOSTGRES_PASSWORD.Dev stack: it also moves to a new
pg18_datavolume, so local dev starts with an empty database.tensies-dev_pg_datastays on disk.Verified locally, using a real dump of prod
pg_dumpallof prod (read-only) restored intopostgres:18.6-alpineon a fresh volume mounted at/var/lib/postgresql. Row counts match prod exactly: users 3/3, webauthn_credentials 3/3, events 84,473/84,473./api/leaderboardserved the real leaderboard, the multi-instance WebSocket test passed 16/16, and telemetry writes landed (events 84,473 → 84,569).docker compose configvalidates all three compose files.🤖 Generated with Claude Code
https://claude.ai/code/session_015bPJkYdnfm2KVcEzTiJuSM