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

From: Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com>
To: Thunder <thunder1(at)126(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: PANIC :Call AbortTransaction when transaction id is no normal
Date: 2019-05-13 07:55:19
Message-ID: CAGz5QCJKDptF4R0xHzM9YLxbLwZHA9enW9zjOi+vF93HVycVgw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

On Mon, May 13, 2019 at 10:15 AM Thunder <thunder1(at)126(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2019-05-13 08:01:16 Re: [Proposal] Table-level Transparent Data Encryption (TDE) and Key Management Service (KMS)
Previous Message Andrew Gierth 2019-05-13 07:42:56 Re: SQL-spec incompatibilities in similar_escape() and related stuff