> On 7 Sep 2017, at 18:58, Nikhil Sontakke <nikh...@2ndquadrant.com> wrote: > > Hi, > > FYI all, wanted to mention that I am working on an updated version of > the latest patch that I plan to submit to a later CF. >
Cool! So what kind of architecture do you have in mind? Same way as is it was implemented before? As far as I remember there were two main issues: * Decodong of aborted prepared transaction. If such transaction modified catalog then we can’t read reliable info with our historic snapshot, since clog already have aborted bit for our tx it will brake visibility logic. There are some way to deal with that — by doing catalog seq scan two times and counting number of tuples (details upthread) or by hijacking clog values in historic visibility function. But ISTM it is better not solve this issue at all =) In most cases intended usage of decoding of 2PC transaction is to do some form of distributed commit, so naturally decoding will happens only with in-progress transactions and we commit/abort will happen only after it is decoded, sent and response is received. So we can just have atomic flag that prevents commit/abort of tx currently being decoded. And we can filter interesting prepared transactions based on GID, to prevent holding this lock for ordinary 2pc. * Possible deadlocks that Andres was talking about. I spend some time trying to find that, but didn’t find any. If locking pg_class in prepared tx is the only example then (imho) it is better to just forbid to prepare such transactions. Otherwise if some realistic examples that can block decoding are actually exist, then we probably need to reconsider the way tx being decoded. Anyway this part probably need Andres blessing. Stas Kelvich Postgres Professional: http://www.postgrespro.com The Russian Postgres Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers