Re: [HACKERS] How to determine that a TransactionId is reallyaborted? - Mailing list pgsql-hackers

From Eric Ridge
Subject Re: [HACKERS] How to determine that a TransactionId is reallyaborted?
Date
Msg-id CAB35990-C3B2-4EBD-8B7B-6DF58595D576@gmail.com
Whole thread Raw
In response to Re: [HACKERS] How to determine that a TransactionId is really aborted?  (Jaime Casanova <jaime.casanova@2ndquadrant.com>)
Responses Re: [HACKERS] How to determine that a TransactionId is really aborted?  (Peter Geoghegan <pg@bowt.ie>)
List pgsql-hackers
> On Oct 22, 2017, at 2:50 PM, Jaime Casanova <jaime.casanova@2ndquadrant.com> wrote:
>
> so, what you want is txid_status() [1]... while this is new in v10 you
> can use the code as guide or just migrate to v10 ;)

Oh neat, thanks.

<long pause reading the code>

Doesn't that tell you the status relative to the transaction calling txid_status()?

I'm looking for the status as any concurrent open transaction might see it.  For example, if any concurrent transaction
mightsee it as "in progress", that's what I'd want returned.  Does that make sense?   

That's why I was thinking GetOldestXmin() was the right thing to use rather than GetActiveSnapshot()->xmin and also why
Ithought to check TransactionIdPrecedes() first. 

I am curious about the lock on ClogTruncationLock... could any of the TransactionIdDidXXX calls lie without that lock?
Ihaven't seen such a thing used in the 9.3 sources.  Maybe it's necessary for 10 or maybe I just missed it in 9.3? 

Thanks for your time!

eric

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] [BUGS] BUG #14849: jsonb_build_object doesn't like VARIADIC calls very much
Next
From: Peter Geoghegan
Date:
Subject: Re: [HACKERS] How to determine that a TransactionId is really aborted?