Re: HeapTupleSatisfiesUpdate missing a bet?

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: HeapTupleSatisfiesUpdate missing a bet?
Date: 2005-03-26 03:20:39
Message-ID: 20050326032039.GB7315@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 25, 2005 at 06:46:58PM -0500, Tom Lane wrote:

> Also, you just introduced a race condition, since the transaction might
> have committed after the earlier tests and before you did
> TransactionIdIsInProgress. You really have to do
> TransactionIdIsInProgress *first*, which makes the proposed change even
> more expensive.

Oh, right. I knew there was a reason, I just couldn't remember it.

> What's wrong with using XactLockTableWait? It's not going away --- the
> implementation might change but I can't see getting rid of the
> functionality.

Nothing wrong indeed, if you take this PoV. That's exactly what I've
done now, since it is what heap_mark4update (which I'm replacing) does
at present. (I use LockTuple(), a lock which is only released at
transaction end, so the net result is semantically equivalent to
XactLockTableWait -- that's why I want to get rid of it.)

--
Alvaro Herrera (<alvherre[(at)]dcc(dot)uchile(dot)cl>)
"El sentido de las cosas no viene de las cosas, sino de
las inteligencias que las aplican a sus problemas diarios
en busca del progreso." (Ernesto Hernández-Novich)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruno Wolff III 2005-03-26 03:31:17 Re: Bug 1500
Previous Message Andrew Dunstan 2005-03-26 03:19:25 Re: minor windows & cygwin regression failures on stable