Semisync replication doesn't properly distinguish multiple master connections, which causes different problems. For example, if one master has the semisync plugin, and another one doesn't, trying to enable semisync on slave makes replication from both masters abort. The actual errors vary. With the test case below, most often I'm getting
On the connection with the master which does not have the semisync plugin:
Last_IO_Error Fatal error: Failed to run 'after_read_event' hook
On the connection with the master which has the semisync plugin:
Last_SQL_Error Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
Last_IO_Error Relay log write failure: could not queue event from master
If we decide to support it, the corresponding variables Rpl_semi_sync_slave_status and rpl_semi_sync_slave_enabled should probably be made session-aware.
The test case is draft, it should not be added to the suite as is. It contains sleeps that are unreliable and slow, when the problem is fixed, they should be replaced with proper waits and syncs.
Please make sure you have at least revno 3438 from 10.0-base, since the test uses reset_master_slave.inc include file which was added there.
If you haven't got the error on the first attempt, give it another try, sometimes it gets lucky and passes, apparently there is some kind of a race condition.
# TODO: when the problem is fixed,
# instead of the sleeps below there should be proper
# waits for slaves to start, and also synchronization
# with each master. For now, it will just make the test
# hang for long time, so I won't put it here.
# Also, an log error suppression will need to be added.
install soname 'semisync_master.so';
install soname 'semisync_slave.so';
set global rpl_semi_sync_slave_enabled = 1;
--replace_result $SERVER_MYPORT_1 MYPORT_1
eval change master 'master1' to
start slave 'master1';
--replace_result $SERVER_MYPORT_2 MYPORT_2
eval change master 'master2' to
start slave 'master2';
stop all slaves;
start all slaves;
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
query_vertical show all slaves status;
uninstall plugin rpl_semi_sync_slave;
uninstall plugin rpl_semi_sync_master;