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

Re: PATCH to allow concurrent VACUUMs to not lock each

From: Hannu Krosing <hannu(at)skype(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>,Neil Conway <neilc(at)samurai(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: PATCH to allow concurrent VACUUMs to not lock each
Date: 2005-08-24 12:10:13
Message-ID: 1124885413.4827.9.camel@fuji.krosing.net (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
On K, 2005-08-17 at 15:40 -0400, Tom Lane wrote:
>                            Saatja: 
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
>                           Kellele: 
> Bruce Momjian
> <pgman(at)candle(dot)pha(dot)pa(dot)us>, Hannu
> Krosing <hannu(at)tm(dot)ee>, Neil Conway
> <neilc(at)samurai(dot)com>, pgsql-
> patches(at)postgresql(dot)org
>                             Teema: 
> Re: [PATCHES] PATCH to allow
> concurrent VACUUMs to not lock each
>                           KuupƤev: 
> Wed, 17 Aug 2005 15:40:53 -0400
> (22:40 EEST)
> 
> Just for the archives, attached is as far as I'd gotten with cleaning
> up
> Hannu's patch before I realized that it wasn't doing what it needed to
> do.  This fixes an end-of-transaction race condition (can't unset
> inVacuum before xact end, unless you want OldestXmin going backwards
> from the point of view of other people) and improves the documentation
> of what's going on.  But unless someone can convince me that it's safe
> to mess with GetSnapshotData, it's unlikely this'll ever get applied.
> 
> 
> 

Attached is a patch, based on you last one, which messes with
GetSnapshotData in what I think is a safe way.

It introduces another attribute to PROC , proc->nonInVacuumXmin and
computes this in addition to prox->xmin inside GetSnapshotData.

When (and only when) GetOldestXmin is called with ignoreVacuum=true,
then proc->nonInVacuumXmin is checked instead of prox->xmin.

I believe that this will make this change invisible to all other places
where GetSnapshotData or GetOldestXmin is used.

-- 
Hannu Krosing <hannu(at)skype(dot)net>






Attachment: vacuum-patch-8.1-2005.08.24.diff
Description: text/x-patch (18.3 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Manfred KoizarDate: 2005-08-24 12:29:22
Subject: Re: Must be owner to truncate?
Previous:From: Robert TreatDate: 2005-08-24 12:04:01
Subject: Re: 8.1 release notes

pgsql-patches by date

Next:From: Bruce MomjianDate: 2005-08-24 12:49:15
Subject: Re: ECPG and escape strings
Previous:From: Andrew DunstanDate: 2005-08-24 05:38:46
Subject: Re: PL/Perl regression tests with use_strict

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