Re: Network failure may prevent promotion

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: Network failure may prevent promotion
Date: 2024-01-18 13:42:28
Message-ID: 99ac4a55-0ea3-41e5-b1bd-fca8dcd84e3c@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 18/01/2024 10:26, Kyotaro Horiguchi wrote:
> At Sun, 31 Dec 2023 20:07:41 +0900 (JST), Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> wrote in
>> We've noticed that when walreceiver is waiting for a connection to
>> complete, standby does not immediately respond to promotion
>> requests. In PG14, upon receiving a promotion request, walreceiver
>> terminates instantly, but in PG16, it waits for connection
>> timeout. This behavior is attributed to commit 728f86fec65, where a
>> part of libpqrcv_connect was simply replaced with a call to
>> libpqsrc_connect_params. This behavior can be verified by simply
>> dropping packets from the standby to the primary.
>
> Apologize for the inconvenience on my part, but I need to fix this
> behavior. To continue this discussion, I'm providing a repro script
> here.

Thanks for script, I can repro this with it.

Given that commit 728f86fec6 that introduced this issue was not strictly
required, perhaps we should just revert it for v16.

In your patch, there's one more stray reference to
ProcessWalRcvInterrupts() in the comment above libpqrcv_PQexec. That
makes me wonder, why didn't commit 728f86fec6 go all the way and also
replace libpqrcv_PQexec and libpqrcv_PQgetResult with libpqsrv_exec and
libpqsrv_get_result?

--
Heikki Linnakangas
Neon (https://neon.tech)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2024-01-18 13:51:46 Re: Emit fewer vacuum records by reaping removable tuples during pruning
Previous Message Amit Langote 2024-01-18 13:35:41 Re: remaining sql/json patches