pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Cross-check lists of built-in LWLock tranches.
Date: Wed, 23 Jul 2025 17:06:41 +0000
Message-ID: <E1uecvQ-000O3Y-2y@gemulon.postgresql.org> (raw)

Cross-check lists of built-in LWLock tranches.

lwlock.c, lwlock.h, and wait_event_names.txt each contain a list of
built-in LWLock tranches.  It is easy to miss one or the other when
adding or removing tranches, and discrepancies have adverse effects
(e.g., breaking JOINs between pg_stat_activity and pg_wait_events).
This commit moves the lists of built-in tranches in lwlock.{c,h} to
lwlocklist.h and adds a cross-check to the script that generates
lwlocknames.h.  If the lists do not match exactly, building will
fail.

Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/aHpOgwuFQfcFMZ/B%40ip-10-97-1-34.eu-west-3.compute.internal

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2047ad068139f0b8c6da73d0b845ca9ba30fb33d

Modified Files
--------------
src/backend/storage/lmgr/generate-lwlocknames.pl | 110 +++++++++++++++++------
src/backend/storage/lmgr/lwlock.c                |  48 +---------
src/backend/utils/activity/wait_event_names.txt  |  10 ++-
src/include/storage/lwlock.h                     |  56 +++---------
src/include/storage/lwlocklist.h                 |  57 +++++++++++-
5 files changed, 162 insertions(+), 119 deletions(-)



Message-ID: <E1uecvQ-000O3Y-2y@gemulon.postgresql.org>
Permalink:  ../E1uecvQ-000O3Y-2y@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uecvQ-000O3Y-2y@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: nathan@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Cross-check lists of built-in LWLock tranches.
  In-Reply-To: <E1uecvQ-000O3Y-2y@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox