Skip site navigation (1) Skip section navigation (2)

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 (view raw, whole thread or download thread mbox)
Thread:
Lists: pgsql-committerspgsql-hackerspgsql-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

pgsql-hackers by date

Next:From: Stephen FrostDate: 2007-10-25 22:27:58
Subject: Re: 8.3 GSS Issues
Previous:From: Henry B. HotzDate: 2007-10-25 21:08:22
Subject: Re: 8.3 GSS Issues

pgsql-committers by date

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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group