pgsql: Add assert to ensure that page locks don't participate in deadlo

From: Amit Kapila <akapila(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add assert to ensure that page locks don't participate in deadlo
Date: 2020-03-19 02:53:20
Message-ID: E1jElJA-00042D-A5@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add assert to ensure that page locks don't participate in deadlock cycle.

Assert that we don't acquire any other heavyweight lock while holding the
page lock except for relation extension. However, these locks are never
taken in reverse order which implies that page locks will never
participate in the deadlock cycle.

Similar to relation extension, page locks are also held for a short
duration, so imposing such a restriction won't hurt.

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/72e78d831ab5550c39f2dcc7cc5d44c406ec3dc2

Modified Files
--------------
src/backend/storage/lmgr/lock.c | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2020-03-19 06:33:28 pgsql: Rename the recovery-related wait events.
Previous Message Michael Paquier 2020-03-19 02:26:17 Re: pgsql: walreceiver uses a temporary replication slot by default