Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Hosts in connection string are not handled properly (POSTGRES_SEEDS accepts only single host?) #5693

Open
zoulja opened this issue Apr 10, 2024 · 1 comment

Comments

@zoulja
Copy link

zoulja commented Apr 10, 2024

Expected Behavior

According to jackc/pgx#545 pgx can accept multiple Postgres hosts in the format like 2.2.2.2:1,127.0.0.1,4.2.4.2
I assume that temporal passes this to a driver via POSTGRES_SEEDS env variable

Actual Behavior

From the logs I see that temporal sees string like host1,host2 as a single PG host "host1,host2" so fails to connect

temporal              | 2024-04-10T12:13:31.205Z	ERROR	Unable to connect to SQL database.	{"error": "dial tcp: lookup temporal-pg-host1,temporal-pg-host2: no such host", "logging-call-at": "handler.go:52"}

Steps to Reproduce the Problem

  1. Get some Postgres cluster in master/replica mode consists of temporal-pg-host1 and temporal-pg-host2 nodes
  2. Modify docker-compose-postgres.yml, comment out postgres container section and set POSTGRES_SEEDS=temporal-pg-host1,temporal-pg-host2
  3. Run docker compose -f docker-compose-postgres.yml up

Specifications

  • Version: Actual docker composer manifest from the official Github repo
  • Platform: MacOS, Docker Compose version v2.26.1-desktop.1
@robholland
Copy link
Contributor

We don't use pgx driver by default. Did you try with DB=postgres12_pgx?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants