Re: CurTransactionContext freed before transaction COMMIT ???

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Gaddam Sai Ram <gaddamsairam(dot)n(at)zohocorp(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, thomasmunro <thomas(dot)munro(at)enterprisedb(dot)com>
Subject: Re: CurTransactionContext freed before transaction COMMIT ???
Date: 2017-10-26 14:43:18
Message-ID: CAA4eK1Jz_fiJ0wRnX+v6ZM1J0+Fr-OhTHaOfo3SSS2YYaHSpWg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 25, 2017 at 8:04 PM, Gaddam Sai Ram
<gaddamsairam(dot)n(at)zohocorp(dot)com> wrote:
> Thanks for the response,
>
> Can you check if CurTransactionContext is valid at that point?
>
>
> Any Postgres function to check if CurTransactionContext is valid or not?
>
> To see, if this problem is related to CurTransactionContext, can you try to
> populate the list in TopMemoryContext and see if that works.
>
>
> Did you mean TopTransactionContext?
>

No, I mean what I have written. I suspect in your case
TopTransactionContext will be same as CurTransactionContext because
you don't have any subtransaction.

> As of now, we don't free our dlist. We solely depend on Postgres to free our
> dlist while it frees the TopTransactionContext. But if we do allocate in
> TopMemoryContext, we need to take care of freeing our allocations.
>

Can't we do it temporarily to test? I am not suggesting to make this
a permanent change rather a way to see the reason of the problem.

> And one more issue is, we found this bug once in all the testing we did. So
> trying to replay this bug seems very difficult.
>

Oh, then it is tricky. I think there is a good chance that this is
some of your application issues where you probably haven't used memory
context as required, so probably you need to figure out a way to
reproduce this issue, otherwise, it might be difficult to track down
the actual cause.

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-10-26 15:03:45 Re: Moving relation extension locks out of heavyweight lock manager
Previous Message Ants Aasma 2017-10-26 14:29:39 Re: make async slave to wait for lsn to be replayed