Use magda-io/wal-g fork build with PG15+ base backup protocol fix - #3
Merged
Conversation
PostgreSQL 15 changed the BASE_BACKUP replication protocol. Every upstream wal-g release (1.1.0 through 3.0.8) fails `backup-push` against PostgreSQL 15+ in remote mode -- the mode Magda's backup CronJob uses (`backup-push` with no $PGDATA argument). Against PostgreSQL 17.5, 3.0.6-3.0.8 fail with "archive/tar: invalid tar header" and 1.1.0-3.0.5 fail earlier with a 42601 replication-grammar syntax error. The same versions succeed against 13.7. Upstream PR #2262 fixes this but merged 2026-05-22, four months after v3.0.8, and no upstream release contains it yet. Point WALG_REPO at magda-io/wal-g and pin v3.0.8-magda-edcda8b (master@edcda8bb, published in upstream's own release layout so the download-and-verify logic is unchanged). WALG_REPO is an ARG so this can be pointed back at wal-g/wal-g once an upstream release includes PR #2262. Also refresh the stale glibc comment: the binary is now COPY'd into a Debian 12 bookworm image, not Debian 11. Refs: wal-g/wal-g#2262, wal-g/wal-g#2044, wal-g/wal-g#1385, wal-g/wal-g#2005
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.
Why
PostgreSQL 15 changed the
BASE_BACKUPreplication protocol. Every upstream wal-g release (1.1.0 – 3.0.8) failsbackup-pushagainst PostgreSQL 15+ in remote mode — the mode Magda's backup CronJob uses (backup-pushwith no$PGDATAargument).Measured against PostgreSQL 17.5, with
postgres:13.7as a control:CompressAndEncrypt: compression failed: archive/tar: invalid tar header42601 syntax error … repl_scanner.lUpstream issues: wal-g/wal-g#2044, wal-g/wal-g#1385 ("backup-push does not work on the Postgresql 15/16 without $PGDATA in command line"), wal-g/wal-g#2005.
The fix is wal-g/wal-g#2262, merged upstream 2026-05-22 — four months after v3.0.8 (2026-01-21). No upstream release contains it, and upstream's cadence is irregular (3.0.7 Apr 2024, 3.0.5 Jan 2025, 3.0.8 Jan 2026).
This blocks Magda's PostgreSQL 13.7 → 17.5 upgrade: without it, PG17 would ship with no working base backups.
What changed
WALG_VERSION→3.0.8-magda-edcda8bWALG_REPOARG, defaulting tomagda-io/wal-g, so the source repo is a one-line override rather than an editThe fork release publishes artifacts in upstream's own layout (
wal-g-pg-20.04-{amd64,aarch64}.tar.gz+.sha256), so the download-and-verify logic is untouched. Built on Ubuntu 20.04 / glibc 2.31, matching upstream, keeping it runnable on this image's bullseye base.Release: https://github.com/magda-io/wal-g/releases/tag/v3.0.8-magda-edcda8b (master@
edcda8bb, which has9bcccbd— PR #2262 — as an ancestor)Verification
Before publishing the fork release:
backup-push(remote mode) against PG 17.5 →backup-list→backup-fetch→ server start on restored data → all 5000 seeded rows returned intactsha256sum -cverified on aminideb:bullseye(glibc 2.31) baseGLIBC_2.3.4(amd64),GLIBC_2.17(aarch64)After this Dockerfile change, both platforms were built locally from the published release:
Releasing
package.jsonstays at3.0.8—check-release-version.jscompares only the part before the first-, so a release taggedv3.0.8-magda-edcda8bpasses unchanged.release.ymlwill tag the imageghcr.io/magda-io/magda-wal-g:3.0.8-magda-edcda8band correctly not move:latest, since the version contains a-.Revert path
Set
WALG_REPO=wal-g/wal-gandWALG_VERSIONto an upstream release once one includes PR #2262.