postgresql/src/backend/storage
Heikki Linnakangas f10b6be258 Check that the tranche name is unique in RequestNamedLWLockTranche
You could request two tranches with same name, but things would get
confusing when you called GetNamedLWLockTranche() to get the LWLocks
allocated for them; it would always return the first tranche with the
name. That doesn't make sense, so forbid duplicates.

We still allow duplicates with LWLockNewTrancheId(). That works better
as you don't use the name to look up the tranche ID later. It's still
confusing in wait events, for example, but it's not dangerous in the
same way.

Reviewed-by: Sami Imseih <samimseih@gmail.com>
Discussion: https://www.postgresql.org/message-id/463a28db-0c0b-4af6-bac6-3891828bbbfe@iki.fi
2026-04-05 21:05:20 +03:00
..
aio aio: Simplify pgaio_worker_submit(). 2026-04-05 18:07:21 +12:00
buffer Merge init and max size options on shmem hash tables 2026-04-04 02:40:20 +03:00
file Don't include wait_event.h in pgstat.h 2026-03-06 16:24:58 +01:00
freespace Use UnlockReleaseBuffer() in more places 2026-03-27 15:56:29 -04:00
ipc Remove HASH_DIRSIZE, always use the default algorithm to select it 2026-04-04 02:40:28 +03:00
large_object Improve type handling of varlena structures 2026-02-11 07:33:24 +09:00
lmgr Check that the tranche name is unique in RequestNamedLWLockTranche 2026-04-05 21:05:20 +03:00
page Use AVX2 for calculating page checksums where available 2026-04-04 18:07:15 +07:00
smgr bufmgr: Don't copy pages while writing out 2026-03-27 15:56:29 -04:00
sync Don't include wait_event.h in pgstat.h 2026-03-06 16:24:58 +01:00
Makefile Split some long Makefile lists 2025-12-28 09:17:42 +09:00
meson.build Update copyright for 2026 2026-01-01 13:24:10 -05:00