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

From Andrey Borodin
Subject Re: Add Option To Check All Addresses For Matching target_session_attr
Date
Msg-id 817CE6D9-C5E3-4625-B001-4515C72A1DD8@yandex-team.ru
Whole thread
In response to Re: Add Option To Check All Addresses For Matching target_session_attr  (Andrew Jackson <andrewjackson947@gmail.com>)
Responses Re: Add Option To Check All Addresses For Matching target_session_attr
List pgsql-hackers

> 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.


Attachment

pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: DOC: fixes multiple errors in alter table doc
Next
From: Chao Li
Date:
Subject: Re: DOC: fixes multiple errors in alter table doc