pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Introduce group locking to prevent parallel processes from deadl
Date: Sun, 07 Feb 2016 15:23:15 +0000
Message-ID: <E1aSRBD-0006kV-CQ@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Introduce group locking to prevent parallel processes from deadlocking.

For locking purposes, we now regard heavyweight locks as mutually
non-conflicting between cooperating parallel processes.  There are some
possible pitfalls to this approach that are not to be taken lightly,
but it works OK for now and can be changed later if we find a better
approach.  Without this, it's very easy for parallel queries to
silently self-deadlock if the user backend holds strong relation locks.

Robert Haas, with help from Amit Kapila.  Thanks to Noah Misch and
Andres Freund for extensive discussion of possible issues with this
approach.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/a1c1af2a1f6099c039f145c1edb52257f315be51

Modified Files
--------------
src/backend/access/transam/parallel.c |  16 ++
src/backend/storage/lmgr/README       |  63 ++++++++
src/backend/storage/lmgr/deadlock.c   | 279 +++++++++++++++++++++++++++-------
src/backend/storage/lmgr/lock.c       | 122 ++++++++++++---
src/backend/storage/lmgr/proc.c       | 158 ++++++++++++++++++-
src/include/storage/lock.h            |  13 +-
src/include/storage/proc.h            |  12 ++
7 files changed, 587 insertions(+), 76 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


view thread (25+ messages)  latest in thread

Message-ID: <E1aSRBD-0006kV-CQ@gemulon.postgresql.org>
Permalink:  ../E1aSRBD-0006kV-CQ@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1aSRBD-0006kV-CQ@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: rhaas@postgresql.org
  Subject: Re: pgsql: Introduce group locking to prevent parallel processes from deadl
  In-Reply-To: <E1aSRBD-0006kV-CQ@gemulon.postgresql.org>
  References: <E1aSRBD-0006kV-CQ@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