Re: Modernizing our GUC infrastructure

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Modernizing our GUC infrastructure
Date: 2022-10-07 19:31:26
Message-ID: 3336389.1665171086@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
>> Attached is a patch series that attempts to modernize our GUC
>> infrastructure, in particular removing the performance bottlenecks
>> it has when there are lots of GUC variables.

> Rebased over 0a20ff54f.

Here's a v3 rebased up to HEAD. The only real change is that I added
a couple of "Assert(GetMemoryChunkContext(ptr) == GUCMemoryContext)"
checks in hopes of improving detection of not-updated code that is
still using malloc/free where it should be using guc_malloc/guc_free.
This is per the nearby discussion of whether the mcxt.c infrastructure
could recognize that [1]. I experimented a bit with leaving out parts
of the 0002 patch to simulate such mistakes, and at least on a Linux
box that seems to produce fairly intelligible errors now. In the case
of free'ing a palloc'd pointer, what you get is a message from glibc
followed by abort(), so their error detection is pretty solid too.

I'm feeling pretty good about this patchset now. Does anyone want
to review it further?

regards, tom lane

[1] https://postgr.es/m/2910981.1665080361%40sss.pgh.pa.us

Attachment Content-Type Size
0001-memory-management-preliminaries-3.patch text/x-diff 6.1 KB
0002-keep-guc-data-in-a-context-3.patch text/x-diff 31.0 KB
0003-use-dynahash-instead-of-array-3.patch text/x-diff 27.1 KB
0004-add-auxiliary-lists-3.patch text/x-diff 20.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2022-10-07 19:44:30 Re: use has_privs_of_role() for pg_hba.conf
Previous Message Israel Barth Rubio 2022-10-07 19:17:35 Re: Add support for DEFAULT specification in COPY FROM