On Tue, Jan 6, 2015 at 3:04 PM, Simon Riggs <si...@2ndquadrant.com> wrote: > If you can explain it in more detail in comments and README, I may > agree. At present, I don't get it and it makes me nervous. > > The comment says > "Only the top frame of the transaction state stack is copied to a parallel > worker" > but I'm not sure why. > > Top meaning the current subxact or the main xact? > If main, why are do we need XactTopTransactionId
Current subxact. I initially thought of copying the entire TransactionStateData stack, but Heikki suggested (via IM) that I do it this way instead. I believe his concern was that it's never valid to commit or roll back to a subtransaction that is not at the top of the stack, and if you don't copy the stack, you avoid the risk of somehow ending up in that state. Also, you avoid having to invent resource owners for (sub)transactions that don't really exist in the current process. On the other hand, you do end up with a few special cases that wouldn't exist with the other approach. Still, I'm pretty happy to have taken Heikki's advice: it was certainly simple to implement this way, plus hopefully that way at least one person likes what I ended up with. :-) What else needs clarification? -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers