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

Re: age(xid) on hot standby

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: age(xid) on hot standby
Date: 2012-05-09 13:04:08
Message-ID: CA+U5nM+n3QzqZDEnwHWUER3_SYaOdS9EJMiYbkxZ4Cm0ixp=Kg@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On 9 May 2012 00:55, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> On 8 May 2012 20:01, Peter Eisentraut <peter_e(at)gmx(dot)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.

Committed, but forgot to give appropriate credit. Sorry about that.

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

In response to

Responses

pgsql-hackers by date

Next:From: Pavel StehuleDate: 2012-05-09 13:33:01
Subject: enhanced error fields
Previous:From: Robert HaasDate: 2012-05-09 12:48:55
Subject: Re: synchronous_commit and remote_write

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