Re: [HACKERS] How to determine that a TransactionId is really aborted?

2017-10-26 Thread Alvaro Herrera
Eric Ridge wrote: > > Again, you'll probably need to put this low level requirement into > > context if you want sound advice from this list. > > I'm just thinking out lout here, but the context is likely something > along the lines of externally storing all transaction ids, and > periodically

Re: [HACKERS] How to determine that a TransactionId is really aborted?

2017-10-26 Thread Robert Haas
On Sun, Oct 22, 2017 at 9:23 PM, Eric Ridge wrote: > When sitting inside an extension, and given an arbitrary TransactionId, how > can you determine that it aborted/crashed *and* that no other active > transaction thinks it is still running? > > I've tried to answer this

Re: [HACKERS] How to determine that a TransactionId is really aborted?

2017-10-23 Thread Craig Ringer
On 23 October 2017 at 05:44, Eric Ridge wrote: >> On Oct 22, 2017, at 3:24 PM, Peter Geoghegan wrote: >> Again, you'll probably need to put this low level requirement into >> context if you want sound advice from this list. > > I'm just thinking out lout here,

Re: [HACKERS] How to determine that a TransactionId is really aborted?

2017-10-22 Thread Eric Ridge
> On Oct 22, 2017, at 3:24 PM, Peter Geoghegan wrote: > > On Sun, Oct 22, 2017 at 2:19 PM, Eric Ridge wrote: >> I'm looking for the status as any concurrent open transaction might see it. >> For example, if any concurrent transaction might see it as "in

Re: [HACKERS] How to determine that a TransactionId is really aborted?

2017-10-22 Thread Peter Geoghegan
On Sun, Oct 22, 2017 at 2:19 PM, Eric Ridge wrote: > I'm looking for the status as any concurrent open transaction might see it. > For example, if any concurrent transaction might see it as "in progress", > that's what I'd want returned. Does that make sense? Maybe, but

Re: [HACKERS] How to determine that a TransactionId is really aborted?

2017-10-22 Thread Eric Ridge
> On Oct 22, 2017, at 2:50 PM, Jaime Casanova > 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. Doesn't that tell you the status relative to the

Re: [HACKERS] How to determine that a TransactionId is really aborted?

2017-10-22 Thread Jaime Casanova
On 22 October 2017 at 15:00, Eric Ridge wrote: >> On Oct 22, 2017, at 1:50 PM, Peter Geoghegan wrote: >> >> On Sun, Oct 22, 2017 at 12:23 PM, Eric Ridge wrote: >>> Can anyone confirm or deny that this is correct? I feel like it is >>> correct,

Re: [HACKERS] How to determine that a TransactionId is really aborted?

2017-10-22 Thread Eric Ridge
> On Oct 22, 2017, at 1:50 PM, Peter Geoghegan wrote: > > On Sun, Oct 22, 2017 at 12:23 PM, Eric Ridge wrote: >> Can anyone confirm or deny that this is correct? I feel like it is correct, >> but I'm no expert. > > What are you going to use the code for? I

Re: [HACKERS] How to determine that a TransactionId is really aborted?

2017-10-22 Thread Peter Geoghegan
On Sun, Oct 22, 2017 at 12:23 PM, Eric Ridge wrote: > Can anyone confirm or deny that this is correct? I feel like it is correct, > but I'm no expert. What are you going to use the code for? I think that that context is likely to matter here. -- Peter Geoghegan -- Sent

[HACKERS] How to determine that a TransactionId is really aborted?

2017-10-22 Thread Eric Ridge
When sitting inside an extension, and given an arbitrary TransactionId, how can you determine that it aborted/crashed *and* that no other active transaction thinks it is still running? I've tried to answer this question myself (against the 9.3 sources), and it seems like it's just: {