Re: [PATCH] Transaction traceability - txid_status(bigint)

From: Petr Jelinek <petr(at)2ndquadrant(dot)com>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: [PATCH] Transaction traceability - txid_status(bigint)
Date: 2016-09-02 15:29:34
Message-ID: 779faba0-3eba-bfc3-675e-b35b4ca9d4dd@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 02/09/16 15:46, Craig Ringer wrote:
> On 2 September 2016 at 21:01, Craig Ringer <craig(at)2ndquadrant(dot)com> wrote:
>> On 2 September 2016 at 20:38, Craig Ringer <craig(at)2ndquadrant(dot)com> wrote:
>>> On 2 Sep. 2016 8:30 pm, "Simon Riggs" <simon(at)2ndquadrant(dot)com> wrote:
>>>>
>>>> On 2 September 2016 at 13:16, Craig Ringer <craig(at)2ndquadrant(dot)com> wrote:
>>>>
>>>>> So I've moved it to xlog.c...
>>>>
>>>> I'm pretty sure it shouldn't live in xlog.c, but there may be some
>>>> good reason I can't see yet.
>>>
>>> Ugh. Yes. transam.c would be rather saner.
>>>
>>> Only for the helper to determine if an xid is recent though; txid_ status
>>> stays in adt/xact.c where it belongs along with txid_current() etc.
>>
>> Fixed, moved to transam.c.
>
> Missed that this causes an undefined reference to GetNextXidAndEpoch()
> which is in xlog.c. I knew there was a reason I put it there. So most
> recent patch is wrong, use the prior one.
>
> GetNextXidAndEpoch() needs to be in xlog.c because it uses XLogCtl's
> shmem copy of checkPoint.nextXidEpoch. So either transam.c needs to
> #include xlog.h (which seems a bit backwards) or
> TransactionIdInRecentPast() should go in xlog.c.
>
> I don't like either really. Opinion? I'm sure we'll want this
> functionality in other places as part of dealing with the problems
> discussed upthread with 'xid' exposed to users.
>

You could put it to txid.c where all the other txid stuff is in?

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2016-09-02 15:29:37 Re: Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)
Previous Message Tom Lane 2016-09-02 15:10:54 Re: Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)