pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Collect built-in LWLock tranche names statically, not dynamicall
Date: Thu, 14 May 2020 15:10:42 +0000
Message-ID: <E1jZFVS-00042N-8X@gemulon.postgresql.org> (raw)

Collect built-in LWLock tranche names statically, not dynamically.

There is little point in using the LWLockRegisterTranche mechanism for
built-in tranche names.  It wastes cycles, it creates opportunities for
bugs (since failing to register a tranche name is a very hard-to-detect
problem), and the lack of any centralized list of names encourages
sloppy nonconformity in name choices.  Moreover, since we have a
centralized list of the tranches anyway in enum BuiltinTrancheIds, we're
certainly not buying any flexibility in return for these disadvantages.

Hence, nuke all the backend-internal LWLockRegisterTranche calls,
and instead provide a const array of the builtin tranche names.

(I have in mind to change a bunch of these names shortly, but this
patch is just about getting them into one place.)

Discussion: https://postgr.es/m/9056.1589419765@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/29c3e2dd5a6aeaf1a23d7d83d665501e2dcc6955

Modified Files
--------------
src/backend/access/transam/slru.c        |   3 -
src/backend/access/transam/xlog.c        |   5 +-
src/backend/replication/logical/origin.c |   3 -
src/backend/replication/slot.c           |   3 -
src/backend/storage/buffer/buf_init.c    |   3 -
src/backend/storage/ipc/procarray.c      |   2 -
src/backend/storage/lmgr/lwlock.c        | 259 ++++++++++++++++++++-----------
7 files changed, 168 insertions(+), 110 deletions(-)



Message-ID: <E1jZFVS-00042N-8X@gemulon.postgresql.org>
Permalink:  ../E1jZFVS-00042N-8X@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jZFVS-00042N-8X@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Collect built-in LWLock tranche names statically, not dynamicall
  In-Reply-To: <E1jZFVS-00042N-8X@gemulon.postgresql.org>
  References: <E1jZFVS-00042N-8X@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