Re: CurTransactionContext freed before transaction COMMIT ???

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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-24 14:26:19
Message-ID: 22787.1508855179@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gaddam Sai Ram <gaddamsairam(dot)n(at)zohocorp(dot)com> writes:
> We are implementing in-memory index. As a part of that, during index callbacks, under CurTransactionContext, we cache all the DMLs of a transaction in dlist(postgres's doubly linked list).
> We registered transaction callback, and in transaction pre-commit event(XACT_EVENT_PRE_COMMIT), we iterate through all cached DMLs(dlist) and populate in my in-memory data structure.

This sounds broken on its face --- if you want stuff to survive to
top-level commit, you need to keep it in TopTransactionContext.
CurTransactionContext might be a subtransaction's context that will
go away at subtransaction commit/abort.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-10-24 14:36:42 Re: Current int & float overflow checking is slow.
Previous Message Andres Freund 2017-10-24 14:17:21 Re: Current int & float overflow checking is slow.