pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Assert that we don't acquire a heavyweight lock on another objec
Date: Wed, 18 Mar 2020 01:58:33 +0000
Message-ID: <E1jENyb-0003IR-QB@gemulon.postgresql.org> (raw)

Assert that we don't acquire a heavyweight lock on another object after
relation extension lock.

The only exception to the rule is that we can try to acquire the same
relation extension lock more than once.  This is allowed as we are not
creating any new lock for this case.  This restriction implies that the
relation extension lock won't ever participate in the deadlock cycle
because we can never wait for any other heavyweight lock after acquiring
this lock.

Such a restriction is okay for relation extension locks as unlike other
heavyweight locks these are not held till the transaction end.  These are
taken for a short duration to extend a particular relation and then
released.

Author: Dilip Kumar, with few changes by Amit Kapila
Reviewed-by: Amit Kapila, Kuntal Ghosh and Sawada Masahiko
Discussion: https://postgr.es/m/CAD21AoCmT3cFQUN4aVvzy5chw7DuzXrJCbrjTU05B+Ss=Gn1LA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/15ef6ff4b985276c386adf3e11ebf7f955ea6f1f

Modified Files
--------------
src/backend/storage/lmgr/lock.c | 47 +++++++++++++++++++++++++++++++++++++++++
src/include/storage/lock.h      |  1 +
2 files changed, 48 insertions(+)



Message-ID: <E1jENyb-0003IR-QB@gemulon.postgresql.org>
Permalink:  ../E1jENyb-0003IR-QB@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jENyb-0003IR-QB@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: akapila@postgresql.org
  Subject: Re: pgsql: Assert that we don't acquire a heavyweight lock on another objec
  In-Reply-To: <E1jENyb-0003IR-QB@gemulon.postgresql.org>
  References: <E1jENyb-0003IR-QB@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