ReplicationFeatures/SemiSyncReplication
Contents |
[edit] SEMI-SYNCHRONOUS REPLICATION
Feature preview made from a contributed patch from Mark Callaghan and Wei Li, Google, that was modified by Zhenxing He, MySQL Replication Team.
[edit] Provides:
When semi-synchronous replication is enabled on the master side and there is at least one semi-synchronous slave, the master blocks on commit of a transaction until at least one semi-synchronous slave acknowledges that it has received all events for the transaction, or until a timeout occurs.
[edit] Use case:
The replication between master and slave are more reliable, but because master waits for slave reply after it committed the transaction, so there is no guarantee that the slave has received the last transaction when master crashes.
[edit] Architecture
[edit] User interface
- install plugins
- master:
- INSTALL PLUGIN rpl_semi_sync_master SONAME 'libsemisync_master.so';
- slave:
- INSTALL PLUGIN rpl_semi_sync_slave SONAME 'libsemisync_slave.so';
- master:
- the server startup options:
- master:
- --rpl_semi_sync_master_enabled=1|0
- --rpl_semi_sync_master_timeout= timeout value in milliseconds (default 10ms)
- slave:
- --rpl_semi_sync_slave_enabled=1|0
- master:
- run time facilities:
- master:
- set global rpl_semi_sync_master_enabled=1|0;
- set global rpl_semi_sync_master_timeout= timeout value in milliseconds (default 10ms)
- show status like 'Rpl_semi_sync_master_clients';
- show status like 'Rpl_semi_sync_master_status';
- show status like 'Rpl_semi_sync_master_no_tx';
- show status like 'Rpl_semi_sync_master_yes_tx';
- slave:
- set global rpl_semi_sync_slave_enabled = 1|0;
- show status like 'Rpl_semi_sync_slave_status';
- master:
[edit] Modifications made by MySQL
- Converted MySQL 5.0 google patch to MySQL 6.0
- Made it storage engine independent (removed modifications to InnoDB)
- Made RESET MASTER reset semi-sync master status
- Modularized code - there is now an interface for 6.0 (WL#4398) and the separate components for semi-sync (WL#1720)
[edit] References
- MySQL 6.0 Manual - Chapter: Semisynchronous Replication
- http://code.google.com/p/google-mysql-tools/wiki/SemiSyncReplication
- http://code.google.com/p/google-mysql-tools/wiki/SemiSyncReplicationDesign
- WL#1720 Semi-synchronous replication
- WL#4398 Replication interface for semi-synchronous replication
[edit] Downloads
- Source of the semi-synchronous replication plugins
- Pre-release of semi-synchronous replication plugins
[edit] Thanks
Mark Callaghan and Wei Li from Google whose original patch for 5.0 was converted by Zhenxing He MySQL Replication Team.
