MySQL 5.7.22
启用增强半同步复制
MySQL对该参数值的描述
Semisync can wait for slave ACKs at one of two points,
AFTER_SYNC or AFTER_COMMIT. AFTER_SYNC is the default value.
AFTER_SYNC means that semisynchronous replication waits just after the
binary log file is flushed, but before the engine commits, and so
guarantees that no other sessions can see the data before replicated to
slave. AFTER_COMMIT means that semisynchronous replication waits just
after the engine commits. Other sessions may see the data before it is replicated, even though the current session is still waiting for the commit
to end successfully.
From: Source Code mysql-5.7.22\plugin\semisync\semisync_master_plugin.cc
Replication: Semisynchronous replication master servers now use a different wait point by default in communicating wih slaves. This is the point at which the master waits for acknowledgment of transaction receipt by a slave before returning a status to the client that committed the transaction. The wait point is controlled by the new rpl_semi_sync_master_wait_point system variable. These values are permitted:
AFTER_SYNC (the default): The master writes each transaction to its binary log and the slave, and syncs the binary log to disk. The master waits for slave acknowledgment of transaction receipt after the sync. Upon receiving acknowledgment, the master commits the transaction to the storage engine and returns a result to the client, which then can proceed.
AFTER_COMMIT: The master writes each transaction to its binary log and the slave, syncs the binary log, and commits the transaction to the storage engine. The master waits for slave acknowledgment of transaction receipt after the commit. Upon receiving acknowledgment, the master returns a result to the client, which then can proceed.
For older versions of MySQL, semisynchronous master behavior is equivalent to a setting of AFTER_COMMIT.
The