Re: [HACKERS] Vacuum analyze bug CAUGHT

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: Vadim Mikheev <vadim(at)krs(dot)ru>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>, Michael Simms <grim(at)argh(dot)demon(dot)co(dot)uk>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Vacuum analyze bug CAUGHT
Date: 1999-09-13 18:52:54
Message-ID: 199909131852.OAA27525@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Tom Lane wrote:
> >
> > Also, rather than running around and adding locks to every single
> > place that calls heap_open or heap_close, I wonder whether we shouldn't
> > have heap_open/heap_close themselves automatically grab or release
> > at least a minimal lock (AccessShareLock, I suppose).
>
> This could result in deadlocks...
>
> > Or maybe better: change heap_open/heap_openr/heap_close to take an
> > additional parameter specifying the kind of lock to grab. That'd still
> > mean having to visit all the call sites, but it would force people to
> > think about the issue in future rather than forgetting to lock a table
> > they're accessing.
>
> This way is better.

Just a reminder. heap_getnext() already locks the _buffer_, and
heap_fetch() requires you pass a variable to hold the buffer number, so
you can release the buffer lock when you are done.

This was not the case in < 6.4 releases, and there is no reason not to
add additional parameters to function calls like I did for heap_fetch() if
it makes sense.

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jason Venner 1999-09-13 20:03:05 Re: [HACKERS] jdbc1 large objects and 651 -- does it work for any one
Previous Message Vadim Mikheev 1999-09-13 18:30:33 Re: [HACKERS] Vacuum analyze bug CAUGHT