Re: Add Option To Check All Addresses For Matching target_session_attr

Andrey Borodin <x4mmm@yandex-team.ru>

From: Andrey Borodin <x4mmm@yandex-team.ru>
To: Andrew Jackson <andrewjackson947@gmail.com>
Cc: Navrotskiy Artem <bozaro@yandex.ru>, Vladimir Sitnikov <sitnikov.vladimir@gmail.com>, Dave Page <dpage@pgadmin.org>, pgsql-hackers <pgsql-hackers@postgresql.org>, Evgeny Kuzin <evgeny.kuzin@outlook.com>
Date: 2026-03-06T06:44:20Z
Lists: pgsql-hackers

Attachments


> On 16 Aug 2025, at 04:43, Andrew Jackson <andrewjackson947@gmail.com> wrote:
> 
> Attached is the rebased patch.

I've took a look into the patch again.

The behavior and integration with the connection state machine look correct, 
and the tests + docs are in good shape. Some notes:
1. Use a dedicated default "0" for check_all_addrs (not DefaultLoadBalanceHosts,
   this one is used for load balancing, need more "0").
2. Guard the two strcmp(conn->check_all_addrs, "1") uses so they are safe when
   conn->check_all_addrs is NULL.
3. Fix the test typos in 008 (standby_expeect_traffic and the three “on node1”
   messages).
4. Parse check_all_addrs once into a bool (like load_balance_type) and use that
   in the connection path for consistency and clarity.

Now about important part: is the name "check_all_addrs" good?
I've asked LLM after explaining it what the feature does. PFA attached output.

Personally, I like "try_all_addrs".

It's a bit unclear to me how randomization (load balancing) on different
addresses should work.


Best regards, Andrey Borodin.

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Support connection load balancing in libpq