Re: [PG19] Promotion hangs behind a backend blocked on a stuck client

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: shihao zhong <zhong950419(at)gmail(dot)com>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Manu <manuelreyesbravo(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Noah Misch <noah(at)leadboat(dot)com>
Subject: Re: [PG19] Promotion hangs behind a backend blocked on a stuck client
Date: 2026-10-21 05:16:48
Message-ID: CAA4eK1LC09Tq3vTr04ppXRbyQnMb66_pgyuES2C_5ZoWfYRUrQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 21, 2026 at 6:09 AM shihao zhong <zhong950419(at)gmail(dot)com> wrote:
>
> I agree. 19 gets a note in the docs, and v6 goes to master first.
>
> The docs patch for 19 is attached. It says what blocks, how to see the
> PID, and how to get out. I am happy to change the wording.
>

<para>
+ To avoid the wait, set <varname>wal_level</varname> to
+ <literal>logical</literal> on the standby.

Will this help when the promotion is stuck? I feel this defeats the
purpose of the feature introduced in commit 67c20979ce7. Also, not
sure saying: " 15 minutes with default TCP settings" doesn't sound
like a good idea because default on Windows may be different;
additionally, if the client is alive but has stopped reading, it can
take much more time. I have tried to make it generic in the attached
(the patch is atop v20 for now).

> For (2), I think it is still worth doing on master even with v6. It
> would also cover replay of the enable record and recovery conflicts
> with a backend stuck on a client write. Manu, do you want to post it?
> If not, I am happy to take it.
>

If we anyway would like to implement killing of connections that
didn't absorb barriers then do we even need v6. I am slightly hesitant
about v6 because it adds more assumptions in the code like which
processes can have stale cache.

--
With Regards,
Amit Kapila.

Attachment Content-Type Size
fix_doc.1.patch application/octet-stream 1.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2026-10-21 05:19:29 Re: [PG19] Sequence sync stops when the subscription owner can't SET ROLE to a sequence owner
Previous Message Sho Ito 2026-10-21 05:12:12 Re: [PATCH v1] Fix tab completion for DROP INDEX CONCURRENTLY