Re: age(xid) on hot standby - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: age(xid) on hot standby
Date
Msg-id CA+U5nM+iwReko4BzydPJn77HRti_=zU=1PAEwoF=iioxFMDePg@mail.gmail.com
Whole thread Raw
In response to Re: age(xid) on hot standby  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: age(xid) on hot standby
List pgsql-hackers
On 8 May 2012 20:01, Peter Eisentraut <peter_e@gmx.net> wrote:
> On ons, 2012-01-18 at 14:55 -0500, Tom Lane wrote:
>> BTW, it strikes me that maybe the coding should work about like this:
>>
>>       if (!TransactionIdIsValid(age_reference_xid))
>>       {
>>               age_reference_xid = GetTopTransactionIdIfAny();
>>               if (!TransactionIdIsValid(age_reference_xid))
>>                       age_reference_xid = ReadNewTransactionId();
>>       }
>>       ... use age_reference_xid to compute result ...
>>
>> and of course code somewhere to reset age_reference_xid at end of xact.
>
> How about this patch?

I think we should fix this, but not with this exact patch.

We should just use MyPgXact->xid
rather than add more to the transaction path

I'll simplify the patch and commit.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Latch for the WAL writer - further reducing idle wake-ups.
Next
From: David Fetter
Date:
Subject: Re: WIP Patch: Selective binary conversion of CSV file foreign tables