Re: deadlock while doing VACUUM and DROP

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Pavan Deolasee" <pavan(dot)deolasee(at)gmail(dot)com>
Cc: Jan Urbański <j(dot)urbanski(at)students(dot)mimuw(dot)edu(dot)pl>, "Postgres - Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: deadlock while doing VACUUM and DROP
Date: 2008-05-16 07:47:57
Message-ID: 874p8yr8pe.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Pavan Deolasee" <pavan(dot)deolasee(at)gmail(dot)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!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavan Deolasee 2008-05-16 08:53:09 Re: deadlock while doing VACUUM and DROP
Previous Message Pavan Deolasee 2008-05-16 04:33:05 Re: deadlock while doing VACUUM and DROP