Comment 7 for bug 1254571

Revision history for this message
zhai weixiang (zhaiwx1987) wrote :

I haven't check the mariadb carefully,just quickly read the related code . I guess mariadb was affected too...Hope someone from maria can help me verifying it.

bellow is a simple test case.

source include/have_semisync_plugin.inc;
source include/have_debug.inc;
source include/have_innodb.inc;
source include/master-slave.inc;

#Install semisync plugin on slave
connection slave;
--replace_regex /\.dll/.so/
eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN';
select @@global.rpl_semi_sync_slave_enabled;
show variables like '%semi%';
SET GLOBAL rpl_semi_sync_slave_enabled= 1;
STOP SLAVE;
START SLAVE;

#Install semisync plugin on master
connection master;
--replace_regex /\.dll/.so/
eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN';
SET GLOBAL rpl_semi_sync_master_enabled = 1;
SET GLOBAL rpl_semi_sync_master_timeout = 100000000;

--sleep 2

CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
connect(con1,localhost,root,,);
connect(con2,localhost,root,,);

connection master;
SET GLOBAL rpl_semi_sync_master_wait_no_slave = 1;

connection slave;
#Stop slave, then all transaction on master will wait for restart of slave;
STOP SLAVE;

connection con1;
#leader of group commit
SET DEBUG_SYNC= "commit_after_get_LOCK_log SIGNAL con1_waiting WAIT_FOR
con2_queued";
send INSERT INTO t1 VALUES (1);

connection con2;
#follower of group commit
SET DEBUG_SYNC= "now WAIT_FOR con1_waiting";
SET DEBUG_SYNC= "commit_group_commit_queue SIGNAL con2_queued";
send INSERT INTO t1 VALUES (2);

connection master;
# we expact con1 and con2 should be both waiting for ACK
--sleep 1
SHOW PROCESSLIST;

connection slave;
START SLAVE;
--sleep 1

connection master;
SHOW PROCESSLIST;

#cleanup
DROP TABLE t1;
UNINSTALL PLUGIN rpl_semi_sync_master;

connection slave;
UNINSTALL PLUGIN rpl_semi_sync_slave;

--source include/rpl_end.inc