MySQL :: MySQL 8.0 Reference Manual :: 19.4.10.2 Configuring Semisynchronous Replication (original) (raw)

19.4.10.2 Configuring Semisynchronous Replication

When you install the source and replica plugins for semisynchronous replication (seeSection 19.4.10.1, “Installing Semisynchronous Replication”), system variables become available to control plugin behavior.

To check the current values of the status variables for semisynchronous replication, use SHOW VARIABLES:

mysql> SHOW VARIABLES LIKE 'rpl_semi_sync%';

From MySQL 8.0.26, new versions of the source and replica plugins are supplied, which replace the terms“master” and “slave” with“source” and “replica” in system variables and status variables. If you install the newrpl_semi_sync_source andrpl_semi_sync_replica plugins, the new system variables and status variables are available but the old ones are not. If you install the oldrpl_semi_sync_master andrpl_semi_sync_slave plugins, the old system variables and status variables are available but the new ones are not. You cannot have both the new and the old version of the relevant plugin installed on an instance.

All therpl_semi_sync_ _`xxx`_ system variables are described atSection 19.1.6.2, “Replication Source Options and Variables” andSection 19.1.6.3, “Replica Server Options and Variables”. Some key system variables are:

Therpl_semi_sync_source_wait_point orrpl_semi_sync_master_wait_point system variable controls the point at which a semisynchronous source server waits for replica acknowledgment of transaction receipt before returning a status to the client that committed the transaction. These values are permitted:

The replication characteristics of these settings differ as follows:

From MySQL 8.0.23, you can improve the performance of semisynchronous replication by enabling the system variablesreplication_sender_observe_commit_only, which limits callbacks, andreplication_optimize_for_static_plugin_config, which adds shared locks and avoids unnecessary lock acquisitions. These settings help as the number of replicas increases, because contention for locks can slow down performance. Semisynchronous replication source servers can also get performance benefits from enabling these system variables, because they use the same locking mechanisms as the replicas.