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: Acquire ProcArrayLock exclusively in ProcArrayClearTransaction.
Date: Thu, 20 Aug 2020 01:35:57 +0000
Message-ID: <E1k8ZUj-00051o-7o@gemulon.postgresql.org> (raw)

Acquire ProcArrayLock exclusively in ProcArrayClearTransaction.

This corrects an oversight by me in 20729324078, which made
ProcArrayClearTransaction() increment xactCompletionCount. That requires an
exclusive lock, obviously.

There's other approaches that avoid the exclusive acquisition, but given that a
2PC commit is fairly heavyweight, it doesn't seem worth doing so. I've not been
able to measure a performance difference, unsurprisingly.  I did add a
comment documenting that we could do so, should it ever become a bottleneck.

Reported-By: Tom Lane <tgl@sss.pgh.pa.us>
Author: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/1355915.1597794204@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1fe1f42e3e85279e1cb8b004b3b076a04bde4cee

Modified Files
--------------
src/backend/storage/ipc/procarray.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)



Message-ID: <E1k8ZUj-00051o-7o@gemulon.postgresql.org>
Permalink:  ../E1k8ZUj-00051o-7o@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1k8ZUj-00051o-7o@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: Acquire ProcArrayLock exclusively in ProcArrayClearTransaction.
  In-Reply-To: <E1k8ZUj-00051o-7o@gemulon.postgresql.org>
  References: <E1k8ZUj-00051o-7o@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