Re: Use LW_SHARED in WakeupWalSummarizer() for WALSummarizerLock lock

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Masahiko Sawada <sawada(dot)mshk(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-26 00:08:15
Message-ID: aKz675ziP-VbINoQ@nathan
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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().

--
nathan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2025-08-26 00:14:40 Re: Improve LWLock tranche name visibility across backends
Previous Message Andres Freund 2025-08-25 23:48:17 Re: index prefetching