From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Rare deadlock failure in create_am test
Date: Fri, 4 Sep 2020 10:20:33 -0400
Message-ID: <20200904142033.GA8294@alvherre.pgsql> (raw)
In-Reply-To: <839004.1599185607@sss.pgh.pa.us>
On 2020-Sep-03, Tom Lane wrote:
> So it's not hard to understand the problem: DROP of an index AM, cascading
> to an index, will need to acquire lock on the index and then lock on the
> index's table. Any other operation on the table, like say autovacuum,
> is going to acquire locks in the other direction.
Oh, of course.
> I'm inclined to think that the best fix is to put
>
> begin;
> lock table [fast_emp4000];
> ...
> commit;
>
> around the DROP CASCADE.
Yeah, sounds good.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: alvherre@2ndquadrant.com, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
Subject: Re: Rare deadlock failure in create_am test
In-Reply-To: <20200904142033.GA8294@alvherre.pgsql>
* 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