Repository navigation
Conversation
- postgres (Dockerfile.debian, used by mainnet/gnosis/lukso): postgres:18.6-bookworm, plus PostgreSQL 14 binaries used only to dump clusters from older versions. - upgrade-from-14.sh wraps docker-entrypoint.sh: when it finds a PostgreSQL 14 cluster at the volume root it dumps every database, restores into a fresh PostgreSQL 18 cluster, compares exact row counts of every table, moves the new cluster into place and disables the old one so older package versions fail closed instead of signing with stale slashing protection data. Any failure leaves the old cluster untouched and postgres down (retried on restart). - Mount postgres_data at /var/lib/postgresql for PostgreSQL 18 (the layout the 18+ images require). The mount moves to each variant; hoodi keeps Alpine 14 at /var/lib/postgresql/data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 26, 2026
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.
Draft. Stacked on #70. Shows what a PostgreSQL 14 → 18 upgrade looks like for the package. Independent of #71.
Why
postgres:14.1(Nov 2021), which is missing about 23 minor releases of fixes.What the DB holds
Only web3signer's slashing-protection data:
The data is pruned to 500 epochs, so it stays small. Keystores (
web3signer_data) and brain data (brain_data) live in other volumes and are not touched.Changes
services/postgres/Dockerfile.debian(mainnet, gnosis, lukso):postgres:18.6-bookworm. Still Debian, still uid 999.services/postgres/upgrade-from-14.sh, a wrapper around the officialdocker-entrypoint.sh:pg_dumps every database.initdbs a PG 18 cluster in a temporary directory andpg_restores into it.PGDATA.PG_VERSION, so an older package version can't start Postgres on stale slashing history. The dumps are kept in/var/lib/postgresql/upgrade-14-to-18/for manual recovery.postgres_datais now mounted at/var/lib/postgresql, the layout the 18+ images require. They refuse to start with anything mounted at/var/lib/postgresql/data. The mount moved from the root compose into each variant./var/lib/postgresql/data. Its uid-70 cluster would need its own migration.pg_upgrade: the DB is tiny, and a logical dump has no on-disk, checksum or collation coupling between versions.Testing (harness from #70: real on-chain 2.0.17 images, DAppNode-like network aliases)
initdb: directory "/var/lib/postgresql/data" exists but is not empty). Web3signer crash-loops (Failed to initialize pool). Every signing request fails, including a double vote against history recorded only on PG 18. Volume contents unchanged. (2.0.17's flyway hides thepsqlfailure and exits 0, so web3signer does start, but it can't run without its DB.)signed_attestationsfile)pg_dumpfails withPermission denied, wrapper aborts. PG 14 cluster untouched (PG_VERSIONstill 14), no PG 18 cluster in place, web3signer not running. After the fix, the next start retries and upgrades cleanly with an identical slashing DBPostgreSQL 18.6 is newer than this version of Flyway and support has not been tested. See open questionsOpen questions before this leaves draft
PG_VERSION.upgraded-to-18back, then restore from the kept dump). Is that acceptable, or should the release that ships this be marked non-rollbackable?flyway/flyway(11.10 → a release that officially supports PostgreSQL 18; current tags are 13.x) and re-run the V11 → V12 test.Real-node notes
postmaster.pidwith PID 1) was tested locally: the upgrade still succeeds.Validation of every release order (#70, #71, #72)
I tested every state
maincan end up in:Local matrix (arm64), for mainnet, gnosis, lukso and hoodi:
Real DAppNode (amd64, DAppManager 0.2.129, Docker 29.9, Compose v5.6), installed through the DAppManager installer:
Release risk outside these PRs: DAppNode's IPFS gateways sometimes cut the trustless
?format=cardownload of large images partway (terminated). On the test node, 3 registry installs failed this way. I reproduced it once from another machine, and later attempts succeeded. It fails safe (nothing is installed), but expect some "download failed" reports right after publishing; the infra team should look at it.🤖 Generated with Claude Code