From: jglapa (@jglapa) <noreply+jglapa@github.com>
To: pgdogdev/pgdog <noreply+pgdogdev-pgdog@github.com>
Subject: Re: [pgdogdev/pgdog] issue #1798: Passthrough auth: a fresh PgDog rejects first logins with "connection pool ... is down"
Date: Fri, 20 Nov 2026 10:55:22 +0000
Message-ID: <gh-pgdogdev-pgdog-1798-c7037735892@github.com> (raw)
In-Reply-To: <gh-pgdogdev-pgdog-1798@github.com>
References: <gh-pgdogdev-pgdog-1798@github.com>
We see the same thing
`passthrough_auth = "enabled_plain_allow_change"`, transaction mode, no `users.toml`. Each of our tenants has its own database and its own Postgres user, so every first login after a pgdog start is a new user/database pair.
In our case it is only the second bug from the report (one retry is not enough). There are no racing logins for the same user here, just several different users logging in for the first time within the same few hundred milliseconds. That is enough.
Example from today, a pod that was one minute old with 6 databases configured. Four tenants connected for the first time within about 150 ms, and two clients were rejected:
10:20:00.106 new connection requested: reason=client ... [user_a@.../db_a]
10:20:00.206 new connection requested: reason=client ... [user_b@.../db_b]
10:20:00.209 ERROR aborting new client connection, connection pool is down
10:20:00.209 new connection requested: reason=client ... [user_c@.../db_c]
10:20:00.249 ERROR aborting new client connection, connection pool is down
10:20:00.249 new connection requested: reason=client ... [user_d@.../db_d]
10:20:00.360 new server connection: ... reason=client [user_a@.../db_a]
10:20:00.360 closing server connection: state=idle, reason=other [user_a@.../db_a]
After about one second everything is stable. The client side gets SQLSTATE 58000.
It happens on every pgdog pod start: rollouts, config changes, node replacements. It gets worse with more tenants, because a scheduled job that touches all tenants right after a restart produces all the first logins at once.
I looked at the v0.1.66 source and it still looks the same to me: `passthrough_auth::add()` goes through `reload_from_config()` and replaces the whole set of pools, and `Connection::parameters()` retries once.
Two things that would help us, either one would probably be enough:
- adding a passthrough user creates only that user's pool instead of rebuilding all of them
- `parameters()` waits for reloads to settle instead of retrying once
We can't put the users in `users.toml`, the credentials live in our application and tenants are added at runtime.