starting with version 5.7 MySQL supports semi-synchronous replication by extension, and when the primary library performs an update operation transaction, the commit operation is blocked until at least one semi-synchronous, replication Slave confirms that the update operation is received, the primary library's commit operation continues, and the semi-synchronous slave send acknowledgement message is only This update operation record has been recorded to the local relay log, if there is no slave send a confirmation messageWhen a timeout occurs, the semi-synchronous copy is converted to asynchronous replication.
Semi-synchronous replication can have an impact on MySQL performance because the commit action of the main library can only be performed after receiving at least one acknowledgement from the library. But this feature is a tradeoff between performance and data reliability.
The Rpl_semi_sync_master_wait_point parameter is used to control the behavior of semi-synchronous replication:
After_sync: Default Value
After_commit
The system parameters that need to be configured include:
Rpl_semi_sync_master_enabled: In the main library configuration, make sure that the semi-synchronous copy function of the main library is turned on
Rpl_semi_sync_master_timeout: Configures the main library to wait a few milliseconds to secure the acknowledgement of receiving the standby, and when this time is exceeded, the semi-synchronous becomes asynchronous
Rpl_semi_sync_slave_enabled: In the configuration from the library, make sure that the semi-synchronous copy function from the library is turned on
Internet companies mostly use the database is MySQL, want to stand out from the many IT workers, need to have advanced technology, learning to add value is essential. The way of learning is your insistence. The old boy education MySQL DBA course, after several updates the course, put an end to the paper, the whole enterprise real case unifies the theory instruction, wants to study the MySQL dba 's knowledge deeply, Can pay attention to the old boy education .
A brief analysis of MySQL semi-synchronous replication for MySQL database learning