Friday, November 21, 2008

MySQL 6.0.8 Feature: Interface for Semi-synchronous Replication

MySQL 6.0.8 has new interfaces for semisynchronous replication.

The interfaces make it possible to load components to ensure that all transactions are replicated to the slave before the users of the master gets acceptance of the commits.

The original code was developed by Mark Callaghan (Google) and Wei Li (Google). Zhenxing He (MySQL) ported the Google code to MySQL 6.0, extracted the functionality into pluggable components, and changed the code so that all storage engines are supported. Paul DuBois (MySQL) wrote the MySQL manual documentation.

The extraction of this patch into components is a first step in our strategy to make MySQL Replication modularized with separate loadable components for special replication functionality. With more interfaces to the server, it becomes easier to make the server behave in the way you want.

Please let us know what you think. Does it work as you expect? Do you want the synchronization to be different? Want to publish your own replication components for MySQL?



Mark Callaghan said...

This is great. The replication team at MySQL has quickly opened to the external developer community and this should benefit everyone. This includes their integration of features from us, publishing many previews and sharing design reviews.

Unknown said...

This is a great addition to replication, but I am curious, how does this work if the slave has log-slave-updates enabled? Is it compatible with a replication ring or master-master pair?

HE Zhenxing said...

the main changes semi-synchronous replication brings in is to make the master to block the return of a transaction until it get a reply from one slave, the slave will reply on receipt of the events from master, so this feature should work fine with circular replication or any other kind of usages of replication currently supported.

Mats Kindahl said...

Just to elaborate on what Zhenxing said: note that the semi-sync implementation acknowledges that the transaction has been written to the relay log, but not that it has been applied to the slave. This means that log-slave-updates does not affect the behavior of semi-sync at all, since this is executed in the SQL thread.

Mark Callaghan said...

In the Google version, the slave replied as soon as the IO thread received the event and that was before it wrote the event to the relay log. Has MySQL done something different? It would be nice if it gave the option to respond on receipt or after writing to the relay log.

HE Zhenxing said...

In the MySQL version, the slave will send a reply after the event has been written to the relay log.