Files
WeKnora/scripts
3c36cb19a2 fix(deploy): bump paradedb image to v0.25.11-pg17 (#4120)
* fix(deploy): bump paradedb image to v0.25.11-pg17

Batch-importing large knowledge bases on the pinned
paradedb/paradedb:v0.22.6-pg17 image drives PostgreSQL into a
PANIC/crash-recovery loop (corrupted page pointers in shared buffers,
amcheck clean, no OOM), taking every ingest task down with it.

Three independent fixes upstream cover this exact write path, and the
pinned image predates all of them:

- pgvector 0.8.2 fixed a buffer overflow in parallel HNSW index
  builds, 0.8.3 fixed possible index corruption during HNSW vacuuming,
  and 0.8.4 fixed inserts during HNSW vacuuming; the image ships
  pgvector 0.8.1, and the embeddings table maintains three HNSW
  halfvec indexes on import.
- pg_search gained WAL-based crash recovery in 0.24.0 (paradedb#4901):
  without it, any backend crash corrupts BM25 segment metadata and
  turns a single crash into a recovery loop (paradedb#4935).
- PostgreSQL core moved 17.9 -> 17.11; its release notes contain no
  fix matching this failure signature, ruling the core out.

Bump the compose image tags to v0.25.11-pg17 (postgres and
langfuse-db-init, prod and dev) and update the docs that pin the old
tag. Fresh installs are covered by the existing schema SQL (verified
against 0.25.11: extensions, BM25 index and HNSW halfvec indexes all
create cleanly). Existing data volumes keep working across the image
swap without any action (keyword and vector queries byte-identical in
testing); ALTER EXTENSION pg_search/vector UPDATE aligns the SQL
catalog afterwards, and migration 000099 is a no-op for 0.25.x by
design. The Helm chart pins a different image line and is left alone.

Fixes #4077

* fix(migrations): upgrade pg_search catalog to 0.25.11 with the image

Swapping in the v0.25.11 image leaves the extension catalog at 0.22.x.
Calling extension functions such as paradedb.version_info() against the
mismatched catalog segfaults the backend and sends the whole server into
crash recovery, so the catalog upgrade is required rather than optional.

- Add migration 000115 to update pg_search 0.22.0-0.25.10 to 0.25.11 and
  pgvector 0.8.0-0.8.3 to 0.8.4 when the server ships those versions.
- Skip 000099 on newer images instead of advising UPDATE TO '0.22.6',
  which leaves the catalog behind the shared library and crashes.
- Rewrite the upgrade guide as one 0.22.x -> 0.25.11 path with a required
  ALTER EXTENSION UPDATE and a note that rollback needs a backup.
- Extend scripts/test_paradedb_upgrade.py to verify 0.22.2 -> 0.25.11 by
  default (--to 0.22.6 keeps the old path) and run CONCURRENTLY
  migrations outside a transaction like golang-migrate does.

---------

Co-authored-by: LuckVd <LuckVd@users.noreply.github.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-10-12 11:50:11 +08:00
..