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

From: Petr Jelinek <petr(at)2ndquadrant(dot)com>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, 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-08-23 10:04:21
Message-ID: 175ebc25-2171-6c65-9d3c-e2bb6e4fab55@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 23/08/16 11:27, Craig Ringer wrote:
> On 23 Aug 2016 16:02, "Petr Jelinek" <petr(at)2ndquadrant(dot)com
> <mailto:petr(at)2ndquadrant(dot)com>> wrote:
>>
>> On 23/08/16 02:55, Craig Ringer wrote:
>>>
>>> On 23 August 2016 at 01:03, Robert Haas <robertmhaas(at)gmail(dot)com
> <mailto:robertmhaas(at)gmail(dot)com>
>>> <mailto:robertmhaas(at)gmail(dot)com <mailto:robertmhaas(at)gmail(dot)com>>> wrote:
>>>
>>>
>>>
>>> I think you should use underscores to separate all of the words
>>> instead of only some of them.
>>>
>>>
>>> ifassigned => if_assigned
>>>
>>> ifrecent=> if_recent
>>>
>>> Updated patch series attached. As before, 0-4 intended for commit, 5
>>> just because it'll be handy to have around for people doing wraparound
>>> related testing.
>>
>>
>> I guess you mean 0-3 for commit and 4 is just handy?
>
> Er. Right. 1-3. 4 just as handy test/tool.
>
> 1 most important and useful. Then 2. Then 3.
>
>> From the point of code this patch seems good to me.
>
> Thanks.
>
>> I do wonder about the 3rd patch though. I wonder if it would not be
> better to have the opposite function instead - converting xid to txid as
> that will always work and does not have to have the NULL case and would
> be simpler in terms of code.
>
> Yeah, but it wouldn't solve the need to take txid_current() output and
> do stuff with it other than ordinal comparison. Like pass to commit ts
> functions and others that take xid. If we extend all funcs that take xid
> to take bigint instead, they just get to use the same epoch logic in
> them, complete with some way to deal with wrapped xids sensibly. It has
> to be done somewhere. Though it's prettier if hidden from the user.
>
> More importantly imo, txid => bigint has to assume the current epoch. We
> have no way to make sure the user doesn't try to use something already
> wrapped.
>

Okay, fair points.

> I don't mind if everyone decides it's better to make xid go away and use
> bigint everywhere user facing. Or even a new bigxid type. More work than
> I can really afford but can manage; shouldn't block #1 and #2 though as
> they already use bigint.
>

I don't think that would be very straightforward to be honest. I guess
for what you want to achieve the approach chosen is the best one then.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2016-08-23 11:02:29 Block level parallel vacuum WIP
Previous Message Craig Ringer 2016-08-23 09:27:02 Re: [PATCH] Transaction traceability - txid_status(bigint)