Skip to content

Commit 8a78144

Browse files
Quick104claude
andcommitted
fix(omnibus): load the image's PostgreSQL settings on any data directory
A data directory the image did not create, such as one moved from the Compose stack's postgres container, had no include_dir line, so the socket-only listener and System V shared memory never applied: it listened on every interface and used POSIX shared memory under Docker's 64 MB /dev/shm. init-postgres now adds the line whenever it is missing. Moving that directory is still not the way to migrate: the Compose stack's pgvector image runs an older glibc, so PostgreSQL reports a collation version mismatch. The architecture note now says so instead of claiming text sorts the same in both, and restores the paragraph an earlier edit cut short. The major-version refusal message no longer points at the removed docs/omnibus-image.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 8eef0a7 commit 8a78144

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

‎docs/architecture/omnibus-image.md‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,14 @@ superuser and authenticates by peer, so no database password exists. Silo needs
7575
the superuser role for `POSTGRES_TUNE`, which uses `ALTER SYSTEM`, and its
7676
migrations create the `vector`, `pg_trgm`, and `citext` extensions. The cluster
7777
uses `en_US.UTF-8`, the locale of the `pgvector/pgvector` image in the Compose
78-
stack, so text sorts the same in both. `init-postgres` rewrites
79-
`conf.d/00-omnibus.conf` on every start; `P## Search settings
78+
stack. That image's glibc can differ from this one's, so a data directory moved
79+
between them reports a collation version mismatch and needs its text indexes
80+
rebuilt; moving an install between the two goes through `pg_dump` and
81+
`pg_restore` instead. `init-postgres` rewrites `conf.d/00-omnibus.conf` on
82+
every start and makes sure `postgresql.conf` includes `conf.d`;
83+
`POSTGRES_TUNE` writes `postgresql.auto.conf`, which loads after it.
84+
85+
## Search settings
8086

8187
With `ENABLE_MEILISEARCH=true`, `init-config` exports `SILO_SEARCH_PROVIDER`,
8288
`SILO_MEILISEARCH_URL`, and `SILO_MEILISEARCH_API_KEY` for the bundled instance,

‎omnibus/rootfs/etc/s6-overlay/scripts/init-postgres‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ if [[ -s "$PGDATA/PG_VERSION" ]]; then
1616
cat >&2 <<MSG
1717
/config/postgres/data was written by PostgreSQL $have but this image ships PostgreSQL $PG_MAJOR.
1818
Start the previous image, dump the silo database with pg_dump, move the old data
19-
directory aside, then start this image and restore the dump. See docs/omnibus-image.md.
19+
directory aside, then start this image and restore the dump. The user manual's
20+
omnibus image page describes the steps.
2021
MSG
2122
exit 1
2223
fi
@@ -31,6 +32,12 @@ else
3132
s6-setuidgid postgres initdb -D "$PGDATA" -U silo \
3233
--encoding=UTF8 --locale=en_US.UTF-8 \
3334
--auth-local=peer --auth-host=scram-sha-256 >/dev/null
35+
fi
36+
37+
# The image's settings live in conf.d. A data directory this image did not
38+
# create, such as one moved from another PostgreSQL container, lacks the line
39+
# that loads them.
40+
if ! grep -q "^include_dir = 'conf.d'" "$PGDATA/postgresql.conf"; then
3441
printf "\ninclude_dir = 'conf.d'\n" >> "$PGDATA/postgresql.conf"
3542
fi
3643

0 commit comments

Comments
 (0)