Skip to content

Fix postgres 18+ volume mount so fresh volumes can boot#27

Merged
WolfieLeader merged 1 commit into
mainfrom
audit/postgres18-mount
Jul 3, 2026
Merged

Fix postgres 18+ volume mount so fresh volumes can boot#27
WolfieLeader merged 1 commit into
mainfrom
audit/postgres18-mount

Conversation

@WolfieLeader

Copy link
Copy Markdown
Owner

Problem

postgres:18+ official images refuse to boot when a named volume is mounted at the legacy /var/lib/postgresql/data path (docker-library/postgres#1259). Our dev stack only stayed green because its postgres container predated the 18.4 image bump and was never recreated; after the first real teardown, no postgres boot succeeded anywhere:

  • dev stack (just db-up): postgres exits 1 on boot
  • benchmark client's own stack: composeDown runs down -v, so it always cold-boots a fresh volume and failed 100% of the time

Fix

Mount the named volume at /var/lib/postgresql (the 18+ recommended new-deployment form; data goes to the version subdirectory, enabling pg_upgrade --link later). Dev data is disposable seed data — migrate with docker compose down -v + just db-up.

Verification

  • Cold boot on destroyed volumes: all 4 DBs healthy, cassandra-init exited 0, init.sql applied (users table present)
  • node scripts/contract.mts go-chi --build: 87/87
  • node scripts/verify.mts root: PASS
  • Fresh-context review: correct, no findings; confirmed no other repo reference assumes the old path

Note for Phase 2: the metrics-postgres container must use this same mount pattern.

The 18+ official images store data in a version subdirectory under
/var/lib/postgresql and refuse to boot when a volume is mounted at the
legacy /var/lib/postgresql/data path. The dev stack only stayed green
because its postgres container predated the 18.4 image bump and was
never recreated; any fresh boot (dev or the benchmark client's own
stack) failed. Data is disposable dev seed data - recreate with
'docker compose down -v' + 'just db-up'.
@WolfieLeader
WolfieLeader merged commit 4352d01 into main Jul 3, 2026
@WolfieLeader
WolfieLeader deleted the audit/postgres18-mount branch July 3, 2026 23:12
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