Use LW_SHARED in walsummarizer.c for WALSummarizerLock lock where possible.

Masahiko Sawada <msawada@postgresql.org>

Commit: 514688656b8bca623bd2d1a28a549f8a56751612
Author: Masahiko Sawada <msawada@postgresql.org>
Date: 2025-08-29T00:06:44Z
Releases: 18.0
Use LW_SHARED in walsummarizer.c for WALSummarizerLock lock where possible.

Previously, we used LW_EXCLUSIVE in several places despite only reading
WalSummarizerCtl fields. This patch reduces the lock level to LW_SHARED
where we are only reading the shared fields.

Backpatch to 17, where wal summarization was introduced.

Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Discussion: https://postgr.es/m/CAD21AoDdKhf_9oriEYxY-JCdF+Oe_muhca3pcdkMEdBMzyHyKw@mail.gmail.com
Backpatch-through: 17

Files

PathChange+/−
src/backend/postmaster/walsummarizer.c modified +2 −2

Discussion