Re: [ADMIN] Vacuum error on database postgres - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: [ADMIN] Vacuum error on database postgres
Date
Msg-id 20060915094055.GD1608@svana.org
Whole thread Raw
In response to Re: [ADMIN] Vacuum error on database postgres  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [ADMIN] Vacuum error on database postgres  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, Sep 14, 2006 at 06:25:42PM -0400, Tom Lane wrote:
> Jeff Davis <pgsql@j-davis.com> writes:
> > How would creating a new lock type avoid deadlocks when an ANALYZE is
> > accumulating the locks in random order?
>
> In itself it wouldn't.  Josh Drake sketched the idea in more detail
> later: if there is a lock type used *only* for ANALYZE, then you can do
> ConditionalLockAcquire on it, and if you fail, skip the table on the
> assumption that someone else is already doing what you came to do.

Wouldn't it be useful for ANALYZE to do a conditional lock anyway and
skip if it can't acquire. Especially for the analyse-from-autovacuum
case, perhaps an ANALYSE NOLOCK or whatever.

For stuff run from autovacuum, would it be reasonable for the
automatically run version to just abort if it sees someone doing the
same thing?

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: New version of money type
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Fixed length data types issue