Re: Cleanup: PGProc->links doesn't need to be the first field anymore

Aleksander Alekseev <aleksander@timescale.com>

From: Aleksander Alekseev <aleksander@timescale.com>
To: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Date: 2024-07-04T12:09:15Z
Lists: pgsql-hackers
Hi Heikki,

> I tried moving it and ran the regression tests. That revealed one place
> where we still don't use dlist_container:
>
> >       if (!dlist_is_empty(procgloballist))
> >       {
> >               MyProc = (PGPROC *) dlist_pop_head_node(procgloballist);
> > ...
>
> I believe that was just an oversight. Trivial patch attached.

I tested your patch. LGTM.

PGPROC is exposed to third-party code, but since we don't change the
structure this time, the extensions will not be affected.

-- 
Best regards,
Aleksander Alekseev



Commits

  1. Lift limitation that PGPROC->links must be the first field

  2. Use dlist/dclist instead of PROC_QUEUE / SHM_QUEUE for heavyweight locks