Re: Autovacuum cancellation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Autovacuum cancellation
Date: 2007-10-25 21:35:46
Message-ID: 26532.1193348146@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers pgsql-patches

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> Patch attached, please comment. It only avoids cancelling when the
> vacuum is for wraparound.

I'm not entirely convinced that there can be only one autovac proc in
the portion of the waits-for graph explored by DeadlockCheck. If there
is more than one, we'll cancel a random one of them, which seems OK ---
but the comment added to FindLockCycleRecurse is bogus.

I thought about suggesting that we test PROC_VACUUM_FOR_WRAPAROUND
before setting blocking_autovacuum_proc at all, but I guess the reason
you don't do that is you don't want to take ProcArrayLock there (and we
decided it was unsafe to check the bit without the lock). So the other
thing that comment block needs is a note that it seems OK to check
PROC_IS_AUTOVACUUM without the lock, because it never changes for an
existing PGPROC, but not PROC_VACUUM_FOR_WRAPAROUND.

Otherwise it looks OK --- a bit ugly but I don't have a better idea.

There's some things still to be desired here: if an autovac process is
involved in a hard deadlock, the patch doesn't favor zapping it over
anybody else, nor consider cancelling the autovac as an alternative to
rearranging queues for a soft deadlock. But dealing with that will open
cans of worms that I don't think we want to open for 8.3.

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Gregory Stark 2007-10-25 22:28:39 Re: Autovacuum cancellation
Previous Message David Fetter 2007-10-25 21:04:58 Re: [HACKERS] Re: pgsql: Extract catalog info for error reporting before an error actually

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2007-10-25 22:27:58 Re: 8.3 GSS Issues
Previous Message Henry B. Hotz 2007-10-25 21:08:22 Re: 8.3 GSS Issues

Browse pgsql-patches by date

  From Date Subject
Next Message Gregory Stark 2007-10-25 22:28:39 Re: Autovacuum cancellation
Previous Message David Fetter 2007-10-25 21:04:58 Re: [HACKERS] Re: pgsql: Extract catalog info for error reporting before an error actually