Re: Network failure may prevent promotion
Heikki Linnakangas <hlinnaka@iki.fi>
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>,
pgsql-hackers@lists.postgresql.org, Andres Freund <andres@anarazel.de>
Date: 2024-01-18T13:42:28Z
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.ntt@gmail.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)
Commits
-
Revert "libpqwalreceiver: Convert to libpq-be-fe-helpers.h"
- c5a6d5337170 16.2 landed
- 21ef4d4d8975 17.0 landed
-
libpqwalreceiver: Convert to libpq-be-fe-helpers.h
- 728f86fec655 16.0 cited