Re: deadlock while doing VACUUM and DROP - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: deadlock while doing VACUUM and DROP
Date
Msg-id 874p8yr8pe.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: deadlock while doing VACUUM and DROP  ("Pavan Deolasee" <pavan.deolasee@gmail.com>)
Responses Re: deadlock while doing VACUUM and DROP  ("Pavan Deolasee" <pavan.deolasee@gmail.com>)
Re: deadlock while doing VACUUM and DROP  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
"Pavan Deolasee" <pavan.deolasee@gmail.com> writes:

> Alternatively, we can just acquire AccessExclusiveLock on the main relation
> before proceeding with the recursive deletion. That would solve this case,
> but may be there are other similar deadlocks waiting to happen. 

Surely we should be locking the relation before even doing the dependency scan
or else someone else can come along and add more dependencies after we've
started the scan?

> Also I am not sure if the issue is big enough to demand the change.

I think it is, effectively what we have now is "your DDL could fail randomly
for reasons that are out of your control" :(

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's 24x7 Postgres support!


pgsql-hackers by date:

Previous
From: "Pavan Deolasee"
Date:
Subject: Re: deadlock while doing VACUUM and DROP
Next
From: "Pavan Deolasee"
Date:
Subject: Re: deadlock while doing VACUUM and DROP