Re: [ADMIN] Vacuum error on database postgres

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: andy <andy(at)squeakycode(dot)net>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [ADMIN] Vacuum error on database postgres
Date: 2006-09-14 21:57:25
Message-ID: 1158271045.29889.143.camel@dogma.v10.wvs
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

On Thu, 2006-09-14 at 11:20 -0400, Tom Lane wrote:
> andy <andy(at)squeakycode(dot)net> writes:
> > Tom Lane wrote:
> >> andy <andy(at)squeakycode(dot)net> writes:
> This behavior dates from a time when there was no good alternative.
> One possible fix today would be to make ANALYZE take
> ShareUpdateExclusive lock instead, thus ensuring there is only one
> ANALYZE at a time on a table. However I'm a bit concerned by the
> possibility that ANALYZE-inside-a-transaction could accumulate a
> whole bunch of such locks in a random order, leading at least to
> a risk of deadlocks against other ANALYZEs. (We have to hold the
> lock till commit, else we aren't fixing the problem.) Do we need a
> specialized lock type just for ANALYZE? Would sorting the target
> list of rel OIDs be enough? Perhaps it's not worth worrying about?
>

How would creating a new lock type avoid deadlocks when an ANALYZE is
accumulating the locks in random order?

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2006-09-14 22:25:42 Re: [ADMIN] Vacuum error on database postgres
Previous Message Tomeh, Husam 2006-09-14 21:51:23 Re: psql command

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Conway 2006-09-14 22:08:48 Re: Release notes
Previous Message Joshua D. Drake 2006-09-14 21:36:22 Re: Mid cycle release?