Re: Rare deadlock failure in create_am test - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Rare deadlock failure in create_am test
Date
Msg-id 20200904142033.GA8294@alvherre.pgsql
Whole thread Raw
In response to Rare deadlock failure in create_am test  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Rare deadlock failure in create_am test  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: Report error position in partition bound check
Next
From: Alvaro Herrera
Date:
Subject: Re: Division in dynahash.c due to HASH_FFACTOR