Re: Use LW_SHARED in WakeupWalSummarizer() for WALSummarizerLock lock

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Use LW_SHARED in WakeupWalSummarizer() for WALSummarizerLock lock
Date: 2025-08-29 18:47:44
Message-ID: CAD21AoCKZ_p-h=mm6MTvsb3Vor_oroVn5AEiaTuLHOACY8PATg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 25, 2025 at 5:48 PM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
>
> On Mon, Aug 25, 2025 at 5:08 PM Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:
> >
> > On Mon, Aug 25, 2025 at 03:38:13PM -0700, Masahiko Sawada wrote:
> > > While reading walsummarizer.c code, I noticed that in
> > > WakeupWalSummarizer() we acquire the WALSummarizerLock lock in
> > > LW_EXCLUSIVE mode despite only reading
> > > WalSummarizerCtl->summarizer_pgprocno. The attached patch uses
> > > LW_SHARED mode instead. Feedback is very welcome.
> >
> > You could probably do something similar for WaitForWalSummarization().
>
> Good point. I've attached the updated patch.

Pushed.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2025-08-29 19:03:54 Re: Adding skip scan (including MDAM style range skip scan) to nbtree
Previous Message Masahiko Sawada 2025-08-29 18:47:12 Re: doc patch: missing tags in protocol.sgml