| From: | Nick Cleaton <nick(at)cleaton(dot)net> |
|---|---|
| To: | Andrey Borodin <x4mmm(at)yandex-team(dot)ru> |
| Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Evgeny Kuzin <evgeny(dot)kuzin(at)outlook(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: [PATCH] libpq: try all addresses for a host before moving to next on target_session_attrs mismatch |
| Date: | 2026-03-07 15:01:48 |
| Message-ID: | CAPYhuRWBzaS9N8F5AWRfeSvcYaaTKr9JfPS_c3pmRtXY8Wyr6Q@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Sat, 7 Mar 2026 at 14:08, Andrey Borodin <x4mmm(at)yandex-team(dot)ru> wrote:
>
> > On 5 Mar 2026, at 19:55, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >
> > TBH, I'd say that your DNS setup is broken and you should fix it.
> > It makes no sense to have the same DNS entry pointing to both
> > read-write and read-only hosts. The proposed patch will mainly
> > result in useless connection attempts in more-sanely-constructed
> > setups.
>
> This is very desired feature by cloud providers.
>
> We sell PGaaS clusters which are just a bunch of hosts. Each of
> these hosts can became primary any time.
> Currently, when user adds more hosts they have to redeploy\reconfigure
> their app.
Somewhat related, we're using dynamic DNS to track the primary, but we
want a backup in case the dynamic DNS fails. We're using multi-host
connection strings for this, with a hostname like
"foo,foo1,foo2,foo3,foo4", where "foo" is the dynamic hostname and
"foo1"..."foo4" are CNAMEs to individual hosts. By updating the
CNAMEs, we can bring hosts in and out without reconfiguring clients.
Managing that is more complex than using a single fallback hostname
with an IP address for each host. It's annoying that we need an upper
bound on the number of potential primaries when configuring the
client. We could do better if libpq tried each IP address of a host
until it got an acceptable connection.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Henson Choi | 2026-03-07 16:02:41 | Re: Row pattern recognition |
| Previous Message | Mihail Nikalayeu | 2026-03-07 14:28:00 | Re: Adding REPACK [concurrently] |