From: Date: November 14 2008 9:36pm Subject: svn commit - mysqldoc@docsrva: r12487 - in trunk: . refman-6.0 List-Archive: http://lists.mysql.com/commits/58845 Message-Id: <200811142036.mAEKaYe8020315@docsrva.mysql.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Author: paul Date: 2008-11-14 21:36:34 +0100 (Fri, 14 Nov 2008) New Revision: 12487 Log: r35731@frost: paul | 2008-11-14 14:38:09 -0500 Revisions to semisync replication material Modified: trunk/refman-6.0/semisync-repl-tmp.xml Property changes on: trunk ___________________________________________________________________ Name: svk:merge - 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:39854 7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:35728 b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218 bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:34365 + 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:39854 7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:35731 b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218 bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:34365 Modified: trunk/refman-6.0/semisync-repl-tmp.xml =================================================================== --- trunk/refman-6.0/semisync-repl-tmp.xml 2008-11-14 20:19:11 UTC (rev 12486) +++ trunk/refman-6.0/semisync-repl-tmp.xml 2008-11-14 20:36:34 UTC (rev 12487) Changed blocks: 14, Lines Added: 179, Lines Deleted: 138; 16819 bytes @@ -17,8 +17,8 @@ - MySQL 6.0.x and up supports semisynchronous replication in addition - to asynchronous replication. This section discusses what + As of version 6.0.x, MySQL supports semisynchronous replication in + addition to asynchronous replication. This section discusses what semisynchronous replication is and how it works. The following sections cover the adminstrative interface to semisynchronous replication and how to install, configure, and monitor it. @@ -61,7 +61,7 @@ The slave acknowledges receipt of a transaction's events only - after the events have been written to the relay log and flushed + after the events have been written to its relay log and flushed to disk. @@ -99,9 +99,10 @@ Blocking also occurs after rollbacks that are written to the binary log, which occurs when a transaction that modifies non-transactional - tables is rolled back. The rolled-back transaction is logged because - it modifies the non-transactional tables even though it has no - effect for transactional tables. + tables is rolled back. The rolled-back transaction is logged even + though it has no effect for transactional tables because the + modifications to the non-transactional tables cannot be rolled back + and must be sent to slaves. @@ -110,8 +111,8 @@ START TRANSACTION or SET AUTOCOMMIT = 0), autocommit is enabled and each statement commits implicitly. With semisynchronous replication, - the master blocks for each such statement, just as it does for - explicit transaction commits. + the master blocks after committing each such statement, just as it + does for explicit transaction commits. @@ -143,11 +144,11 @@ Semisynchronous replication falls between asynchronous and fully - synchronous replication. The master waits only until at least - one slave has received and logged the events. It does not wait - for all slaves to acknowledge receipt, and it requires only - receipt, not that the events have been processed and committed - on the slave side. + synchronous replication. The master waits after commit only + until at least one slave has received and logged the events. It + does not wait for all slaves to acknowledge receipt, and it + requires only receipt, not that the events have been processed + and committed on the slave side. @@ -155,10 +156,12 @@ Compared to asynchronous replication, semisynchronous replication - provides improved data integrity. When a commit returns, it is known - that the data exists in at least two places. If the master crashes - after having committed a transaction, at least one slave is - guaranteed to have received it. + provides improved data integrity. When a commit returns + successfully, it is known that the data exists in at least two + places (on the master and at least one slave). If the master commits + but a crash occurs while the master is waiting for acknowledgment + from a slave, it is possible that the transaction may not have + reached any slave. @@ -182,124 +185,145 @@ - The administrative interface to semisynchronous replication has - several components: + [TODO] Given that there seem to be more variables now, perhaps + just mention their existence here and point to the DBA chapter for + the descriptions. - Two plugins implement semisynchronous capability. There is one - plugin for the master side and one for the slave side. + The administrative interface to semisynchronous replication has + several components: - - System variables control plugin behavior: - - - rpl_semi_sync_master_enabled + Two plugins implement semisynchronous capability. There is one + plugin for the master side and one for the slave side. - - - Controls whether semisynchronous replication is enabled on the - master. To enable or disable the plugin, set this variable to - 1 or 0, respectively. The default is 0. - - rpl_semi_sync_slave_enabled + System variables control plugin behavior: - - Similar, but controls the slave plugin. - - + - - - rpl_semi_sync_master_timeout - + + + rpl_semi_sync_master_enabled + - - A value in seconds that controls how long the master waits on - a commit for acknowledgment from a slave before timing out and - reverting to asynchronous replication. The default value is 10 - seconds. - - + + Controls whether semisynchronous replication is enabled on + the master. To enable or disable the plugin, set this + variable to 1 or 0, respectively. The default is 0. + + - + + + rpl_semi_sync_master_timeout + - - Status variables enable semisynchronous replication monitoring: - + + A value in seconds that controls how long the master waits + on a commit for acknowledgment from a slave before timing + out and reverting to asynchronous replication. The default + value is 10 seconds. + + - + + + rpl_semi_sync_slave_enabled + - - - Rpl_semi_sync_master_clients - + + Similar to + rpl_semi_sync_master_enabled, but + controls the slave plugin. + + - - The number of semisynchronous slaves. - + - Rpl_semi_sync_master_status + Status variables enable semisynchronous replication + monitoring: - - Whether semisynchronous replication currently is operational - on the master. This is 1 if the plugin has been enabled and a - commit acknowledgment has not occurred. It is 0 if the plugin - is not enabled or the master has falled back to asynchronous - replication due to commit acknowledgment timeout. - - + - - - Rpl_semi_sync_master_no_tx - + + + Rpl_semi_sync_master_clients + - - The number of commits that were not acknowledged successfully. - - + + The number of semisynchronous slaves. + + - - - Rpl_semi_sync_master_yes_tx - + + + Rpl_semi_sync_master_status + - - The number of commits that were acknowledged successfully. - - + + Whether semisynchronous replication currently is + operational on the master. The value is 1 if the plugin + has been enabled and a commit acknowledgment has not + occurred. It is 0 if the plugin is not enabled or the + master has fallen back to asynchronous replication due to + commit acknowledgment timeout. + + - - - Rpl_semi_sync_slave_status - + + + Rpl_semi_sync_master_no_tx + - - Whether semisynchronous replication currently is operational - on the slave. This is 1 if the plugin has been enabled and the - slave I/O thread is running, 0 otherwise. - + + The number of commits that were not acknowledged + successfully. + + + + + + Rpl_semi_sync_master_yes_tx + + + + The number of commits that were acknowledged successfully. + + + + + + Rpl_semi_sync_slave_status + + + + Whether semisynchronous replication currently is + operational on the slave. This is 1 if the plugin has been + enabled and the slave I/O thread is running, 0 otherwise. + + + + - The system and status variables are unavailable unless the + The system and status variables are available only if the appropriate master or slave plugin has been installed with INSTALL PLUGIN. @@ -308,7 +332,7 @@
- Semisynchronous Replication Installation, Configuration, and Monitoring + Semisynchronous Replication Installation and Configuration semisynchronous replication @@ -320,53 +344,56 @@ configuration - - semisynchronous replication - monitoring - - Semisynchronous replication is implemented using plugins, so the plugins must be installed into the server to make them available. After a plugin has been installed, you control it by means of the - system variables associated with it. (These system variables are - not available until the associated plugin has been installed.) + system variables associated with it. These system variables are + unavailable until the associated plugin has been installed. - Semisynchronous replication is available beginning with MySQL - 6.0.x. The plugins are included in MySQL binary distributions. If - you build MySQL from source, the plugins will be compiled and - installed along with the rest of the distribution; no special - configuration options are required. + The capability of installing plugins requires a server that + supports dynamic loading. To verify this, check that the value of + the have_dynamic_loading system variable is + YES. Binary distributions should support + dynamic loading. If you compile MySQL from source, do not + configure the source distribution with the + option. + The semisynchronous replication plugins are not included with + MySQL distributions. Instead, they are distributed as a separate + component. + + + + [TODO] Give URL for obtaining + + + Currently, the plugins are available only on Unix. Windows is not yet supported. To set up semisynchronous replication, use the following - procedure. These instructions assume that you already have a - working replication set up. If you do not, see - , for information on setting up - a master/slave relationship. - - - - The INSTALL PLUGIN, + procedure. The INSTALL PLUGIN, SET GLOBAL, STOP SLAVE, and START SLAVE statements mentioned in these instructions require the - SUPER privilege. + SUPER privilege. The instructions + assume that you already have replication working. For information + on creating a master/slave relationship, see + . - To load the plugins, use INSTALL - PLUGIN on the master and on each slave that is to be - semisynchronous. + To load the plugins, use the INSTALL + PLUGIN statement on the master and on each slave that is + to be semisynchronous. @@ -400,7 +427,7 @@ - [At this point, system/status variables become visible] + [TODO] At this point, system/status variables become visible. @@ -411,8 +438,8 @@ - [I found that simply installing the plugin enabled it, at least on - the master side] + [TODO] I found that simply installing the plugin enabled it, at + least on the master side. @@ -473,7 +500,8 @@ replication can be set as command-line options or in an option file. A setting listed in an option file takes effect each time the server starts. For example, you can set the variables in - my.cnf files on the master and slave sides like this: + my.cnf files on the master and slave sides + like this: @@ -495,21 +523,43 @@ rpl_semi_sync_slave_enabled=1 +
+ +
+ + Semisynchronous Replication Monitoring + + + semisynchronous replication + monitoring + + - To check the values of the semisynchronous replication system - variables (regardless of whether you set them at startup or at - runtime), use SHOW VARIABLES: + The plugins for the semisynchronous replication capability expose + several system and status variables that you can examine to + determine its configuration and operational state. + + The system variable reflect how semisynchronous replication is + configured. To check their values, use SHOW + VARIABLES: + + mysql> SHOW VARIABLES LIKE 'rpl_semi_sync%'; - The plugins expose several status variables that enable you to - monitor the operation of semisynchronous replication. + The status variables enable you to monitor the operation of + semisynchronous replication. To check their values, use + SHOW STATUS: + +mysql> SHOW STATUS LIKE 'Rpl_semi_sync%'; + + When the master switches between asynchronous or semisynchronous replication due to commit-blocking timeout or a slave catching up, @@ -544,15 +594,6 @@ operational. - - To check the values of the semisynchronous replication status - variables, use SHOW STATUS: - - - -mysql> SHOW STATUS LIKE 'Rpl_semi_sync%'; - -