Re: Add Option To Check All Addresses For Matching target_session_attr - Mailing list pgsql-hackers

From Andrew Jackson
Subject Re: Add Option To Check All Addresses For Matching target_session_attr
Date
Msg-id CAKK5BkH5sf8w2SvQ8Jrs+PBRbswDehuam4TRyvB4kC5Apoa9ag@mail.gmail.com
Whole thread
In response to Re: Add Option To Check All Addresses For Matching target_session_attr  (Evgeny Kuzin <evgeny.kuzin@outlook.com>)
List 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.

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Why clearing the VM doesn't require registering vm buffer in wal record
Next
From: Andrew Dunstan
Date:
Subject: Re: Speed up COPY FROM text/CSV parsing using SIMD