Commit 2a935329 authored by Igor Babaev's avatar Igor Babaev

Merge branch '10.4' into bb-10.4-mdev7486

parents 2e73c561 ddc98339
......@@ -13,8 +13,7 @@ gtid_ignore_duplicates
wsrep-provider=@ENV.WSREP_PROVIDER
wsrep_node_address=127.0.0.1
# enforce read-committed characteristics across the cluster
# wsrep-causal-reads=ON
# wsrep-sync-wait=15
wsrep-sync-wait=15
[mysqld.1]
#galera_port=@OPT.port
......
connection node_2;
connection node_1;
connection node_1;
cluster 1 node 1
SHOW STATUS LIKE 'wsrep_cluster_size';
Variable_name Value
wsrep_cluster_size 3
connection node_2;
cluster 1 node 2
SHOW STATUS LIKE 'wsrep_cluster_size';
Variable_name Value
wsrep_cluster_size 3
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
connection node_3;
cluster 1 node 3
SHOW STATUS LIKE 'wsrep_cluster_size';
Variable_name Value
wsrep_cluster_size 3
connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4;
connection node_4;
cluster 2 node 1
SHOW STATUS LIKE 'wsrep_cluster_size';
Variable_name Value
wsrep_cluster_size 3
connect node_5, 127.0.0.1, root, , test, $NODE_MYPORT_5;
connection node_5;
cluster 2 node 2
SHOW STATUS LIKE 'wsrep_cluster_size';
Variable_name Value
wsrep_cluster_size 3
connect node_6, 127.0.0.1, root, , test, $NODE_MYPORT_6;
connection node_6;
cluster 2 node 3
SHOW STATUS LIKE 'wsrep_cluster_size';
Variable_name Value
wsrep_cluster_size 3
connection node_1;
change master to master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_4, master_use_gtid=current_pos, ignore_server_ids=(12,13);;
start slave;
include/wait_for_slave_to_start.inc
......@@ -31,6 +44,7 @@ select @@gtid_binlog_state;
select @@gtid_slave_pos;
@@gtid_slave_pos
connection node_4;
change master to master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_1, master_use_gtid=current_pos, ignore_server_ids=(22,23);;
start slave;
include/wait_for_slave_to_start.inc
......@@ -41,15 +55,19 @@ select @@gtid_slave_pos;
@@gtid_slave_pos
cluster 1 node 1
connection node_1;
create table t1 (cluster_domain_id int ,node_server_id int, seq_no int);
insert into t1 values (1, 11, 2);
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-2
#wait for sync cluster 1 and 2
connection node_1;
include/save_master_gtid.inc
connection node_4;
include/sync_with_master_gtid.inc
cluster 2 node 1
connection node_4;
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-2
......@@ -62,9 +80,12 @@ cluster_domain_id node_server_id seq_no
1 11 2
2 21 1
#wait for sync cluster 1 and 2
connection node_1;
include/save_master_gtid.inc
connection node_4;
include/sync_with_master_gtid.inc
cluster 1 node 2
connection node_2;
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-2,2-21-1
......@@ -73,9 +94,12 @@ select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-2,1-12-3,2-21-1
#wait for sync cluster 1 and 2
connection node_1;
include/save_master_gtid.inc
connection node_4;
include/sync_with_master_gtid.inc
cluster 1 node 3
connection node_3;
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-2,1-12-3,2-21-1
......@@ -84,9 +108,12 @@ select @@gtid_binlog_state;
@@gtid_binlog_state
1-12-3,1-11-2,1-13-4,2-21-1
#wait for sync cluster 1 and 2
connection node_1;
include/save_master_gtid.inc
connection node_4;
include/sync_with_master_gtid.inc
cluster 2 node 2
connection node_5;
select @@gtid_binlog_state;
@@gtid_binlog_state
1-12-3,1-11-2,1-13-4,2-21-1
......@@ -95,9 +122,12 @@ select @@gtid_binlog_state;
@@gtid_binlog_state
1-12-3,1-11-2,1-13-4,2-21-1,2-22-2
#wait for sync cluster 2 and 1
connection node_4;
include/save_master_gtid.inc
connection node_1;
include/sync_with_master_gtid.inc
cluster 2 node 3
connection node_6;
select @@gtid_binlog_state;
@@gtid_binlog_state
1-12-3,1-11-2,1-13-4,2-21-1,2-22-2
......@@ -106,28 +136,53 @@ select @@gtid_binlog_state;
@@gtid_binlog_state
1-12-3,1-11-2,1-13-4,2-21-1,2-22-2,2-23-3
#wait for sync cluster 2 and 1
connection node_4;
include/save_master_gtid.inc
connection node_1;
include/sync_with_master_gtid.inc
cluster 1 node 1
connection node_1;
select @@gtid_binlog_state;
@@gtid_binlog_state
1-12-3,1-11-2,1-13-4,2-21-1,2-22-2,2-23-3
drop table t1;
stop slave;
reset slave;
cluster 2 node 1
connection node_4;
stop slave;
reset slave;
cluster 1 node 1
connection node_1;
change master to master_use_gtid=no, ignore_server_ids=();
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
set global GTID_SLAVE_POS="";
cluster 2 node 1
stop slave;
reset slave;
connection node_4;
change master to master_use_gtid=no, ignore_server_ids=();
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
set global GTID_SLAVE_POS="";
connection node_2;
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
connection node_3;
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
connection node_5;
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
connection node_6;
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
connection node_1;
change master to master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_6, master_use_gtid=current_pos, ignore_server_ids=(12,13);;
start slave;
include/wait_for_slave_to_start.inc
......@@ -137,6 +192,7 @@ select @@gtid_binlog_state;
select @@gtid_slave_pos;
@@gtid_slave_pos
connection node_4;
change master to master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_3, master_use_gtid=current_pos, ignore_server_ids=(22,23);;
start slave;
include/wait_for_slave_to_start.inc
......@@ -147,15 +203,19 @@ select @@gtid_slave_pos;
@@gtid_slave_pos
cluster 1 node 1
connection node_1;
create table t1 (cluster_domain_id int ,node_server_id int, seq_no int);
insert into t1 values (1, 11, 2);
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-2
#wait for sync cluster 1 and 2
connection node_1;
include/save_master_gtid.inc
connection node_4;
include/sync_with_master_gtid.inc
cluster 2 node 1
connection node_4;
insert into t1 values (2, 21, 1);
select @@gtid_binlog_state;
@@gtid_binlog_state
......@@ -165,9 +225,12 @@ cluster_domain_id node_server_id seq_no
1 11 2
2 21 1
#wait for sync cluster 1 and 2
connection node_1;
include/save_master_gtid.inc
connection node_4;
include/sync_with_master_gtid.inc
cluster 1 node 2
connection node_2;
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-2,2-21-1
......@@ -176,9 +239,12 @@ select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-2,1-12-3,2-21-1
#wait for sync cluster 1 and 2
connection node_1;
include/save_master_gtid.inc
connection node_4;
include/sync_with_master_gtid.inc
cluster 1 node 3
connection node_3;
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-2,1-12-3,2-21-1
......@@ -187,9 +253,12 @@ select @@gtid_binlog_state;
@@gtid_binlog_state
1-12-3,1-11-2,1-13-4,2-21-1
#wait for sync cluster 1 and 2
connection node_1;
include/save_master_gtid.inc
connection node_4;
include/sync_with_master_gtid.inc
cluster 2 node 2
connection node_5;
select @@gtid_binlog_state;
@@gtid_binlog_state
1-12-3,1-11-2,1-13-4,2-21-1
......@@ -198,9 +267,12 @@ select @@gtid_binlog_state;
@@gtid_binlog_state
1-12-3,1-11-2,1-13-4,2-21-1,2-22-2
#wait for sync cluster 2 and 1
connection node_4;
include/save_master_gtid.inc
connection node_1;
include/sync_with_master_gtid.inc
cluster 2 node 3
connection node_6;
select @@gtid_binlog_state;
@@gtid_binlog_state
1-12-3,1-11-2,1-13-4,2-21-1,2-22-2
......@@ -209,23 +281,43 @@ select @@gtid_binlog_state;
@@gtid_binlog_state
1-12-3,1-11-2,1-13-4,2-21-1,2-22-2,2-23-3
#wait for sync cluster 2 and 1
connection node_4;
include/save_master_gtid.inc
connection node_1;
include/sync_with_master_gtid.inc
cluster 1 node 1
connection node_1;
select @@gtid_binlog_state;
@@gtid_binlog_state
1-12-3,1-11-2,1-13-4,2-21-1,2-22-2,2-23-3
drop table t1;
stop slave;
change master to master_use_gtid=no, ignore_server_ids=();
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
set global GTID_SLAVE_POS="";
cluster 2 node 1
connection node_4;
stop slave;
change master to master_use_gtid=no, ignore_server_ids=();
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
set global GTID_SLAVE_POS="";
connection node_2;
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
connection node_3;
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
connection node_5;
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
connection node_6;
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
......@@ -29,9 +29,33 @@
--source include/wait_condition.inc
--echo Starting garbd ...
--let $gp1 = `SELECT SUBSTR(@@wsrep_provider_options, LOCATE('base_port =', @@wsrep_provider_options) + LENGTH('base_port = '))`
--let $galera_port_1 = `SELECT SUBSTR('$gp1', 1, LOCATE(';', '$gp1') - 1)`
--exec `dirname $WSREP_PROVIDER`/../../bin/garb/garbd --address "gcomm://127.0.0.1:$galera_port_1" --group my_wsrep_cluster --options 'base_port=$galera_port_3' > $MYSQL_TMP_DIR/garbd.log 2>&1 &
--perl
use strict;
use File::Basename;
my $provider_dirname = dirname($ENV{WSREP_PROVIDER});
# Array of possible garbd executable paths to be checked
# base is $provider_dirname
my @garbd_executable_search = (
# WSREP_PROVIDER is set in galera repository
${provider_dirname}."/garb/garbd",
# MariaDB (PR #1147)
${provider_dirname}."/../../bin/garb/garbd"
);
my $garbd_executable = '';
foreach my $garbd (@garbd_executable_search) {
if (-f $garbd) {
$garbd_executable= $garbd;
}
}
if ($garbd_executable eq '') {
die("Didn't locate garbd\n");
}
die unless open(FILE, ">$ENV{MYSQLTEST_VARDIR}/tmp/garbd.inc");
print FILE "--exec $garbd_executable --address \"gcomm://127.0.0.1:\$NODE_GALERAPORT_1\" --group my_wsrep_cluster --options 'base_port=\$NODE_GALERAPORT_3' > \$MYSQL_TMP_DIR/garbd.log 2>&1 &\n";
close(FILE);
EOF
--source $MYSQLTEST_VARDIR/tmp/garbd.inc
--remove_file $MYSQLTEST_VARDIR/tmp/garbd.inc
--sleep 5
......
......@@ -138,27 +138,45 @@ select @@gtid_binlog_state;
drop table t1;
stop slave;
reset slave;
--echo cluster 2 node 1
--connection node_4
stop slave;
reset slave;
--echo cluster 1 node 1
--connection node_1
change master to master_use_gtid=no, ignore_server_ids=();
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
set global GTID_SLAVE_POS="";
--sleep 2
--echo cluster 2 node 1
--connection node_4
stop slave;
reset slave;
change master to master_use_gtid=no, ignore_server_ids=();
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
set global GTID_SLAVE_POS="";
--connection node_2
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
--connection node_3
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
--connection node_5
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
--connection node_6
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
#--enable_parsing
#
# This test creates 2x 3 nodes galera cluster.
......@@ -272,21 +290,33 @@ select @@gtid_binlog_state;
drop table t1;
stop slave;
change master to master_use_gtid=no, ignore_server_ids=();
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
set global GTID_SLAVE_POS="";
--echo cluster 2 node 1
--connection node_4
stop slave;
change master to master_use_gtid=no, ignore_server_ids=();
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
set global GTID_SLAVE_POS="";
--connection node_2
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
--connection node_3
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
--connection node_5
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
--connection node_6
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
......@@ -3369,6 +3369,7 @@ static my_bool kill_callback(THD *thd, kill_callback_arg *arg)
thd->variables.server_id == arg->slave_server_id)
{
arg->thd= thd;
if (WSREP(thd)) mysql_mutex_lock(&thd->LOCK_thd_data);
mysql_mutex_lock(&thd->LOCK_thd_kill); // Lock from delete
return 1;
}
......@@ -3390,6 +3391,7 @@ void kill_zombie_dump_threads(uint32 slave_server_id)
*/
arg.thd->awake_no_mutex(KILL_SLAVE_SAME_ID);
mysql_mutex_unlock(&arg.thd->LOCK_thd_kill);
if (WSREP(arg.thd)) mysql_mutex_unlock(&arg.thd->LOCK_thd_data);
}
}
......
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