Commit 0d25ee4f authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-4254 Semisync plugins to link statically into MariaDB

fix semisync plugins and tests to work with both with static and dynamic linking
parent c50ee6c2
......@@ -171,12 +171,12 @@ MACRO(MYSQL_ADD_PLUGIN)
IF(ARG_MANDATORY)
SET (mysql_mandatory_plugins
"${mysql_mandatory_plugins} builtin_maria_${target}_plugin,"
PARENT_SCOPE)
"${mysql_mandatory_plugins} builtin_maria_${target}_plugin,")
SET (mysql_mandatory_plugins ${mysql_mandatory_plugins} PARENT_SCOPE)
ELSE()
SET (mysql_optional_plugins
"${mysql_optional_plugins} builtin_maria_${target}_plugin,"
PARENT_SCOPE)
"${mysql_optional_plugins} builtin_maria_${target}_plugin,")
SET (mysql_optional_plugins ${mysql_optional_plugins} PARENT_SCOPE)
ENDIF()
ELSEIF(NOT WITHOUT_${plugin} AND NOT ARG_STATIC_ONLY AND NOT WITHOUT_DYNAMIC_PLUGINS)
......
if (`select count(*) < 2 from information_schema.plugins where plugin_name like 'rpl_semi_sync_%'`)
{
--skip Test requires semisync plugins
}
--plugin-load=$SEMISYNC_MASTER_SO
--plugin-load=$SEMISYNC_SLAVE_SO
--loose-rpl-semi-sync-master
--loose-rpl-semi-sync-slave
#
# Check if server has support for loading plugins
#
if (`SELECT @@have_dynamic_loading != 'YES'`) {
--skip Requires dynamic loading
}
#
# Check if the variable SEMISYNC_MASTER_SO is set
#
if (!$SEMISYNC_MASTER_SO)
{
skip Need semisync plugins;
}
include/master-slave.inc
[connection master]
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master';
SET GLOBAL rpl_semi_sync_master_enabled = ON;
SET DEBUG_SYNC = "rpl_semisync_master_commit_trx_before_lock SIGNAL m1_ready WAIT_FOR m1_cont";
INSERT INTO t1 SELECT * FROM t1;
......@@ -9,5 +8,4 @@ SET DEBUG_SYNC= "now WAIT_FOR m1_ready";
SET GLOBAL rpl_semi_sync_master_enabled = OFF;
SET DEBUG_SYNC= "now SIGNAL m1_cont";
DROP TABLE t1;
UNINSTALL PLUGIN rpl_semi_sync_master;
include/rpl_end.inc
include/master-slave.inc
[connection master]
call mtr.add_suppression("Timeout waiting for reply of binlog");
call mtr.add_suppression("Read semi-sync reply");
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
call mtr.add_suppression("Master server does not support semi-sync");
call mtr.add_suppression("Semi-sync slave .* reply");
call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
#
# Uninstall semi-sync plugins on master and slave
#
include/stop_slave.inc
reset slave;
set global rpl_semi_sync_master_enabled= 0;
set global rpl_semi_sync_slave_enabled= 0;
reset master;
set global rpl_semi_sync_master_enabled= 0;
set global rpl_semi_sync_slave_enabled= 0;
#
# Main test of semi-sync replication start here
#
[ on master ]
set global rpl_semi_sync_master_timeout= 60000;
[ default state of semi-sync on master should be OFF ]
show variables like 'rpl_semi_sync_master_enabled';
Variable_name Value
......@@ -41,9 +54,7 @@ Rpl_semi_sync_master_status OFF
show status like 'Rpl_semi_sync_master_yes_tx';
Variable_name Value
Rpl_semi_sync_master_yes_tx 0
#
# INSTALL PLUGIN semi-sync on slave
#
reset master;
[ on slave ]
[ default state of semi-sync on slave should be OFF ]
show variables like 'rpl_semi_sync_slave_enabled';
......@@ -84,6 +95,16 @@ select CONNECTIONS_NORMAL_SLAVE - CONNECTIONS_NORMAL_SLAVE as 'Should be 0';
Should be 0
0
[ insert records to table ]
insert t1 values (10);
insert t1 values (9);
insert t1 values (8);
insert t1 values (7);
insert t1 values (6);
insert t1 values (5);
insert t1 values (4);
insert t1 values (3);
insert t1 values (2);
insert t1 values (1);
[ master status after inserts ]
show status like 'Rpl_semi_sync_master_status';
Variable_name Value
......@@ -159,6 +180,16 @@ Rpl_semi_sync_master_no_tx 1
show status like 'Rpl_semi_sync_master_yes_tx';
Variable_name Value
Rpl_semi_sync_master_yes_tx 14
delete from t1 where a=10;
delete from t1 where a=9;
delete from t1 where a=8;
delete from t1 where a=7;
delete from t1 where a=6;
delete from t1 where a=5;
delete from t1 where a=4;
delete from t1 where a=3;
delete from t1 where a=2;
delete from t1 where a=1;
insert into t1 values (100);
[ master status should be OFF ]
show status like 'Rpl_semi_sync_master_status';
......@@ -278,6 +309,7 @@ Rpl_semi_sync_master_yes_tx 0
[ on slave ]
include/stop_slave.inc
reset slave;
kill query _tid;
include/start_slave.inc
[ on master ]
create table t1 (a int) engine = ENGINE_TYPE;
......@@ -307,6 +339,7 @@ include/stop_slave.inc
reset slave;
[ on master ]
reset master;
kill query _tid;
set sql_log_bin=0;
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
flush privileges;
......@@ -357,6 +390,7 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
Variable_name Value
Rpl_semi_sync_slave_status OFF
[ on master ]
kill query _tid;
[ Semi-sync status on master should be ON ]
show status like 'Rpl_semi_sync_master_clients';
Variable_name Value
......@@ -385,11 +419,7 @@ Variable_name Value
Rpl_semi_sync_slave_status ON
include/stop_slave.inc
[ on master ]
set sql_log_bin=0;
UNINSTALL PLUGIN rpl_semi_sync_master;
set sql_log_bin=1;
SHOW VARIABLES LIKE 'rpl_semi_sync_master_enabled';
Variable_name Value
set global rpl_semi_sync_master_enabled= 0;
[ on slave ]
SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
Variable_name Value
......@@ -397,18 +427,10 @@ rpl_semi_sync_slave_enabled ON
include/start_slave.inc
[ on master ]
insert into t1 values (10);
[ on slave ]
SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
Variable_name Value
Rpl_semi_sync_slave_status OFF
#
# Test non-semi-sync slave connect to semi-sync master
#
set sql_log_bin=0;
INSTALL PLUGIN rpl_semi_sync_master SONAME 'SEMISYNC_MASTER_SO';
set global rpl_semi_sync_master_timeout= 5000;
/* 5s */
set sql_log_bin=1;
set global rpl_semi_sync_master_enabled= 1;
[ on slave ]
include/stop_slave.inc
......@@ -416,16 +438,8 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
Variable_name Value
Rpl_semi_sync_slave_status OFF
[ uninstall semi-sync slave plugin ]
UNINSTALL PLUGIN rpl_semi_sync_slave;
SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
Variable_name Value
include/start_slave.inc
SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
Variable_name Value
include/stop_slave.inc
[ reinstall semi-sync slave plugin and disable semi-sync ]
INSTALL PLUGIN rpl_semi_sync_slave SONAME 'SEMISYNC_SLAVE_SO';
set global rpl_semi_sync_slave_enabled= 0;
[ reinstall semi-sync slave plugin and disable semi-sync ]
SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
Variable_name Value
rpl_semi_sync_slave_enabled OFF
......@@ -440,11 +454,12 @@ Rpl_semi_sync_slave_status OFF
# Clean up
#
include/stop_slave.inc
UNINSTALL PLUGIN rpl_semi_sync_slave;
UNINSTALL PLUGIN rpl_semi_sync_master;
set global rpl_semi_sync_slave_enabled= 0;
set global rpl_semi_sync_master_enabled= 0;
change master to master_user='root',master_password='';
include/start_slave.inc
drop table t1;
drop user rpl@127.0.0.1;
flush privileges;
set global rpl_semi_sync_master_timeout= default;
include/rpl_end.inc
include/master-slave.inc
[connection master]
call mtr.add_suppression("Timeout waiting for reply of binlog");
call mtr.add_suppression("Semi-sync master .* waiting for slave reply");
call mtr.add_suppression("Read semi-sync reply");
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
call mtr.add_suppression("Master server does not support semi-sync");
call mtr.add_suppression("Semi-sync slave .* reply");
call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
set global rpl_semi_sync_master_enabled = 1;
include/stop_slave.inc
set global rpl_semi_sync_slave_enabled = 1;
include/start_slave.inc
SET GLOBAL event_scheduler = ON;
CREATE TABLE t1 (i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f varchar(8)) ENGINE=ENGINE_TYPE;
......@@ -34,8 +43,8 @@ UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 2;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 1;
SET GLOBAL event_scheduler = OFF;
include/stop_slave.inc
UNINSTALL PLUGIN rpl_semi_sync_slave;
UNINSTALL PLUGIN rpl_semi_sync_master;
set global rpl_semi_sync_slave_enabled = 0;
set global rpl_semi_sync_master_enabled = 0;
include/start_slave.inc
DROP EVENT ev1;
DROP EVENT ev2;
......
include/master-slave.inc
[connection master]
INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so';
CREATE TEMPORARY TABLE tmp (i INT);
include/rpl_end.inc
uninstall plugin rpl_semi_sync_master;
--source include/have_semisync_plugin.inc
--source include/have_semisync.inc
--source include/not_embedded.inc
--source include/have_debug_sync.inc
--source include/have_binlog_format_mixed_or_statement.inc
......@@ -13,7 +13,6 @@
# the code, disable the semisync, and then continue the paused thread.
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master';
SET GLOBAL rpl_semi_sync_master_enabled = ON;
--connection master1
SET DEBUG_SYNC = "rpl_semisync_master_commit_trx_before_lock SIGNAL m1_ready WAIT_FOR m1_cont";
......@@ -29,8 +28,4 @@ SET DEBUG_SYNC= "now SIGNAL m1_cont";
connection master;
DROP TABLE t1;
disable_warnings;
UNINSTALL PLUGIN rpl_semi_sync_master;
enable_warnings;
--source include/rpl_end.inc
source include/have_semisync_plugin.inc;
source include/have_semisync.inc;
source include/not_embedded.inc;
source include/have_innodb.inc;
source include/master-slave.inc;
......@@ -7,7 +7,6 @@ let $engine_type= InnoDB;
#let $engine_type= MyISAM;
# Suppress warnings that might be generated during the test
disable_query_log;
connection master;
call mtr.add_suppression("Timeout waiting for reply of binlog");
call mtr.add_suppression("Read semi-sync reply");
......@@ -16,7 +15,6 @@ connection slave;
call mtr.add_suppression("Master server does not support semi-sync");
call mtr.add_suppression("Semi-sync slave .* reply");
call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
enable_query_log;
connection master;
# wait for dying connections (if any) to disappear
......@@ -32,27 +30,15 @@ let $_connections_normal_slave= query_get_value(SHOW STATUS LIKE 'Threads_connec
--echo # Uninstall semi-sync plugins on master and slave
--echo #
connection slave;
disable_query_log;
source include/stop_slave.inc;
reset slave;
disable_warnings;
error 0,1305;
UNINSTALL PLUGIN rpl_semi_sync_slave;
error 0,1305;
UNINSTALL PLUGIN rpl_semi_sync_master;
enable_warnings;
set global rpl_semi_sync_master_enabled= 0;
set global rpl_semi_sync_slave_enabled= 0;
connection master;
reset master;
set sql_log_bin=0;
disable_warnings;
error 0,1305;
UNINSTALL PLUGIN rpl_semi_sync_slave;
error 0,1305;
UNINSTALL PLUGIN rpl_semi_sync_master;
enable_warnings;
set sql_log_bin=1;
enable_query_log;
set global rpl_semi_sync_master_enabled= 0;
set global rpl_semi_sync_slave_enabled= 0;
--echo #
--echo # Main test of semi-sync replication start here
......@@ -61,16 +47,7 @@ enable_query_log;
connection master;
echo [ on master ];
disable_query_log;
let $value = query_get_value(show variables like 'rpl_semi_sync_master_enabled', Value, 1);
if ($value == No such row)
{
set sql_log_bin=0;
eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
set global rpl_semi_sync_master_timeout= 60000; /* 60s */
set sql_log_bin=1;
}
enable_query_log;
set global rpl_semi_sync_master_timeout= 60000; # 60s
echo [ default state of semi-sync on master should be OFF ];
show variables like 'rpl_semi_sync_master_enabled';
......@@ -116,28 +93,12 @@ show status like 'Rpl_semi_sync_master_status';
--replace_result 305 304
show status like 'Rpl_semi_sync_master_yes_tx';
disable_query_log;
# reset master to make sure the following test will start with a clean environment
reset master;
enable_query_log;
--echo #
--echo # INSTALL PLUGIN semi-sync on slave
--echo #
connection slave;
echo [ on slave ];
disable_query_log;
let $value= query_get_value(show variables like 'rpl_semi_sync_slave_enabled', Value, 1);
if ($value == No such row)
{
set sql_log_bin=0;
eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_SO';
set sql_log_bin=1;
}
enable_query_log;
echo [ default state of semi-sync on slave should be OFF ];
show variables like 'rpl_semi_sync_slave_enabled';
......@@ -177,15 +138,17 @@ let $_connections_semisync_slave= query_get_value(SHOW STATUS LIKE 'Threads_conn
replace_result $_connections_normal_slave CONNECTIONS_NORMAL_SLAVE $_connections_semisync_slave CONNECTIONS_SEMISYNC_SLAVE;
eval select $_connections_semisync_slave - $_connections_normal_slave as 'Should be 0';
let $i=10;
echo [ insert records to table ];
disable_query_log;
while ($i)
{
eval insert into t1 values ($i);
dec $i;
}
enable_query_log;
insert t1 values (10);
insert t1 values (9);
insert t1 values (8);
insert t1 values (7);
insert t1 values (6);
insert t1 values (5);
insert t1 values (4);
insert t1 values (3);
insert t1 values (2);
insert t1 values (1);
echo [ master status after inserts ];
show status like 'Rpl_semi_sync_master_status';
......@@ -271,14 +234,16 @@ show status like 'Rpl_semi_sync_master_yes_tx';
# Semi-sync status on master is now OFF, so all these transactions
# will be replicated asynchronously.
let $i=10;
disable_query_log;
while ($i)
{
eval delete from t1 where a=$i;
dec $i;
}
enable_query_log;
delete from t1 where a=10;
delete from t1 where a=9;
delete from t1 where a=8;
delete from t1 where a=7;
delete from t1 where a=6;
delete from t1 where a=5;
delete from t1 where a=4;
delete from t1 where a=3;
delete from t1 where a=2;
delete from t1 where a=1;
insert into t1 values (100);
......@@ -408,9 +373,8 @@ connection master;
let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`;
if ($_tid)
{
disable_query_log;
--replace_result $_tid _tid
eval kill query $_tid;
enable_query_log;
# After dump thread exit, Rpl_semi_sync_master_clients will be 0
let $status_var= Rpl_semi_sync_master_clients;
......@@ -463,9 +427,8 @@ reset master;
let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`;
if ($_tid)
{
disable_query_log;
--replace_result $_tid _tid
eval kill query $_tid;
enable_query_log;
# After dump thread exit, Rpl_semi_sync_master_clients will be 0
let $status_var= Rpl_semi_sync_master_clients;
......@@ -525,9 +488,8 @@ echo [ on master ];
let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`;
if ($_tid)
{
disable_query_log;
--replace_result $_tid _tid
eval kill query $_tid;
enable_query_log;
# After dump thread exit, Rpl_semi_sync_master_clients will be 0
let $status_var= Rpl_semi_sync_master_clients;
......@@ -562,11 +524,7 @@ connection slave;
source include/stop_slave.inc;
connection master;
echo [ on master ];
set sql_log_bin=0;
UNINSTALL PLUGIN rpl_semi_sync_master;
set sql_log_bin=1;
enable_query_log;
SHOW VARIABLES LIKE 'rpl_semi_sync_master_enabled';
set global rpl_semi_sync_master_enabled= 0;
connection slave;
echo [ on slave ];
......@@ -577,19 +535,13 @@ connection master;
echo [ on master ];
insert into t1 values (10);
sync_slave_with_master;
echo [ on slave ];
SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
--echo #
--echo # Test non-semi-sync slave connect to semi-sync master
--echo #
connection master;
set sql_log_bin=0;
replace_result $SEMISYNC_MASTER_SO SEMISYNC_MASTER_SO;
eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
set global rpl_semi_sync_master_timeout= 5000; /* 5s */
set sql_log_bin=1;
set global rpl_semi_sync_master_timeout= 5000; # 5s
set global rpl_semi_sync_master_enabled= 1;
connection slave;
......@@ -598,16 +550,9 @@ source include/stop_slave.inc;
SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
echo [ uninstall semi-sync slave plugin ];
UNINSTALL PLUGIN rpl_semi_sync_slave;
SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
source include/start_slave.inc;
SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
source include/stop_slave.inc;
set global rpl_semi_sync_slave_enabled= 0;
echo [ reinstall semi-sync slave plugin and disable semi-sync ];
replace_result $SEMISYNC_SLAVE_SO SEMISYNC_SLAVE_SO;
eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_SO';
set global rpl_semi_sync_slave_enabled= 0;
SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
source include/start_slave.inc;
......@@ -619,14 +564,10 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
connection slave;
source include/stop_slave.inc;
UNINSTALL PLUGIN rpl_semi_sync_slave;
set global rpl_semi_sync_slave_enabled= 0;
connection master;
# The dump thread may still be running on the master, and so the following
# UNINSTALL could generate a warning about the plugin is busy.
disable_warnings;
UNINSTALL PLUGIN rpl_semi_sync_master;
enable_warnings;
set global rpl_semi_sync_master_enabled= 0;
connection slave;
change master to master_user='root',master_password='';
......@@ -639,4 +580,5 @@ sync_slave_with_master;
connection master;
drop user rpl@127.0.0.1;
flush privileges;
set global rpl_semi_sync_master_timeout= default;
--source include/rpl_end.inc
source include/have_semisync_plugin.inc;
source include/have_semisync.inc;
source include/not_embedded.inc;
source include/master-slave.inc;
source include/have_innodb.inc;
source include/master-slave.inc;
let $engine_type= InnoDB;
# Suppress warnings that might be generated during the test
disable_query_log;
connection master;
call mtr.add_suppression("Timeout waiting for reply of binlog");
call mtr.add_suppression("Semi-sync master .* waiting for slave reply");
......@@ -16,33 +15,13 @@ connection slave;
call mtr.add_suppression("Master server does not support semi-sync");
call mtr.add_suppression("Semi-sync slave .* reply");
call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
enable_query_log;
connection master;
disable_query_log;
let $value = query_get_value(show variables like 'rpl_semi_sync_master_enabled', Value, 1);
if ($value == No such row)
{
set sql_log_bin=0;
eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
SET GLOBAL rpl_semi_sync_master_enabled = 1;
set sql_log_bin=1;
}
enable_query_log;
set global rpl_semi_sync_master_enabled = 1;
connection slave;
source include/stop_slave.inc;
disable_query_log;
let $value= query_get_value(show variables like 'rpl_semi_sync_slave_enabled', Value, 1);
if ($value == No such row)
{
set sql_log_bin=0;
eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_SO';
SET GLOBAL rpl_semi_sync_slave_enabled = 1;
set sql_log_bin=1;
}
enable_query_log;
set global rpl_semi_sync_slave_enabled = 1;
source include/start_slave.inc;
......@@ -93,18 +72,16 @@ while ($run)
#
connection slave;
source include/stop_slave.inc;
disable_warnings;
UNINSTALL PLUGIN rpl_semi_sync_slave;
set global rpl_semi_sync_slave_enabled = 0;
connection master;
UNINSTALL PLUGIN rpl_semi_sync_master;
enable_warnings;
set global rpl_semi_sync_master_enabled = 0;
connection slave;
source include/start_slave.inc;
connection master;
DROP EVENT ev1;
DROP EVENT ev2;
DROP TABLE t1;
......
#
# MDEV-4066 semisync_master + temporary tables causes memory leaks
#
source include/have_semisync_plugin.inc;
source include/have_semisync.inc;
source include/have_binlog_format_row.inc;
source include/master-slave.inc;
connection master;
--replace_result .dll .so
eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
--connect (con1,localhost,root,,)
CREATE TEMPORARY TABLE tmp (i INT);
--disconnect con1
source include/rpl_end.inc;
uninstall plugin rpl_semi_sync_master;
INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so';
select @@global.rpl_semi_sync_master_enabled;
@@global.rpl_semi_sync_master_enabled
0
......@@ -70,4 +69,3 @@ SET @@global.rpl_semi_sync_master_enabled = @start_global_value;
select @@global.rpl_semi_sync_master_enabled;
@@global.rpl_semi_sync_master_enabled
0
UNINSTALL PLUGIN rpl_semi_sync_master;
INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so';
select @@global.rpl_semi_sync_master_timeout;
@@global.rpl_semi_sync_master_timeout
10000
......@@ -51,4 +50,3 @@ SET @@global.rpl_semi_sync_master_timeout = @start_global_value;
select @@global.rpl_semi_sync_master_timeout;
@@global.rpl_semi_sync_master_timeout
10000
UNINSTALL PLUGIN rpl_semi_sync_master;
INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so';
select @@global.rpl_semi_sync_master_trace_level;
@@global.rpl_semi_sync_master_trace_level
32
......@@ -69,4 +68,3 @@ SET @@global.rpl_semi_sync_master_trace_level = @start_global_value;
select @@global.rpl_semi_sync_master_trace_level;
@@global.rpl_semi_sync_master_trace_level
32
UNINSTALL PLUGIN rpl_semi_sync_master;
INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so';
select @@global.rpl_semi_sync_master_wait_no_slave;
@@global.rpl_semi_sync_master_wait_no_slave
1
......@@ -70,4 +69,3 @@ SET @@global.rpl_semi_sync_master_wait_no_slave = @start_global_value;
select @@global.rpl_semi_sync_master_wait_no_slave;
@@global.rpl_semi_sync_master_wait_no_slave
1
UNINSTALL PLUGIN rpl_semi_sync_master;
INSTALL PLUGIN rpl_semi_sync_slave SONAME 'semisync_slave.so';
select @@global.rpl_semi_sync_slave_enabled;
@@global.rpl_semi_sync_slave_enabled
0
......@@ -70,4 +69,3 @@ SET @@global.rpl_semi_sync_slave_enabled = @start_global_value;
select @@global.rpl_semi_sync_slave_enabled;
@@global.rpl_semi_sync_slave_enabled
0
UNINSTALL PLUGIN rpl_semi_sync_slave;
INSTALL PLUGIN rpl_semi_sync_slave SONAME 'semisync_slave.so';
select @@global.rpl_semi_sync_slave_trace_level;
@@global.rpl_semi_sync_slave_trace_level
32
......@@ -69,4 +68,3 @@ SET @@global.rpl_semi_sync_slave_trace_level = @start_global_value;
select @@global.rpl_semi_sync_slave_trace_level;
@@global.rpl_semi_sync_slave_trace_level
32
UNINSTALL PLUGIN rpl_semi_sync_slave;
......@@ -6,10 +6,7 @@
#
#
source include/not_embedded.inc;
source include/have_semisync_plugin.inc;
# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll'
--replace_regex /\.dll/.so/
eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
source include/have_semisync.inc;
select @@global.rpl_semi_sync_master_enabled;
SET @start_global_value = @@global.rpl_semi_sync_master_enabled;
......@@ -61,5 +58,3 @@ set global rpl_semi_sync_master_enabled="some text";
#
SET @@global.rpl_semi_sync_master_enabled = @start_global_value;
select @@global.rpl_semi_sync_master_enabled;
UNINSTALL PLUGIN rpl_semi_sync_master;
......@@ -5,10 +5,7 @@
# 2010-01-21 OBN - Added
#
source include/not_embedded.inc;
source include/have_semisync_plugin.inc;
# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll'
--replace_regex /\.dll/.so/
eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
source include/have_semisync.inc;
select @@global.rpl_semi_sync_master_timeout;
SET @start_global_value = @@global.rpl_semi_sync_master_timeout;
......@@ -51,5 +48,3 @@ set global rpl_semi_sync_master_timeout="some text";
#
SET @@global.rpl_semi_sync_master_timeout = @start_global_value;
select @@global.rpl_semi_sync_master_timeout;
UNINSTALL PLUGIN rpl_semi_sync_master;
......@@ -5,10 +5,7 @@
# 2010-01-21 OBN - Added
#
source include/not_embedded.inc;
source include/have_semisync_plugin.inc;
# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll'
--replace_regex /\.dll/.so/
eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
source include/have_semisync.inc;
select @@global.rpl_semi_sync_master_trace_level;
SET @start_global_value = @@global.rpl_semi_sync_master_trace_level;
......@@ -59,5 +56,3 @@ set global rpl_semi_sync_master_trace_level="some text";
#
SET @@global.rpl_semi_sync_master_trace_level = @start_global_value;
select @@global.rpl_semi_sync_master_trace_level;
UNINSTALL PLUGIN rpl_semi_sync_master;
......@@ -6,10 +6,7 @@
#
#
source include/not_embedded.inc;
source include/have_semisync_plugin.inc;
# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll'
--replace_regex /\.dll/.so/
eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
source include/have_semisync.inc;
select @@global.rpl_semi_sync_master_wait_no_slave;
SET @start_global_value = @@global.rpl_semi_sync_master_wait_no_slave;
......@@ -61,5 +58,4 @@ set global rpl_semi_sync_master_wait_no_slave="some text";
#
SET @@global.rpl_semi_sync_master_wait_no_slave = @start_global_value;
select @@global.rpl_semi_sync_master_wait_no_slave;
UNINSTALL PLUGIN rpl_semi_sync_master;
......@@ -6,10 +6,7 @@
#
#
source include/not_embedded.inc;
source include/have_semisync_plugin.inc;
# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll'
--replace_regex /\.dll/.so/
eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_SO';
source include/have_semisync.inc;
select @@global.rpl_semi_sync_slave_enabled;
SET @start_global_value = @@global.rpl_semi_sync_slave_enabled;
......@@ -62,5 +59,3 @@ set global rpl_semi_sync_slave_enabled="some text";
#
SET @@global.rpl_semi_sync_slave_enabled = @start_global_value;
select @@global.rpl_semi_sync_slave_enabled;
UNINSTALL PLUGIN rpl_semi_sync_slave;
......@@ -5,10 +5,7 @@
# 2010-01-21 OBN - Added
#
source include/not_embedded.inc;
source include/have_semisync_plugin.inc;
# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll'
--replace_regex /\.dll/.so/
eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_SO';
source include/have_semisync.inc;
select @@global.rpl_semi_sync_slave_trace_level;
SET @start_global_value = @@global.rpl_semi_sync_slave_trace_level;
......@@ -59,5 +56,3 @@ set global rpl_semi_sync_slave_trace_level="some text";
#
SET @@global.rpl_semi_sync_slave_trace_level = @start_global_value;
select @@global.rpl_semi_sync_slave_trace_level;
UNINSTALL PLUGIN rpl_semi_sync_slave;
......@@ -27,7 +27,7 @@ perl;
feedback debug temp-pool ssl des-key-file xtradb sequence
thread-concurrency super-large-pages mutex-deadlock-detector
null-audit aria pbxt oqgraph sphinx thread-handling
test-sql-discovery query-cache-info/;
test-sql-discovery rpl-semi-sync query-cache-info/;
# And substitute the content some environment variables with their
# names:
......
......@@ -17,11 +17,10 @@ SET(SEMISYNC_MASTER_SOURCES
semisync.cc semisync_master.cc semisync_master_plugin.cc
semisync.h semisync_master.h)
MYSQL_ADD_PLUGIN(semisync_master ${SEMISYNC_MASTER_SOURCES}
MODULE_ONLY MODULE_OUTPUT_NAME "semisync_master")
MYSQL_ADD_PLUGIN(semisync_master ${SEMISYNC_MASTER_SOURCES})
SET(SEMISYNC_SLAVE_SOURCES semisync.cc semisync_slave.cc
semisync_slave_plugin.cc semisync.h semisync_slave.h )
MYSQL_ADD_PLUGIN(semisync_slave ${SEMISYNC_SLAVE_SOURCES}
MODULE_ONLY MODULE_OUTPUT_NAME "semisync_slave")
MYSQL_ADD_PLUGIN(semisync_slave ${SEMISYNC_SLAVE_SOURCES})
......@@ -429,12 +429,13 @@ int ReplSemiSyncMaster::disableMaster()
return 0;
}
ReplSemiSyncMaster::~ReplSemiSyncMaster()
void ReplSemiSyncMaster::cleanup()
{
if (init_done_)
{
mysql_mutex_destroy(&LOCK_binlog_);
mysql_cond_destroy(&COND_binlog_send_);
init_done_= 0;
}
delete active_tranxs_;
......
......@@ -453,7 +453,9 @@ class ReplSemiSyncMaster
public:
ReplSemiSyncMaster();
~ReplSemiSyncMaster();
~ReplSemiSyncMaster() {}
void cleanup();
bool getMasterEnabled() {
return master_enabled_;
......
......@@ -19,7 +19,7 @@
#include "semisync_master.h"
#include "sql_class.h" // THD
ReplSemiSyncMaster repl_semisync;
static ReplSemiSyncMaster repl_semisync;
C_MODE_START
......@@ -405,6 +405,7 @@ static int semi_sync_master_plugin_deinit(void *p)
sql_print_error("unregister_binlog_transmit_observer failed");
return 1;
}
repl_semisync.cleanup();
sql_print_information("unregister_replicator OK");
return 0;
}
......@@ -416,7 +417,7 @@ struct Mysql_replication semi_sync_master_plugin= {
/*
Plugin library descriptor
*/
mysql_declare_plugin(semi_sync_master)
maria_declare_plugin(semisync_master)
{
MYSQL_REPLICATION_PLUGIN,
&semi_sync_master_plugin,
......@@ -429,7 +430,8 @@ mysql_declare_plugin(semi_sync_master)
0x0100 /* 1.0 */,
semi_sync_master_status_vars, /* status variables */
semi_sync_master_system_vars, /* system variables */
NULL, /* config options */
0, /* flags */
"1.0",
MariaDB_PLUGIN_MATURITY_UNKNOWN
}
mysql_declare_plugin_end;
maria_declare_plugin_end;
......@@ -18,7 +18,7 @@
#include "semisync_slave.h"
#include <mysql.h>
ReplSemiSyncSlave repl_semisync;
static ReplSemiSyncSlave repl_semisync;
/*
indicate whether or not the slave should send a reply to the master.
......@@ -212,7 +212,7 @@ struct Mysql_replication semi_sync_slave_plugin= {
/*
Plugin library descriptor
*/
mysql_declare_plugin(semi_sync_slave)
maria_declare_plugin(semisync_slave)
{
MYSQL_REPLICATION_PLUGIN,
&semi_sync_slave_plugin,
......@@ -225,7 +225,8 @@ mysql_declare_plugin(semi_sync_slave)
0x0100 /* 1.0 */,
semi_sync_slave_status_vars, /* status variables */
semi_sync_slave_system_vars, /* system variables */
NULL, /* config options */
0, /* flags */
"1.0",
MariaDB_PLUGIN_MATURITY_UNKNOWN
}
mysql_declare_plugin_end;
maria_declare_plugin_end;
......@@ -555,4 +555,24 @@ int unregister_binlog_relay_io_observer(Binlog_relay_IO_observer *observer, void
{
return binlog_relay_io_delegate->remove_observer(observer, (st_plugin_int *)p);
}
#else
int register_binlog_transmit_observer(Binlog_transmit_observer *observer, void *p)
{
return 0;
}
int unregister_binlog_transmit_observer(Binlog_transmit_observer *observer, void *p)
{
return 0;
}
int register_binlog_relay_io_observer(Binlog_relay_IO_observer *observer, void *p)
{
return 0;
}
int unregister_binlog_relay_io_observer(Binlog_relay_IO_observer *observer, void *p)
{
return 0;
}
#endif /* HAVE_REPLICATION */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment