Re: Add Option To Check All Addresses For Matching target_session_attr

From: Andrew Jackson <andrewjackson947(at)gmail(dot)com>
To: Evgeny Kuzin <evgeny(dot)kuzin(at)outlook(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add Option To Check All Addresses For Matching target_session_attr
Date: 2026-03-05 21:15:26
Message-ID: CAKK5BkH5sf8w2SvQ8Jrs+PBRbswDehuam4TRyvB4kC5Apoa9ag@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

While I prefer your solution, I suspect that it would not be possible/worth
it to change the behavior at this point. It seems likely there is some
niche setup out there that relies on the current logic in some capacity.

I can imagine something along the lines of: someone sets up a hostname that
points to 2 IP records that each use different network infra or something
like that. In the case where you are looking for a primary you would not
want to duplicatively check the same host in this scenario because you
already confirmed that it is not the one you are looking for. With your
patch you would be increasing connection latency, probably not by that much
granted but this is the scenario that encouraged me to implement this as a
new parameter.

All that being said I'm fine with either patch and would love to see one of
them get merged. I suspect there are a lot of extraneous haproxy's that
have been set up in the wild that would be unneeded if one of our our
patches were merged and the changes proliferate to downstream drivers.

One note on your patch though: you may want to incorporate the unit tests
that I built out for this patch in yours.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2026-03-05 21:25:14 Re: Speed up COPY FROM text/CSV parsing using SIMD
Previous Message Andres Freund 2026-03-05 21:01:07 Re: Why clearing the VM doesn't require registering vm buffer in wal record