Re: Lock problem with autovacuum truncating heap

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Jan Wieck <JanWieck(at)yahoo(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Lock problem with autovacuum truncating heap
Date: 2011-03-28 02:28:27
Message-ID: 17960.1301279307@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Sun, Mar 27, 2011 at 3:25 PM, Jan Wieck <JanWieck(at)yahoo(dot)com> wrote:
>> Since we are talking about stable releases, I think just releasing and
>> reacquiring the exclusive lock is enough. We can then try to further improve
>> things for future releases.

> That seems unsafe - things can change under you while you don't hold the lock...

And more to the point, it wouldn't actually fix anything, unless you
chop things up so finely that autovac is never holding the lock for more
than milliseconds. (I believe it wouldn't even be enough if you could
guarantee that autovac didn't hold the lock for more than
deadlock_timeout, because some other process could reach the timeout and
run the deadlock detector very shortly after autovac acquires its lock.)

I don't believe that *any* of what's being discussed here is suitable
material for back-patching. And it's not material for 9.1, either.
The time for rewriting VACUUM for 9.1 was three months ago.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-03-28 02:31:41 Re: Re: [COMMITTERS] pgsql: Fix plpgsql to release SPI plans when a function or DO block is
Previous Message Robert Haas 2011-03-28 01:51:14 Re: Lock problem with autovacuum truncating heap