summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2022-12-08 12:57:35 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2022-12-08 12:57:35 +0200
commit7d912fbbea838cc80adbdb14ec1ba2340b415763 (patch)
treecd079b140f2dfd850711d90c2448deb3d0accadf
parente748f5cc83d249d9e7b41347ca8bf0598e8ffc49 (diff)
downloadmariadb-git-jan-MDEV-29171-galera.tar.gz
-rw-r--r--mysql-test/include/galera_sst_method.combinations5
-rw-r--r--mysql-test/include/galera_sst_method.inc2
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_sst_domain_id.cnf22
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_sst_domain_id.test98
4 files changed, 127 insertions, 0 deletions
diff --git a/mysql-test/include/galera_sst_method.combinations b/mysql-test/include/galera_sst_method.combinations
new file mode 100644
index 00000000000..07baf7f481c
--- /dev/null
+++ b/mysql-test/include/galera_sst_method.combinations
@@ -0,0 +1,5 @@
+[rsync]
+wsrep_sst_method=rsync
+
+[mariabackup]
+wsrep_sst_method=mariabackup
diff --git a/mysql-test/include/galera_sst_method.inc b/mysql-test/include/galera_sst_method.inc
new file mode 100644
index 00000000000..8f11d84334e
--- /dev/null
+++ b/mysql-test/include/galera_sst_method.inc
@@ -0,0 +1,2 @@
+# The goal of including this file is to enable galera_sst_method combinations
+--source include/galera_cluster.inc
diff --git a/mysql-test/suite/galera_3nodes/t/galera_sst_domain_id.cnf b/mysql-test/suite/galera_3nodes/t/galera_sst_domain_id.cnf
new file mode 100644
index 00000000000..cf437f51e88
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_sst_domain_id.cnf
@@ -0,0 +1,22 @@
+!include ../galera_3nodes.cnf
+
+[mysqld.1]
+wsrep_gtid_mode=ON
+wsrep_gtid_domain_id=100
+server-id=11
+wsrep_node_name=node_1
+wsrep-debug=1
+
+[mysqld.2]
+wsrep_gtid_mode=ON
+wsrep_gtid_domain_id=100
+server-id=12
+wsrep_node_name=node_2
+wsrep-debug=1
+
+[mysqld.3]
+wsrep_gtid_mode=ON
+wsrep_gtid_domain_id=100
+server-id=13
+wsrep_node_name=node_3
+wsrep-debug=1
diff --git a/mysql-test/suite/galera_3nodes/t/galera_sst_domain_id.test b/mysql-test/suite/galera_3nodes/t/galera_sst_domain_id.test
new file mode 100644
index 00000000000..02baf72ff33
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_sst_domain_id.test
@@ -0,0 +1,98 @@
+--source include/galera_sst_method.inc
+
+--let $galera_connection_name = node_3
+--let $galera_server_number = 3
+--source include/galera_connect.inc
+
+--let $node_1=node_1
+--let $node_2=node_2
+--let $node_3=node_3
+--source ../galera/include/auto_increment_offset_save.inc
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+CREATE TABLE t1(a int not null primary key, b int) engine=innodb;
+INSERT INTO t1 values (0,0),(1,1),(2,2);
+
+select @@wsrep_gtid_domain_id;
+
+--connection node_2
+select * from t1;
+select @@wsrep_gtid_domain_id;
+
+--connection node_3
+select * from t1;
+select @@wsrep_gtid_domain_id;
+
+--echo # Now we are ready to kick nodes out of cluster
+--echo # shutdown node_3
+--connection node_3
+-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.3.expect
+--source include/shutdown_mysqld.inc
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--echo # shutdown node_2
+--connection node_2
+-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+--source include/shutdown_mysqld.inc
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--echo # shutdown node_1
+--connection node_1
+-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--source include/shutdown_mysqld.inc
+
+--echo # For nodes 2 and 3 we force SST
+--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
+--remove_file $MYSQLTEST_VARDIR/mysqld.3/data/grastate.dat
+
+--echo # Restart node_1
+--let $restart_parameters = "--wsrep-new-cluster --wsrep_gtid_mode=ON --wsrep_node_name=node_1 --wsrep_gtid_domain_id=200"
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--source include/start_mysqld.inc
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+select * from t1;
+select @@wsrep_gtid_domain_id;
+
+--echo # Restart node_2
+--let $restart_parameters = "--wsrep_gtid_mode=ON --wsrep_node_name=node_2 --wsrep_gtid_domain_id=200"
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+--source include/start_mysqld.inc
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--connection node_2
+select * from t1;
+select @@wsrep_gtid_domain_id;
+
+--echo # Restart node_3
+--let $restart_parameters = "--wsrep_gtid_mode=ON --wsrep_node_name=node_3 --wsrep_gtid_domain_id=200 --wsrep_sst_donor=node_2"
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.3.expect
+--source include/start_mysqld.inc
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--connection node_3
+select * from t1;
+select @@wsrep_gtid_domain_id;
+select @@wsrep_sst_donor;
+
+--connection node_1
+DROP TABLE t1;
+
+--source ../../galera/include/auto_increment_offset_restore.inc \ No newline at end of file