From: | Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Heed lock protocol in DROP OWNED BY |
Date: | 2020-05-06 16:55:54 |
Message-ID: | E1jWNKs-0007mC-DK@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Heed lock protocol in DROP OWNED BY
We were acquiring object locks then deleting objects one by one, instead
of acquiring all object locks first, ignoring those that did not exist,
and then deleting all objects together. The latter is the correct
protocol to use, and what this commits changes to code to do. Failing
to follow that leads to "cache lookup failed for relation XYZ" error
reports when DROP OWNED runs concurrently with other DDL -- for example,
a session termination that removes some temp tables.
Author: Álvaro Herrera
Reported-by: Mithun Chicklore Yogendra (Mithun CY)
Reviewed-by: Ahsan Hadi, Tom Lane
Discussion: https://postgr.es/m/CADq3xVZTbzK4ZLKq+dn_vB4QafXXbmMgDP3trY-GuLnib2Ai1w@mail.gmail.com
Branch
------
REL9_5_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/91d97462c96e07a6885261c9d46554b1c4ce834b
Modified Files
--------------
src/backend/catalog/dependency.c | 15 +++++++++------
src/backend/catalog/pg_shdepend.c | 24 +++++++++++++++++++++++-
src/include/catalog/dependency.h | 4 ++++
3 files changed, 36 insertions(+), 7 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2020-05-06 19:58:31 | pgsql: Doc: remove now-redundant align specifications in colspecs. |
Previous Message | Tom Lane | 2020-05-06 16:24:14 | pgsql: Doc: further fooling-about with rendering of tables in PDF outpu |