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

Поиск
Список
Период
Сортировка
От Eric Ridge
Тема [HACKERS] How to determine that a TransactionId is really aborted?
Дата
Msg-id 75FF3934-2F85-4E19-8F9C-B77B08F7DD11@gmail.com
обсуждение исходный текст
Ответы Re: [HACKERS] How to determine that a TransactionId is really aborted?  (Peter Geoghegan <pg@bowt.ie>)
Re: [HACKERS] How to determine that a TransactionId is really aborted?  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
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:

{  TransactionId oldestXmin = GetOldestXmin (false, false);  TransactionId xid = 42;   if (TransactionIdPrecedes(xid,
oldestXmin)&&      !TransactionIdDidCommit(xid) &&      !TransactionIdIsInProgress(xid)) /* not even sure this is
necessary?*/  {     /* xid is aborted/crashed and no active transaction cares */  } 
}

Can anyone confirm or deny that this is correct?  I feel like it is correct, but I'm no expert.

Thanks so much 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Useless(?) asymmetry in parse_func.c
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: [HACKERS] How to determine that a TransactionId is really aborted?