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.
#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;
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; have_debug. inc; have_innodb. inc; master- slave.inc;
source include/
source include/
source include/
#Install semisync plugin on slave SLAVE_PLUGIN' ; rpl_semi_ sync_slave_ enabled; sync_slave_ enabled= 1;
connection slave;
--replace_regex /\.dll/.so/
eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_
select @@global.
show variables like '%semi%';
SET GLOBAL rpl_semi_
STOP SLAVE;
START SLAVE;
#Install semisync plugin on master sync_master SONAME '$SEMISYNC_ MASTER_ PLUGIN' ; sync_master_ enabled = 1; sync_master_ timeout = 100000000;
connection master;
--replace_regex /\.dll/.so/
eval INSTALL PLUGIN rpl_semi_
SET GLOBAL rpl_semi_
SET GLOBAL rpl_semi_
--sleep 2
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb; con1,localhost, root,,) ; con2,localhost, root,,) ;
connect(
connect(
connection master; sync_master_ wait_no_ slave = 1;
SET GLOBAL rpl_semi_
connection slave;
#Stop slave, then all transaction on master will wait for restart of slave;
STOP SLAVE;
connection con1; after_get_ LOCK_log SIGNAL con1_waiting WAIT_FOR
#leader of group commit
SET DEBUG_SYNC= "commit_
con2_queued";
send INSERT INTO t1 VALUES (1);
connection con2; group_commit_ queue SIGNAL con2_queued";
#follower of group commit
SET DEBUG_SYNC= "now WAIT_FOR con1_waiting";
SET DEBUG_SYNC= "commit_
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 sync_master;
DROP TABLE t1;
UNINSTALL PLUGIN rpl_semi_
connection slave; sync_slave;
UNINSTALL PLUGIN rpl_semi_
--source include/rpl_end.inc