Skip to content

Record PostgreSQL extensions; restore-test pgvector sets in pgvector's image; release 0.3.0 - #5

Merged
cerebrate merged 4 commits into
masterfrom
feature/pgvector-restore-test
Oct 31, 2026
Merged

cerebrate merged 4 commits into
masterfrom
feature/pgvector-restore-test

Conversation

@cerebrate

@cerebrate cerebrate commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

What

  • Manifests record extensions. Each PostgreSQL database's inventory gains extensions ({name: version}, from pg_extension). dbbackup inspect shows them, and --format env adds DBB_EXTENSIONS.
  • Restores check first. dbbackup restore refuses a destination that lacks any extension the restored databases use, naming them, before changing anything. Previously pg_restore would fail part-way through, on CREATE EXTENSION and then on everything depending on it.
  • Restore tests check them too. restore-test reports a missing extension as an error, like a missing table.
  • pgvector scratch image. scripts/restore-test.sh uses pgvector/pgvector:pg<major> as the scratch server for sets that use vector; SCRATCH_IMAGE_POSTGRES still overrides it. The summary table's scratch column is wider to fit the longer image name.
  • Docs. README and docs/restore.md updated, including what to do for other non-stock extensions, such as PostGIS.
  • Release 0.3.0. pyproject.toml, __version__, the kustomization's image tag and the image references in docs/restore.md.

Why

The new memlord target is PostgreSQL with pgvector. Restore-testing it in stock postgres:<major> would always fail, and a real recovery onto a server without pgvector should say so up front.

Notes for review

  • Old sets still restore. Only sets made by 0.3.0 and later record extensions. Sets from 0.2.x and earlier restore and restore-test as before: there's no preflight check, no extensions are compared, and the stock scratch image is used. Unit tests cover this.
  • CI's integration job now runs on ubuntu-22.04. MongoDB 8.x refuses to start on Linux 6.19 to 7.0.13 (SERVER-121912; 7.0.14 and 7.1 fix it). The ubuntu-24.04 and ubuntu-26.04 runners both have 7.0.0 now; ubuntu-22.04 still has 6.8. It's a stopgap, since 22.04's runners are retired by April 2027. The workflow comment says when to go back to ubuntu-latest.
  • plpgsql is recorded too. It's harmless, since every server has it.
  • The integration seed now creates pg_trgm (contrib, so the stock image has it) with a GIN index, so an extension is backed up and restored end to end.

Testing

  • Old sets, end to end. Sets made by the published ghcr.io/arkane-systems/db-backup:0.2.0 image (no extensions recorded; app1 uses pg_trgm) pass scripts/restore-test.sh --build: all 4 targets.
  • make lint, make test (98 passed), make integration (17 passed) and make restore-test-check (all 4 targets passed), all on a fresh stack.
  • A manual check against a pgvector/pgvector:pg18 source on port 5433, with a vector(3) column and an HNSW index:
    • The restore test picked pgvector/pgvector:pg18 and passed.
    • With SCRATCH_IMAGE_POSTGRES=postgres:18 forced, it stopped before restoring with "scratch-postgres doesn't have extension(s) the backup uses: vector (install them first)".

🤖 Generated with Claude Code

cerebrate and others added 2 commits October 31, 2026 15:42
…tor's image

Postgres manifests now list each database's extensions. A restore checks the
destination has them all before changing anything, instead of failing part-way
through pg_restore; restore-test reports a missing extension as an error; and
scripts/restore-test.sh picks pgvector/pgvector:pg<major> as the scratch image
for sets that use vector, since the stock image only has contrib extensions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sets from 0.2.x and earlier have no extensions in their inventory. They
restore and restore-test as before: there's no extension preflight or
comparison, and the stock scratch image is used. Add unit tests for that,
and say so in the restore docs.

Checked end to end: sets made by the published 0.2.0 image, one with pg_trgm
in use, pass scripts/restore-test.sh with this code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cerebrate cerebrate changed the title Record PostgreSQL extensions; restore-test pgvector sets in pgvector's image Record PostgreSQL extensions; restore-test pgvector sets in pgvector's image; release 0.3.0 Oct 31, 2026
cerebrate and others added 2 commits October 31, 2026 15:53
ubuntu-latest is now ubuntu-26.04, whose kernel is in the 6.19 to 7.0.13
range that MongoDB 8.x refuses to start on (SERVER-121912: its TCMalloc
breaks with those kernels' rseq changes; 7.0.14 and 7.1 restore the old
behaviour). Pin the integration job to ubuntu-24.04 until the newer runner
has a fixed kernel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ubuntu-24.04 runner now has the same 7.0.0 kernel as ubuntu-26.04, so
MongoDB 8.x refuses to start there too. ubuntu-22.04 still has 6.8. Its
runners are being retired by April 2027, so this is a stopgap until
ubuntu-latest has kernel 7.0.14+ or 7.1+.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cerebrate
cerebrate merged commit e2148f9 into master Oct 31, 2026
3 checks passed
@cerebrate
cerebrate deleted the feature/pgvector-restore-test branch October 31, 2026 21:08
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