temporalio / temporalio/temporal
Multiple Hosts in connection string are not handled properly (POSTGRES_SEEDS accepts only single host?)
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 23.2k
- Forks
- 1.9k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 228
Description
Expected Behavior
According to https://github.com/jackc/pgx/pull/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
- Get some Postgres cluster in master/replica mode consists of temporal-pg-host1 and temporal-pg-host2 nodes
- Modify docker-compose-postgres.yml, comment out postgres container section and set
POSTGRES_SEEDS=temporal-pg-host1,temporal-pg-host2 - 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with POSTGRES_SEEDS handling in the docker-compose-postgres.yml setup and trace the connection failure reported at handler.go:52. Reproduce the issue with two comma-separated hosts, then verify that the resulting PostgreSQL connection attempt treats them as separate hosts rather than one hostname.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker-compose, go, postgresql
- Domain
- backend, databases, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100