Re: Add Option To Check All Addresses For Matching target_session_attr

From: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
To: Andrew Jackson <andrewjackson947(at)gmail(dot)com>
Cc: Navrotskiy Artem <bozaro(at)yandex(dot)ru>, Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>, Dave Page <dpage(at)pgadmin(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Evgeny Kuzin <evgeny(dot)kuzin(at)outlook(dot)com>
Subject: Re: Add Option To Check All Addresses For Matching target_session_attr
Date: 2026-03-06 06:44:20
Message-ID: 817CE6D9-C5E3-4625-B001-4515C72A1DD8@yandex-team.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 16 Aug 2025, at 04:43, Andrew Jackson <andrewjackson947(at)gmail(dot)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 Content-Type Size
check_all_addrs_variations.txt text/plain 3.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-03-06 06:48:57 Re: DOC: fixes multiple errors in alter table doc
Previous Message Fujii Masao 2026-03-06 06:40:30 Re: DOC: fixes multiple errors in alter table doc