Re: Deadlock detector fails to activate on a hot standby replica - Mailing list pgsql-hackers

From Xuneng Zhou
Subject Re: Deadlock detector fails to activate on a hot standby replica
Date
Msg-id CABPTF7V2wgjqN6g99uxR_RjGYCLo07e8ogWWTyAqMfzAGg5j_g@mail.gmail.com
Whole thread
In response to Re: Deadlock detector fails to activate on a hot standby replica  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: Deadlock detector fails to activate on a hot standby replica
List pgsql-hackers
Hi Fujii-san, Vitaly,


On Thu, Jun 25, 2026 at 8:14 PM Fujii Masao <masao.fujii@gmail.com> wrote:
>
> On Thu, Jun 25, 2026 at 12:16 AM Vitaly Davydov
> <v.davydov@postgrespro.ru> wrote:
> >
> > Dear Fujii Masao
> >
> > I've prepared patches of v6 for other majors. I hope, it will help.

Thanks for working on this. I haven't looked into the patch in detail
yet. The overall direction seems good to me. Here are two comments on
the first look:

1) It looks that this patch is doing some refactoring around
LockBufferForCleanup. The part being touched seems flaky itself on
HEAD, should we fix the issue in the buffer side first? [1]

> Thanks for the patches for the stable branches!
>
> I noticed that you added "buf_state &= ~BM_PIN_COUNT_WAITER;" to
> BufferIsReadyForCleanup(). Could you tell me why that's necessary? My
> understanding was that LockBufferForCleanup() is responsible for
> clearing that flag, so I didn't think it was needed here.
>
> But if it is necessary, I'd like to make the same change in master as
> well, to keep the code as consistent as possible between master and
> the stable branches.

2) buf_state &= ~BM_PIN_COUNT_WAITER in stable versions seems not
necessary to me as LockBufferForCleanup will handle the clearing for
us.

[1] https://www.postgresql.org/message-id/flat/7685519a-0bf9-4e17-93ca-7e3aa10fa29c%40gmail.com

--
Regards,
Xuneng Zhou
HighGo Software Co., Ltd.



pgsql-hackers by date:

Previous
From: Arne Roland
Date:
Subject: Re: Key joins
Next
From: Dilip Kumar
Date:
Subject: Re: Proposal: Conflict log history table for Logical Replication