Re: Clean up NamedLWLockTranche stuff

Heikki Linnakangas <hlinnaka@iki.fi>

From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Nathan Bossart <nathandbossart@gmail.com>
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-27T23:02:31Z
Lists: pgsql-hackers
On 28/03/2026 00:10, Nathan Bossart wrote:
> 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.

Ok, committed, thanks!

- Heikki




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.