Re: PANIC :Call AbortTransaction when transaction id is no normal

Поиск
Список
Период
Сортировка
От Kuntal Ghosh
Тема Re: PANIC :Call AbortTransaction when transaction id is no normal
Дата
Msg-id CAGz5QCJKDptF4R0xHzM9YLxbLwZHA9enW9zjOi+vF93HVycVgw@mail.gmail.com
обсуждение исходный текст
Ответ на PANIC :Call AbortTransaction when transaction id is no normal  (Thunder <thunder1@126.com>)
Ответы Re: PANIC :Call AbortTransaction when transaction id is no normal  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
Hello,

On Mon, May 13, 2019 at 10:15 AM Thunder <thunder1@126.com> wrote:

I try to fix this issue and check whether it's normal transaction id before we do abort.

diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index 20feeec327..dbf2bf567a 100644
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -4504,8 +4504,13 @@ RollbackAndReleaseCurrentSubTransaction(void)
 void
 AbortOutOfAnyTransaction(void)
 {
+       TransactionId xid = GetCurrentTransactionIdIfAny();
        TransactionState s = CurrentTransactionState;
 
+       /* Check to see if the transaction ID is a permanent one because we cannot abort it */
+       if (!TransactionIdIsNormal(xid))
+               return;
+
        /* Ensure we're not running in a doomed memory context */
        AtAbort_Memory();

Can we fix in this way?

If we fix the issue in this way, we're certainly not going to do all those portal,locks,memory,resource owner cleanups that are done inside AbortTransaction() for a normal transaction ID. But, I'm not sure how relevant those steps are since the database is anyway shutting down.

--
Thanks & Regards,
Kuntal Ghosh
EnterpriseDB: http://www.enterprisedb.com

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Gierth
Дата:
Сообщение: Re: SQL-spec incompatibilities in similar_escape() and related stuff
Следующее
От: Masahiko Sawada
Дата:
Сообщение: Re: [Proposal] Table-level Transparent Data Encryption (TDE) and KeyManagement Service (KMS)