Add assert to ensure that page locks don't participate in deadlock cycle.
authorAmit Kapila <[email protected]>
Thu, 19 Mar 2020 02:41:45 +0000 (08:11 +0530)
committerAmit Kapila <[email protected]>
Thu, 19 Mar 2020 02:41:45 +0000 (08:11 +0530)
commit72e78d831ab5550c39f2dcc7cc5d44c406ec3dc2
tree78d8528b569a834c79478d8d3acf4f20aaeb1913
parent6312c08a291fc34068571ec64ee439f2674d739a
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
src/backend/storage/lmgr/lock.c