From: Michael P. <mic...@gm...> - 2010-11-30 08:27:19
|
Hi all, Please see attached a patch that corrects 2PC (2 phase commit) in the case of an implicit 2PC. In the current HEAD, when a transaction involving several nodes in a write operation commits, it does a commit in the following order: 1) Prepare on datanodes 2) Commit on datanodes 3) Commit on Coordinator 4) Commit on GTM The problem is that Commit at Coordinator has to be done first to protect data consistency. With the patch attached, a commit is done in the following order: 1) Prepare on Coordinator (Flush a 2PC file if DDL is involved) 2) Prepare on datanodes involved in a write operation 3) Commit on Coordinator the prepared transaction 4) Commit on Datanodes the prepared transaction 5) Commit on GTM In case of a problem at Coordinator, transaction can be rollbacked on nodes, protecting data visibility and consistency. There is also a little improvement, in current head, it is necessary to go 2 times to GTM to commit global the transaction ID (GXID) used for Prepare and the GXID used for Commit. In this patch, GTM is only contacted once and commits at the same time both GXIDs. Regards, -- Michael Paquier http://michaelpq.users.sourceforge.net |