Re: Process local hint bit cache - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Process local hint bit cache
Date
Msg-id 29136.1301773223@sss.pgh.pa.us
Whole thread Raw
In response to Re: Process local hint bit cache  (Merlin Moncure <mmoncure@gmail.com>)
Responses Re: Process local hint bit cache  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
Merlin Moncure <mmoncure@gmail.com> writes:
> On Wed, Mar 30, 2011 at 2:35 PM, Merlin Moncure <mmoncure@gmail.com> wrote:
>> btw I haven't forgotten your idea to move TransactionIdInProgress
>> Down. I think this is a good idea, and will experiment with it pre and
>> post cache.

The reason it's done in that order is to avoid race conditions.  If you
change the order you will get wrong behavior if the other transaction
ends between the TransactionIdDidCommit and the TransactionIdInProgress
tests.  I suppose you could recheck TransactionIdDidCommit a second
time, but that hardly seems likely to result in performance gains.

> aside:
> Moving TransactionIdInProgress below TransactionIdDidCommit can help
> in once sense: TransactionIdDidCommit grabs the XidStatus but discards
> the knowledge if the transaction is known aborted.

Doesn't the single-entry cache help with that?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: 9.0.3 SIGFAULT on FreeBSD with dtrace
Next
From: Dimitri Fontaine
Date:
Subject: Re: Another swing at JSON