Re: Improve LWLock tranche name visibility across backends

From: Sami Imseih <samimseih(at)gmail(dot)com>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: Nathan Bossart <nathandbossart(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Improve LWLock tranche name visibility across backends
Date: 2025-08-06 04:24:04
Message-ID: CAA5RZ0txvpg7pZGRt2aUmBck8rVK1nUZkwpu=ehyL6kmHd_apQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> I'll fix this in the next rev.

v5 fixes the above 2 issues found above.

For the issue that was throwing ".... segment that has been freed",
indeed we should be freeing LWLockTrancheNames.shmem->list_ptr,
list_ptr is a dsa_pointer that stores an array of dsa_pointers, which
then made me realize that I was not freeing the actual dsa_pointers
holding the tranche names. I fixed that as well.

I also made some improvements to the code that copies the old
list to the new list and fixed the lookup in
GetLWTrancheName.

--
Sami

Attachment Content-Type Size
v5-0001-Implement-a-DSA-for-LWLock-tranche-names.patch application/octet-stream 31.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2025-08-06 04:41:46 Enhance Makefiles to rebuild objects on map file changes
Previous Message Fujii Masao 2025-08-06 04:20:18 Re: Doc: Add note for running ANALYZE after ALTER TABLE ... SET EXPRESSION