Re: Use LW_SHARED in WakeupWalSummarizer() for WALSummarizerLock lock - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Re: Use LW_SHARED in WakeupWalSummarizer() for WALSummarizerLock lock
Date
Msg-id CAD21AoBi6_YVdjMupppOuhRq_SBPFYJuiJER+CCcisZWA_ZZcg@mail.gmail.com
Whole thread Raw
In response to Re: Use LW_SHARED in WakeupWalSummarizer() for WALSummarizerLock lock  (Nathan Bossart <nathandbossart@gmail.com>)
List pgsql-hackers
On Mon, Aug 25, 2025 at 5:08 PM Nathan Bossart <nathandbossart@gmail.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.

Regards,

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

Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Non-reproducible AIO failure
Next
From: "David G. Johnston"
Date:
Subject: Re: END is not a reserved word