Re: libpq async connection and multiple hosts
От | Daniele Varrazzo |
---|---|
Тема | Re: libpq async connection and multiple hosts |
Дата | |
Msg-id | CA+mi_8bOcddzUTiLrLQD8ZXvRRnaNU1Z9iOSJCcrRuyYTWGOHw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: libpq async connection and multiple hosts (Jelte Fennema <postgres@jeltef.nl>) |
Ответы |
Re: libpq async connection and multiple hosts
|
Список | pgsql-hackers |
On Thu, 26 Oct 2023, 00:10 Jelte Fennema, <postgres@jeltef.nl> wrote:
On Wed, 25 Oct 2023 at 18:54, Daniele Varrazzo
<daniele.varrazzo@gmail.com> wrote:
> - connect_timeout
> - multiple host, hostaddr, port
> - load_balance_hosts=random
>
> Does this list sound complete?
I think you'd also want to resolve the hostnames to IPs yourself and
iterate over those one-by-one. Otherwise if the first IP returned for
the hostname times out, you will never connect to the others.
For async connections we were already unpacking and processing the hosts list, in order to perform non-blocking resolution and populate the hostaddr. This already accounted for the possibility of one host resolving to more than one address. But then we would have packed everything back into a single conninfo and made a single connection attempt.
The goal here was only non-blocking name resolution. Ahaini understand we should do is to split on the hosts for sync connections too, shuffle if requested, and make separate connection attempts.
-- Daniele
В списке pgsql-hackers по дате отправления: