Re: Autovacuum launcher - Mailing list pgsql-patches

From Alvaro Herrera
Subject Re: Autovacuum launcher
Date
Msg-id 20070215154331.GL4682@alvh.no-ip.org
Whole thread Raw
In response to Re: Autovacuum launcher  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Autovacuum launcher  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Tom Lane wrote:

I forgot to comment:

> This part is very seriously broken:
>
> diff -c -p -r1.33 lwlock.h
> *** src/include/storage/lwlock.h    5 Jan 2007 22:19:58 -0000    1.33
> --- src/include/storage/lwlock.h    13 Feb 2007 16:58:41 -0000
> *************** typedef enum LWLockId
> *** 62,67 ****
> --- 62,68 ----
>       BtreeVacuumLock,
>       AddinShmemInitLock,
>       FirstBufMappingLock,
> +     AutovacuumLock,
>       FirstLockMgrLock = FirstBufMappingLock + NUM_BUFFER_PARTITIONS,
>
>       /* must be last except for MaxDynamicLWLock: */
>
> I'm surprised it got through your testing at all, with the autovacuum
> lock conflicting with bufmgr.

I didn't look closely enough to notice the arithmetic.  I think the only
reason this worked at all was because the autovacuum lock was being held
for very short periods of time, always for assigning or reading some
variable.

I think a warning comment is warranted here -- will include it when I
commit the patch.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: patch adding new regexp functions
Next
From: Alvaro Herrera
Date:
Subject: Re: patch adding new regexp functions