Re: Proposal: recent access based routing for primary-replica setups

From: Nadav Shatz <nadav(at)tailorbrands(dot)com>
To: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Cc: pgpool-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Proposal: recent access based routing for primary-replica setups
Date: 2025-08-25 12:50:58
Message-ID: CACeKOO3cgZFAWw_tJ5CtjQt4NSiw4ORz-uTUJW5Zq2CxHWuiFw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgpool-hackers

Hi Tatsuo,

Thank you for the notes - please find attached an updated version.

What do you think?

Thanks,

On Mon, Aug 25, 2025 at 5:18 AM Tatsuo Ishii <ishii(at)postgresql(dot)org> wrote:

> Hi Nadav,
>
> Thank you for the patch!
>
> I have one question. How do you provide a password (sr_check_password)
> while executing replication_delay_source_cmd as sr_check_user? In my
> understanding replication_delay_source_cmd is executed through su
> command in your patch. In this case su command tries to read the
> password from terminal. I don't see such a code in the patch.
>
> BTW, I start to think that executing replication_delay_source_cmd as
> sr_check_user might not be a good idea. sr_check_user is a database
> user, not OS user. In PostgreSQL they are not necessarily the
> same. Also doing su in pgpool process needs to be very carefully to
> avoid vulnerability. Probably we just execute it as pgpool OS user?
>
> Lastly when I apply the patches using git apply, there are some
> trailing space errors.
>
> $ git apply ~/external-lag-feature-implementation.patch
> /home/t-ishii/external-lag-feature-implementation.patch:314: trailing
> whitespace.
>
> /home/t-ishii/external-lag-feature-implementation.patch:317: trailing
> whitespace.
>
> /home/t-ishii/external-lag-feature-implementation.patch:318: trailing
> whitespace.
> cmd_len = strlen(escaped_cmd) +
> /home/t-ishii/external-lag-feature-implementation.patch:320: trailing
> whitespace.
>
> /home/t-ishii/external-lag-feature-implementation.patch:322: trailing
> whitespace.
> snprintf(full_command, cmd_len, "su - %s -c '%s'",
> warning: squelched 4 whitespace errors
> warning: 9 lines add whitespace errors.
>
> $ git apply ~/external-lag-feature-tests.patch
> /home/t-ishii/external-lag-feature-tests.patch:87: trailing whitespace.
> - test_parsing.sh: Unit test for parsing logic
> /home/t-ishii/external-lag-feature-tests.patch:440: trailing whitespace.
> # Test 2: Float values
> warning: 2 lines add whitespace errors.
>
> Also I have some compilation errors after patching the source
> code. See attached compilation log.
>
> Best regards,
> --
> Tatsuo Ishii
> SRA OSS K.K.
> English: http://www.sraoss.co.jp/index_en/
> Japanese:http://www.sraoss.co.jp
>

--
Nadav Shatz
Tailor Brands | CTO

Attachment Content-Type Size
changes.patch application/octet-stream 35.3 KB

In response to

Responses

Browse pgpool-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2025-08-26 01:41:55 Re: Proposal: recent access based routing for primary-replica setups
Previous Message Tatsuo Ishii 2025-08-25 02:18:25 Re: Proposal: recent access based routing for primary-replica setups