Skip to content

Use magda-io/wal-g fork build with PG15+ base backup protocol fix - #3

Merged
t83714 merged 1 commit into
mainfrom
feat/pg15-base-backup-protocol-fix
Aug 6, 2026
Merged

Use magda-io/wal-g fork build with PG15+ base backup protocol fix#3
t83714 merged 1 commit into
mainfrom
feat/pg15-base-backup-protocol-fix

Conversation

@t83714

@t83714 t83714 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Why

PostgreSQL 15 changed the BASE_BACKUP replication protocol. Every upstream wal-g release (1.1.0 – 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).

Measured against PostgreSQL 17.5, with postgres:13.7 as a control:

wal-g vs PG 17.5 (remote) vs PG 13.7
3.0.8 / 3.0.7 / 3.0.6 CompressAndEncrypt: compression failed: archive/tar: invalid tar header OK
3.0.5 / 2.0.1 / 1.1.0 42601 syntax error … repl_scanner.l OK

Upstream 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_VERSION3.0.8-magda-edcda8b
  • New WALG_REPO ARG, defaulting to magda-io/wal-g, so the source repo is a one-line override rather than an edit
  • Refreshed the stale glibc comment — the binary is now copied into a Debian 12 bookworm image, not Debian 11

The 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 has 9bcccbd — PR #2262 — as an ancestor)

Verification

Before publishing the fork release:

  • backup-push (remote mode) against PG 17.5backup-listbackup-fetch → server start on restored data → all 5000 seeded rows returned intact
  • No regression against PG 13.7 — required, since PG13 instances must keep being backed up during the migration window
  • Extraction + sha256sum -c verified on a minideb:bullseye (glibc 2.31) base
  • Max glibc symbol: GLIBC_2.3.4 (amd64), GLIBC_2.17 (aarch64)

After this Dockerfile change, both platforms were built locally from the published release:

$ docker run --rm --entrypoint /usr/local/bin/wal-g magda-wal-g-verify:arm64 --version
wal-g version v3.0.8-magda-edcda8b	edcda8bb	PostgreSQL

$ docker run --rm --platform linux/amd64 --entrypoint /usr/local/bin/wal-g magda-wal-g-verify:amd64 --version
wal-g version v3.0.8-magda-edcda8b	edcda8bb	PostgreSQL

Releasing

package.json stays at 3.0.8check-release-version.js compares only the part before the first -, so a release tagged v3.0.8-magda-edcda8b passes unchanged. release.yml will tag the image ghcr.io/magda-io/magda-wal-g:3.0.8-magda-edcda8b and correctly not move :latest, since the version contains a -.

Revert path

Set WALG_REPO=wal-g/wal-g and WALG_VERSION to an upstream release once one includes PR #2262.

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
@t83714
t83714 merged commit 196b870 into main Aug 6, 2026
2 checks passed
@t83714
t83714 deleted the feat/pg15-base-backup-protocol-fix branch August 6, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant