Re: 048_vacuum_horizon_floor.pl hangs due to wakeup lost inside LockBufferForCleanup

From: Xuneng Zhou <xunengzhou(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Alexander Lakhin <exclusion(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 048_vacuum_horizon_floor.pl hangs due to wakeup lost inside LockBufferForCleanup
Date: 2026-06-30 02:25:48
Message-ID: CABPTF7WnAK=tcHQraUSMOD2ff57tgt-k6ejV9EOxHOGX-Pdx+g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 30, 2026 at 9:40 AM Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>
> On Sat, Jun 27, 2026 at 10:56 AM Xuneng Zhou <xunengzhou(at)gmail(dot)com> wrote:
> > > As far as I read the patch, it looks good to me, so I'm inclined to
> > > commit it unless another committer on this thread would like to do so.
> > > But any objections?
> > >
> > > BTW, since the issue was introduced by commits 5310fac6e0f and
> > > c75ebc657ffc, this fix only needs to be applied to master.
> > > Is that correct?
> >
> > I think this is true.
>
> I've pushed the patch. Thanks!

Thanks for pushing!

There seems to be a small nit in the commit message. It says:

"As a result, LockBufferForCleanup() can sleep indefinitely because
the wakeup corresponding to the last conflicting unpin has already been
missed."

Other backends can still pin the buffer and do the final unpin to
unleash the VACUUM process as Andres pointed out upthread. So the
consequence would be more like a no guaranteed wake-up than an
indefinite waiting. However, the possibility of indefinite waiting is
still there as the reported failed test case shows. It seems better to
say like this

"As a result, LockBufferForCleanup() can sleep indefinitely in the
worst case because a future wakeup from unpinner is unguaranteed."

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2026-06-30 02:33:08 PROPERTY GRAPH pg_dump ACL minimization
Previous Message Thomas Munro 2026-06-30 02:16:47 Re: Per-thread leak in ECPG's memory.c