Re: [PATCH] Prevent repeated deadlock-check signals in standby buffer pin waits

From: JoongHyuk Shin <sjh910805(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Álvaro Herrera <alvherre(at)kurilemu(dot)de>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Vitaly Davydov <v(dot)davydov(at)postgrespro(dot)ru>, zsolt(dot)parragi(at)percona(dot)com, tanswis42(at)gmail(dot)com
Subject: Re: [PATCH] Prevent repeated deadlock-check signals in standby buffer pin waits
Date: 2026-06-03 08:27:17
Message-ID: CACSdjfNicWdgiX9RDSWiAkUKhnpiEEG5__2SauvH5c+a8CEUKA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thanks for the reviews.

v3 attached.

* Emit "recovery still waiting" inside the function.
It now fires at deadlock_timeout instead of max_standby_streaming_delay
(Ilmar).

* Pass waitStart and &logged_recovery_conflict from the caller;
the in-function branch reuses the same gate.

* An early-return alternative reopens a race in the
SetStartupBufferPinWaitBufId(-1) gap; the lock path has
no equivalent because its caller is structured differently.

* Covered by src/test/recovery/t/054_bufferpin_conflict_log_timing.pl
(FAIL on v2, PASS on v3).

--
JH Shin

On Fri, May 29, 2026 at 3:31 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:

> On Fri, May 22, 2026 at 05:41:03PM +0900, JoongHyuk Shin wrote:
> > This patch addresses the opposite,
> > deadlock_timeout does fire, but LockBufferForCleanup loops back and
> re-arms
> > it, so the signal repeats once per second.
>
> Right. I don't really see why this should be backpatched. One
> argument would be more consistency of this area of the code across all
> the stable branches, but the argument is kind of moot as this does not
> fix a problem, just improves a bit what we have.
> --
> Michael
>

Attachment Content-Type Size
v3-0001-Prevent-repeated-deadlock-check-signals-in-standb.patch application/octet-stream 13.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2026-06-03 08:40:43 Re: [PATCH] Fix overflow and underflow in regr_r2()
Previous Message Chao Li 2026-06-03 08:18:47 Re: Fix regression in vacuumdb --analyze-in-stages for partitioned tables