Re: [HACKERS] CurTransactionContext freed before transaction COMMIT ??? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] CurTransactionContext freed before transaction COMMIT ???
Date
Msg-id 22787.1508855179@sss.pgh.pa.us
Whole thread Raw
In response to [HACKERS] CurTransactionContext freed before transaction COMMIT ???  (Gaddam Sai Ram <gaddamsairam.n@zohocorp.com>)
Responses Re: [HACKERS] CurTransactionContext freed before transaction COMMIT???
List pgsql-hackers
Gaddam Sai Ram <gaddamsairam.n@zohocorp.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
iteratethrough 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


--
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 by date:

Previous
From: Andres Freund
Date:
Subject: Re: [HACKERS] Current int & float overflow checking is slow.
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Current int & float overflow checking is slow.