From: MARK CALLAGHAN Date: October 8 2010 3:39am Subject: Re: A question of "MySQL external XA and internal XA" List-Archive: http://lists.mysql.com/internals/38135 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Internal XA is used to keep the replication binlog and Innodb in sync after a crash. In this case the commit protocol is: 1) prepare InnoDB (force changes in transaction log to disk, mark transaction as "prepared") 2) write transaction changes to binlog including XID event 3) commit InnoDB (write and force "commit" record to transaction log) If mysqld crashes after step 2, then the "prepared" InnoDB transactions will be committed during crash recovery. In crash recovery, mysqld determines the list of committed transactions from the current binlog and uses that to determine what to do with "prepared" transactions. The work above requires 3 fsync calls in the normal case. The fsyncs done in steps #1 and #3 can be shared across many concurrent transactions. The fsync done in step #2 cannot today -- unless you use the Google patch. I know that MariaDB is very interested in changing that. I suspect that MySQL is as well. On Thu, Oct 7, 2010 at 7:30 PM, Haihao Tang wrote: > Hi, > =A0 =A0I am recently in the study of MySQL XA. In the section > "Restrictions on XA Transactions" of MySQL reference 5.1 > (http://dev.mysql.com/doc/refman/5.1/en/xa-restrictions.html), it > wrote: > =A0 =A0For =93external XA,=94 a MySQL server acts as a Resource Manager a= nd > client programs act as Transaction Managers. For =93Internal XA=94, > storage engines within a MySQL server act as RMs, and the server > itself acts as a TM. > =A0 =A0I understand the "external XA" where MySQL server acts as RM, but > the "internal XA" confuse me. How does MySQL server itself act as a TM > and storage engine (It could be only InnoDB, right?) act as RM? How > does MySQL server manage storage engines to accomplish a DTP? Any > examples? > =A0 =A0Thank you! > > Best Regards, > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Robin > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 2010-10-8 > > -- > MySQL Internals Mailing List > For list archives: http://lists.mysql.com/internals > To unsubscribe: =A0 =A0http://lists.mysql.com/internals?unsub=3Dmdcallag@= gmail.com > > --=20 Mark Callaghan mdcallag@stripped