pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Improve and cleanup ProcArrayAdd(), ProcArrayRemove().
Date: Sat, 12 Jun 2021 04:42:41 +0000
Message-ID: <E1lrvTl-0002f4-C0@gemulon.postgresql.org> (raw)

Improve and cleanup ProcArrayAdd(), ProcArrayRemove().

941697c3c1a changed ProcArrayAdd()/Remove() substantially. As reported by
zhanyi, I missed that due to the introduction of the PGPROC->pgxactoff
ProcArrayRemove() does not need to search for the position in
procArray->pgprocnos anymore - that's pgxactoff. Remove the search loop.

The removal of the search loop reduces assertion coverage a bit - but we can
easily do better than before by adding assertions to other loops over
pgprocnos elements.

Also do a bit of cleanup, mostly by reducing line lengths by introducing local
helper variables and adding newlines.

Author: zhanyi <w@hidva.com>
Author: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/tencent_5624AA3B116B3D1C31CA9744@qq.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d8e950d3ae7b33a2064a4fb39b7829334b0b47bc

Modified Files
--------------
src/backend/storage/ipc/procarray.c | 133 +++++++++++++++++++++---------------
1 file changed, 78 insertions(+), 55 deletions(-)



Message-ID: <E1lrvTl-0002f4-C0@gemulon.postgresql.org>
Permalink:  ../E1lrvTl-0002f4-C0@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lrvTl-0002f4-C0@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de
  Subject: Re: pgsql: Improve and cleanup ProcArrayAdd(), ProcArrayRemove().
  In-Reply-To: <E1lrvTl-0002f4-C0@gemulon.postgresql.org>
  References: <E1lrvTl-0002f4-C0@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox