Re: Clean up NamedLWLockTranche stuff

Nathan Bossart <nathandbossart@gmail.com>

From: Nathan Bossart <nathandbossart@gmail.com>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Andres Freund <andres@anarazel.de>, Sami Imseih <samimseih@gmail.com>, Robert Haas <robertmhaas@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2026-03-27T22:10:16Z
Lists: pgsql-hackers
On Sat, Mar 28, 2026 at 12:07:26AM +0200, Heikki Linnakangas wrote:
> LGTM, thanks! Will you commit or want me to pick it up?

I'm not able to commit it right this second, so feel free to take it.  Else
it'll probably be a day or two before I can get to it.

-- 
nathan



Commits

  1. Fix outdated comment on MainLWLockArray

  2. Fix RequestNamedLWLockTranche in single-user mode

  3. Minor comment fixes to yesterday's LWLock tranche refactoring

  4. Move ShmemIndexLock into ShmemAllocator

  5. Use ShmemInitStruct to allocate lwlock.c's shared memory

  6. Use a separate spinlock to protect LWLockTranches

  7. Refactor how user-defined LWLock tranches are stored in shmem

  8. Rename MAX_NAMED_TRANCHES to MAX_USER_DEFINED_TRANCHES

  9. Fix re-initialization of LWLock-related shared memory.