Hi, >> I think we even can just do something like a global >> TransactionId check_if_transaction_is_alive = InvalidTransactionId; >> and just set it up during decoding. And then just check it whenever it's >> not set tot InvalidTransactionId. >> >> > > Ok. I will work on something along these lines and re-submit the set of > patches. > PFA, latest patchset, which completely removes the earlier LogicalLock/LogicalUnLock implementation using groupDecode stuff and uses the newly suggested approach of checking the currently decoded XID for abort in systable_* API functions. Much simpler to code and easier to test as well.
Out of the patchset, the specific patch which focuses on the above systable_* API based XID checking implementation is part of 0003-Gracefully-handle-concurrent-aborts-of-uncommitted-t.patch. So, it might help to take a look at this patch first for any additional feedback on this approach. There's an additional test case in 0005-Additional-test-case-to-demonstrate-decoding-rollbac.patch which uses a sleep in the "change" plugin API to allow a concurrent rollback on the 2PC being currently decoded. Andres generally doesn't like this approach :-), but there are no timing/interlocking issues now, and the sleep just helps us do a concurrent rollback, so it might be ok now, all things considered. Anyways, it's an additional patch for now. Comments, feedback appreciated. Regards, Nikhils -- Nikhil Sontakke http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
0001-Cleaning-up-of-flags-in-ReorderBufferTXN-structure.patch
Description: Binary data
0002-Support-decoding-of-two-phase-transactions-at-PREPAR.patch
Description: Binary data
0003-Gracefully-handle-concurrent-aborts-of-uncommitted-t.patch
Description: Binary data
0004-Teach-test_decoding-plugin-to-work-with-2PC.patch
Description: Binary data
0005-Additional-test-case-to-demonstrate-decoding-rollbac.patch
Description: Binary data