summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2020-09-17 08:25:07 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2020-09-17 08:25:07 +0300
commite3e657373a53ceebe29c043c9d60c85b844d0501 (patch)
treee1508fc59658f6512398fe4dc506ca4b4a4497bd
parent96426dac914e5989da0ba7faa86726e060461219 (diff)
downloadmariadb-git-e3e657373a53ceebe29c043c9d60c85b844d0501.tar.gz
MDEV-21769 : `galera_3nodes.galera_safe_to_bootstrap` fails
Add wait_condition to wait correct cluster configuration.
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_safe_to_bootstrap.result6
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_safe_to_bootstrap.cnf10
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_safe_to_bootstrap.test15
3 files changed, 28 insertions, 3 deletions
diff --git a/mysql-test/suite/galera_3nodes/r/galera_safe_to_bootstrap.result b/mysql-test/suite/galera_3nodes/r/galera_safe_to_bootstrap.result
index 45b4d63fb4f..8b3211b2b26 100644
--- a/mysql-test/suite/galera_3nodes/r/galera_safe_to_bootstrap.result
+++ b/mysql-test/suite/galera_3nodes/r/galera_safe_to_bootstrap.result
@@ -2,7 +2,8 @@ connection node_1;
connection node_2;
connection node_3;
connection node_1;
-CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
@@ -48,6 +49,7 @@ CALL mtr.add_suppression("Failed to prepare for incremental state transfer");
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f1` int(11) DEFAULT NULL
+ `f1` int(11) NOT NULL,
+ PRIMARY KEY (`f1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
diff --git a/mysql-test/suite/galera_3nodes/t/galera_safe_to_bootstrap.cnf b/mysql-test/suite/galera_3nodes/t/galera_safe_to_bootstrap.cnf
new file mode 100644
index 00000000000..7e35da18707
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_safe_to_bootstrap.cnf
@@ -0,0 +1,10 @@
+!include ../galera_3nodes.cnf
+
+[mariadb.1]
+wsrep_debug=1
+
+[mariadb.2]
+wsrep_debug=1
+
+[mariadb.3]
+wsrep_debug=1
diff --git a/mysql-test/suite/galera_3nodes/t/galera_safe_to_bootstrap.test b/mysql-test/suite/galera_3nodes/t/galera_safe_to_bootstrap.test
index b7b6c66e5ad..e0b2e26927c 100644
--- a/mysql-test/suite/galera_3nodes/t/galera_safe_to_bootstrap.test
+++ b/mysql-test/suite/galera_3nodes/t/galera_safe_to_bootstrap.test
@@ -2,6 +2,7 @@
# Test the safe_to_bootstrap in grastate.dat
#
--source include/galera_cluster.inc
+--source include/force_restart.inc
--let $galera_connection_name = node_3
--let $galera_server_number = 3
@@ -14,7 +15,11 @@
--source ../galera/include/auto_increment_offset_save.inc
--connection node_1
-CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
#
# At start, all grastate.dat files have safe_to_boostrap: 0
@@ -151,10 +156,18 @@ SET SESSION wsrep_on = OFF;
--source include/start_mysqld.inc
--source include/wait_until_connected_again.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+
--connection node_2
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
--source include/start_mysqld.inc
+--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_3
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.3.expect
--source include/start_mysqld.inc