Commit 3a423088 authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.3 into 10.4

parents 29847a37 fba6ffe4
......@@ -1092,6 +1092,7 @@ write_slave_info(MYSQL *connection)
char *master = NULL;
char *filename = NULL;
char *gtid_executed = NULL;
char *using_gtid = NULL;
char *position = NULL;
char *gtid_slave_pos = NULL;
char *ptr;
......@@ -1102,6 +1103,7 @@ write_slave_info(MYSQL *connection)
{"Relay_Master_Log_File", &filename},
{"Exec_Master_Log_Pos", &position},
{"Executed_Gtid_Set", &gtid_executed},
{"Using_Gtid", &using_gtid},
{NULL, NULL}
};
......@@ -1142,7 +1144,8 @@ write_slave_info(MYSQL *connection)
ut_a(asprintf(&mysql_slave_position,
"master host '%s', purge list '%s'",
master, gtid_executed) != -1);
} else if (gtid_slave_pos && *gtid_slave_pos) {
} else if (gtid_slave_pos && *gtid_slave_pos &&
!(using_gtid && !strncmp(using_gtid, "No", 2))) {
/* MariaDB >= 10.0 with GTID enabled */
result = backup_file_printf(XTRABACKUP_SLAVE_INFO,
"SET GLOBAL gtid_slave_pos = '%s';\n"
......
......@@ -85,6 +85,8 @@ extern struct wsrep_service_st {
void (*wsrep_commit_ordered_func)(MYSQL_THD thd);
my_bool (*wsrep_thd_is_applying_func)(const MYSQL_THD thd);
bool (*wsrep_thd_set_wsrep_aborter_func)(MYSQL_THD bf_thd, MYSQL_THD thd);
void (*wsrep_report_bf_lock_wait_func)(const MYSQL_THD thd,
unsigned long long trx_id);
} *wsrep_service;
#define MYSQL_SERVICE_WSREP_INCLUDED
......@@ -126,7 +128,7 @@ extern struct wsrep_service_st {
#define wsrep_commit_ordered(T) wsrep_service->wsrep_commit_ordered_func(T)
#define wsrep_thd_is_applying(T) wsrep_service->wsrep_thd_is_applying_func(T)
#define wsrep_thd_set_wsrep_aborter(T) wsrep_service->wsrep_thd_set_wsrep_aborter_func(T1, T2)
#define wsrep_report_bf_lock_wait(T,I) wsrep_service->wsrep_report_bf_lock_wait(T,I)
#else
#define MYSQL_SERVICE_WSREP_STATIC_INCLUDED
......@@ -221,6 +223,7 @@ extern "C" my_bool wsrep_get_debug();
extern "C" void wsrep_commit_ordered(MYSQL_THD thd);
extern "C" my_bool wsrep_thd_is_applying(const MYSQL_THD thd);
extern "C" bool wsrep_thd_set_wsrep_aborter(MYSQL_THD bf_thd, MYSQL_THD victim_thd);
extern "C" void wsrep_report_bf_lock_wait(const THD *thd,
unsigned long long trx_id);
#endif
#endif /* MYSQL_SERVICE_WSREP_INCLUDED */
# mdev-23741 sharing violation when renaming .frm file in ALTER
CREATE TABLE t(i int);
SET STATEMENT debug_dbug='+d,rename_sharing_violation' FOR ALTER TABLE t ADD PRIMARY KEY (i);
DROP TABLE t;
# Windows-specific tests , debug mode
--source include/have_debug.inc
--source include/windows.inc
--echo # mdev-23741 sharing violation when renaming .frm file in ALTER
CREATE TABLE t(i int);
SET STATEMENT debug_dbug='+d,rename_sharing_violation' FOR ALTER TABLE t ADD PRIMARY KEY (i);
DROP TABLE t;
#End of 10.3 tests
......@@ -4,48 +4,45 @@ connection node_1;
connection node_2;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
CREATE PROCEDURE p1 ()
BEGIN
DECLARE x INT DEFAULT 1;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
WHILE 1 DO
INSERT INTO t1 VALUES (DEFAULT);
COMMIT;
END WHILE;
END|
CALL p1();;
connection node_2;
CALL p1();;
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
connection node_2a;
Killing server ...
INSERT INTO t1 VALUES (DEFAULT);
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1a;
INSERT INTO t1 VALUES (DEFAULT);
connection node_1;
Got one of the listed errors
connection node_2;
Got one of the listed errors
connection node_1a;
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
connection node_2a;
count_equal
1
CALL mtr.add_suppression("WSREP: Action message in non-primary configuration from member 0");
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE
2
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1a;
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE
2
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
DROP PROCEDURE p1;
SELECT COUNT(*) FROM t1;
COUNT(*)
132
connection node_2a;
SELECT COUNT(*) FROM t1;
COUNT(*)
132
connection node_1;
DROP TABLE t1;
CALL mtr.add_suppression("gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)");
CALL mtr.add_suppression("WSREP: Action message in non-primary configuration from member 0");
disconnect node_1a;
disconnect node_2a;
......@@ -6,11 +6,11 @@ connection node_1;
connection node_2;
connection node_3;
connection node_4;
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 4
1
SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
EXPECT_4
4
connection node_1;
CREATE TABLE t1 (f1 INTEGER);
CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=INNODB;
INSERT INTO t1 VALUES (1);
connection node_2;
INSERT INTO t1 VALUES (2);
......@@ -22,60 +22,78 @@ connection node_3;
INSERT INTO t1 VALUES (13);
Shutting down server ...
connection node_1;
SELECT VARIABLE_VALUE AS EXPECT_3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
EXPECT_3
3
INSERT INTO t1 VALUES (11);
connection node_2;
INSERT INTO t1 VALUES (12);
connection node_4;
INSERT INTO t1 VALUES (14);
connection node_3;
SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
EXPECT_4
4
INSERT INTO t1 VALUES (131);
connection node_2;
INSERT INTO t1 VALUES (22);
Shutting down server ...
connection node_1;
SELECT VARIABLE_VALUE AS EXPECT_3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
EXPECT_3
3
INSERT INTO t1 VALUES (21);
connection node_3;
INSERT INTO t1 VALUES (23);
connection node_4;
INSERT INTO t1 VALUES (24);
connection node_2;
SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
EXPECT_4
4
INSERT INTO t1 VALUES (221);
connection node_4;
INSERT INTO t1 VALUES (34);
Shutting down server ...
connection node_1;
SELECT VARIABLE_VALUE AS EXPECT_3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
EXPECT_3
3
INSERT INTO t1 VALUES (31);
connection node_2;
INSERT INTO t1 VALUES (32);
connection node_3;
INSERT INTO t1 VALUES (33);
connection node_4;
SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
EXPECT_4
4
INSERT INTO t1 VALUES (341);
connection node_1;
SELECT COUNT(*) = 19 FROM t1;
COUNT(*) = 19
1
SELECT COUNT(*) AS EXPECT_19 FROM t1;
EXPECT_19
19
connection node_2;
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 4
1
SELECT COUNT(*) = 19 FROM t1;
COUNT(*) = 19
1
SELECT COUNT(*) AS EXPECT_19 FROM t1;
EXPECT_19
19
connection node_3;
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 4
1
SELECT COUNT(*) = 19 FROM t1;
COUNT(*) = 19
1
SELECT COUNT(*) AS EXPECT_19 FROM t1;
EXPECT_19
19
connection node_4;
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 4
1
SELECT COUNT(*) = 19 FROM t1;
COUNT(*) = 19
1
SELECT COUNT(*) AS EXPECT_19 FROM t1;
EXPECT_19
19
connection node_1;
DROP TABLE t1;
CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
......@@ -86,5 +104,6 @@ CALL mtr.add_suppression("There are no nodes in the same segment that will ever
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
connection node_4;
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
disconnect node_2;
disconnect node_1;
connection node_1;
disconnect node_3;
disconnect node_4;
......@@ -2,93 +2,62 @@
# Test that autoincrement works correctly while the cluster membership
# is changing and SST takes place.
#
--source include/big_test.inc
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_mariabackup.inc
--source include/force_restart.inc
--let $node_1=node_1
--let $node_2=node_2
--source include/auto_increment_offset_save.inc
--connection node_1
--let $connection_id = `SELECT CONNECTION_ID()`
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
# Issue an endless stream of autoincrement inserts
DELIMITER |;
CREATE PROCEDURE p1 ()
BEGIN
DECLARE x INT DEFAULT 1;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
WHILE 1 DO
INSERT INTO t1 VALUES (DEFAULT);
COMMIT;
END WHILE;
END|
DELIMITER ;|
--send CALL p1();
--sleep 1
--connection node_2
--send CALL p1();
--sleep 1
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
# Kill and restart node #2
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
--connection node_2a
--source include/kill_galera.inc
--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
--source include/start_mysqld.inc
INSERT INTO t1 VALUES (DEFAULT);
# Terminate the stored procedure
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connection node_1a
--disable_query_log
--eval KILL CONNECTION $connection_id
--enable_query_log
INSERT INTO t1 VALUES (DEFAULT);
--connection node_1
# CR_SERVER_LOST
--error 2013,2006
--reap
--connection node_2
# CR_SERVER_LOST
--error 2013,2006
--reap
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
# Confirm that the count is correct and that the cluster is intact
--connection node_2a
--source include/start_mysqld.inc
--source include/wait_until_connected_again.inc
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connection node_1a
--let $count = `SELECT COUNT(*) FROM t1`
SELECT COUNT(*) FROM t1;
--connection node_2a
--disable_query_log
--eval SELECT COUNT(*) = $count AS count_equal FROM t1
--enable_query_log
CALL mtr.add_suppression("WSREP: Action message in non-primary configuration from member 0");
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--connection node_1a
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
SELECT COUNT(*) FROM t1;
DROP PROCEDURE p1;
--connection node_1
DROP TABLE t1;
CALL mtr.add_suppression("gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)");
......@@ -97,3 +66,6 @@ CALL mtr.add_suppression("WSREP: Action message in non-primary configuration fro
--let $node_1=node_1a
--let $node_2=node_2a
--source include/auto_increment_offset_restore.inc
--disconnect node_1a
--disconnect node_2a
......@@ -10,7 +10,7 @@
--source include/big_test.inc
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/force_restart.inc
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
......@@ -22,10 +22,13 @@
--let $node_4=node_4
--source include/auto_increment_offset_save.inc
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--connection node_1
CREATE TABLE t1 (f1 INTEGER);
CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=INNODB;
INSERT INTO t1 VALUES (1);
--connection node_2
......@@ -46,9 +49,13 @@ INSERT INTO t1 VALUES (13);
--echo Shutting down server ...
--source include/shutdown_mysqld.inc
--sleep 5
--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
SELECT VARIABLE_VALUE AS EXPECT_3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
INSERT INTO t1 VALUES (11);
--connection node_2
......@@ -59,9 +66,12 @@ INSERT INTO t1 VALUES (14);
--connection node_3
--source include/start_mysqld.inc
--sleep 5
--source include/wait_until_connected_again.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
INSERT INTO t1 VALUES (131);
#
......@@ -73,9 +83,12 @@ INSERT INTO t1 VALUES (22);
--echo Shutting down server ...
--source include/shutdown_mysqld.inc
--sleep 5
--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
SELECT VARIABLE_VALUE AS EXPECT_3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
INSERT INTO t1 VALUES (21);
--connection node_3
......@@ -86,9 +99,12 @@ INSERT INTO t1 VALUES (24);
--connection node_2
--source include/start_mysqld.inc
--sleep 5
--source include/wait_until_connected_again.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
INSERT INTO t1 VALUES (221);
#
......@@ -100,9 +116,12 @@ INSERT INTO t1 VALUES (34);
--echo Shutting down server ...
--source include/shutdown_mysqld.inc
--sleep 5
--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
SELECT VARIABLE_VALUE AS EXPECT_3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
INSERT INTO t1 VALUES (31);
--connection node_2
......@@ -113,9 +132,12 @@ INSERT INTO t1 VALUES (33);
--connection node_4
--source include/start_mysqld.inc
--sleep 5
--source include/wait_until_connected_again.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
INSERT INTO t1 VALUES (341);
......@@ -124,22 +146,44 @@ INSERT INTO t1 VALUES (341);
#
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 19 FROM t1
--source include/wait_condition.inc
SELECT COUNT(*) = 19 FROM t1;
SELECT COUNT(*) AS EXPECT_19 FROM t1;
--connection node_2
--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
SELECT COUNT(*) = 19 FROM t1;
--let $wait_condition = SELECT COUNT(*) = 19 FROM t1
--source include/wait_condition.inc
SELECT COUNT(*) AS EXPECT_19 FROM t1;
--connection node_3
--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
SELECT COUNT(*) = 19 FROM t1;
--let $wait_condition = SELECT COUNT(*) = 19 FROM t1
--source include/wait_condition.inc
SELECT COUNT(*) AS EXPECT_19 FROM t1;
--connection node_4
--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
SELECT COUNT(*) = 19 FROM t1;
--let $wait_condition = SELECT COUNT(*) = 19 FROM t1
--source include/wait_condition.inc
SELECT COUNT(*) AS EXPECT_19 FROM t1;
--connection node_1
DROP TABLE t1;
......@@ -158,4 +202,6 @@ CALL mtr.add_suppression("Action message in non-primary configuration from membe
# Restore original auto_increment_offset values.
--source include/auto_increment_offset_restore.inc
--source include/galera_end.inc
--connection node_1
--disconnect node_3
--disconnect node_4
......@@ -10,11 +10,11 @@ VARIABLE_VALUE = 3
connection node_2;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
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);
connection node_2;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
SELECT COUNT(*) AS EXPECT_1 FROM t1;
EXPECT_1
1
DROP TABLE t1;
......@@ -9,12 +9,12 @@ VARIABLE_VALUE = 3
connection node_2;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
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);
connection node_2;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
SELECT COUNT(*) AS EXPECT_1 FROM t1;
EXPECT_1
1
DROP TABLE t1;
connection node_1;
......
......@@ -9,12 +9,12 @@ VARIABLE_VALUE = 3
connection node_2;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
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);
connection node_2;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
SELECT COUNT(*) AS EXPECT_1 FROM t1;
EXPECT_1
1
DROP TABLE t1;
connection node_1;
......
......@@ -14,12 +14,12 @@ SET GLOBAL wsrep_sst_method = 'mysqldump';
Shutting down server ...
connection node_1;
Cleaning var directory ...
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
Starting server ...
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
SELECT COUNT(*) AS EXPECT_1 FROM t1;
EXPECT_1
1
DROP TABLE t1;
SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_incoming_addresses';
......
......@@ -9,11 +9,11 @@ VARIABLE_VALUE = 3
connection node_2;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
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);
connection node_2;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
SELECT COUNT(*) AS EXPECT_1 FROM t1;
EXPECT_1
1
DROP TABLE t1;
......@@ -9,11 +9,11 @@ VARIABLE_VALUE = 3
connection node_2;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
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);
connection node_2;
SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
SELECT COUNT(*) AS EXPECT_1 FROM t1;
EXPECT_1
1
DROP TABLE t1;
......@@ -4,7 +4,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']
......@@ -62,6 +63,7 @@ CALL mtr.add_suppression("WSREP: gcs/src/gcs_core.cpp:core_handle_uuid_msg()");
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;
......@@ -4,7 +4,7 @@ connection node_1;
connection node_2;
connection node_3;
connection node_1;
CREATE TABLE t1 (f1 INTEGER);
CREATE TABLE t1 (f1 INTEGER) ENGINE=INNODB;
INSERT INTO t1 VALUES (1);
connection node_2;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
......
......@@ -10,6 +10,7 @@ wsrep_node_address=[::1]
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]'
wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.1.port'
bind-address=::
[mysqld.2]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
......@@ -17,6 +18,7 @@ wsrep_node_address=[::1]
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]'
wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.2.port'
bind-address=::
[mysqld.3]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
......@@ -24,3 +26,4 @@ wsrep_node_address=[::1]
wsrep_provider_options='base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]'
wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.3.port'
bind-address=::
......@@ -6,6 +6,7 @@
--source include/galera_cluster.inc
--source include/check_ipv6.inc
--source include/force_restart.inc
--let $galera_connection_name = node_3
--let $galera_server_number = 3
......@@ -27,7 +28,7 @@ SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
--connection node_2
......@@ -39,6 +40,6 @@ SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
--source include/wait_condition.inc
SELECT COUNT(*) = 1 FROM t1;
SELECT COUNT(*) AS EXPECT_1 FROM t1;
DROP TABLE t1;
......@@ -11,6 +11,7 @@ wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.
wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.1.port'
wsrep_node_name=node_1
bind-address=::
[mysqld.2]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
......@@ -19,6 +20,7 @@ wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.2.port'
wsrep_node_name=node_2
wsrep_sst_donor=node_1
bind-address=::
[mysqld.3]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
......@@ -27,6 +29,7 @@ wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.3.port'
wsrep_node_name=node_3
wsrep_sst_donor=node_1
bind-address=::
[SST]
transferfmt=@ENV.MTR_GALERA_TFMT
......
......@@ -18,7 +18,7 @@ SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
--connection node_2
......@@ -30,7 +30,7 @@ SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
--source include/wait_condition.inc
SELECT COUNT(*) = 1 FROM t1;
SELECT COUNT(*) AS EXPECT_1 FROM t1;
DROP TABLE t1;
......
......@@ -3,35 +3,37 @@
# decoy value - should not be read by mysqld or sst scripts
[mysqld]
innodb-data-home-dir=/tmp
[galera]
bind-address=::
innodb-data-home-dir=
wsrep_sst_method=mariabackup
wsrep_sst_auth="root:"
wsrep_node_address=::1
[galera.1]
[mysqld.1]
wsrep-cluster-address=gcomm://
wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.1.port'
wsrep_node_name=node_1
bind-address=::
[galera.2]
[mysqld.2]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.2.port'
wsrep_node_name=node_2
wsrep_sst_donor=node_1
bind-address=::
[galera.3]
[mysqld.3]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.3.port'
wsrep_node_name=node_3
wsrep_sst_donor=node_1
bind-address=::
[SST]
transferfmt=@ENV.MTR_GALERA_TFMT
......
......@@ -18,7 +18,7 @@ SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
--connection node_2
......@@ -30,7 +30,7 @@ SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
--source include/wait_condition.inc
SELECT COUNT(*) = 1 FROM t1;
SELECT COUNT(*) AS EXPECT_1 FROM t1;
DROP TABLE t1;
......
......@@ -9,18 +9,21 @@ wsrep-cluster-address=gcomm://
wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.1.port'
bind-address=::
[mysqld.2]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.2.port'
bind-address=::
[mysqld.3]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.3.port'
bind-address=::
[SST]
sockopt=",pf=ip6"
......@@ -54,7 +54,7 @@ SET GLOBAL wsrep_sst_method = 'mysqldump';
--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/mysql
--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
--connection node_2
......@@ -71,7 +71,7 @@ let $restart_noprint=2;
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
--source include/wait_condition.inc
SELECT COUNT(*) = 1 FROM t1;
SELECT COUNT(*) AS EXPECT_1 FROM t1;
DROP TABLE t1;
......
......@@ -9,18 +9,21 @@ wsrep-cluster-address=gcomm://
wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.1.port'
bind-address=::
[mysqld.2]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.2.port'
bind-address=::
[mysqld.3]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.3.port'
bind-address=::
[SST]
sockopt=",pf=ip6"
......@@ -16,7 +16,7 @@ SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
--connection node_2
......@@ -28,6 +28,6 @@ SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
--source include/wait_condition.inc
SELECT COUNT(*) = 1 FROM t1;
SELECT COUNT(*) AS EXPECT_1 FROM t1;
DROP TABLE t1;
......@@ -4,28 +4,31 @@
[mysqld]
innodb-data-home-dir=/tmp
[mariadb]
[mysqld]
innodb-data-home-dir=
wsrep_sst_method=rsync
wsrep_node_address=::1
[mariadb.1]
[mysqld.1]
wsrep-cluster-address=gcomm://
wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.1.port'
bind-address=::
[mariadb.2]
[mysqld.2]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.2.port'
bind-address=::
[mariadb.3]
[mysqld.3]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
wsrep_node_incoming_address='[::1]:@mysqld.3.port'
bind-address=::
[SST]
sockopt=",pf=ip6"
......@@ -16,7 +16,7 @@ SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
--connection node_2
......@@ -28,6 +28,6 @@ SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
--source include/wait_condition.inc
SELECT COUNT(*) = 1 FROM t1;
SELECT COUNT(*) AS EXPECT_1 FROM t1;
DROP TABLE t1;
!include ../galera_3nodes.cnf
[mysqld.1]
wsrep_debug=1
[mysqld.2]
wsrep_debug=1
[mysqld.3]
wsrep_debug=1
......@@ -2,6 +2,7 @@
# Test the safe_to_bootstrap in grastate.dat
#
--source include/galera_cluster.inc
--source include/force_restart.inc
#
# Create connection node_3 and save auto increment variables.
......@@ -17,8 +18,11 @@
--source ../galera/include/auto_increment_offset_save.inc
--connection node_1
CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
--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
......@@ -157,11 +161,19 @@ let $restart_noprint=2;
--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
let $restart_noprint=2;
--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
let $restart_noprint=2;
......
......@@ -16,10 +16,13 @@
--source ../galera/include/auto_increment_offset_save.inc
--connection node_1
CREATE TABLE t1 (f1 INTEGER);
CREATE TABLE t1 (f1 INTEGER) ENGINE=INNODB;
INSERT INTO t1 VALUES (1);
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
--source include/wait_condition.inc
SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
--connection node_1
......@@ -28,15 +31,11 @@ SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
--connection node_2
SET SESSION wsrep_sync_wait = 0;
--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
--source include/wait_condition.inc
SET SESSION wsrep_dirty_reads = 1;
--let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
--source include/wait_condition.inc
# Those statements should succeed
--error 0
......
......@@ -740,3 +740,32 @@ t1 CREATE TABLE `t1` (
KEY `v4` (`v4`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
#
# MDEV-20396 Server crashes after DELETE with SEL NULL Foreign key and a
# virtual column in index
#
CREATE TABLE parent
(
ID int unsigned NOT NULL,
PRIMARY KEY (ID)
);
CREATE TABLE child
(
ID int unsigned NOT NULL,
ParentID int unsigned NULL,
Value int unsigned NOT NULL DEFAULT 0,
Flag int unsigned AS (Value) VIRTUAL,
PRIMARY KEY (ID),
KEY (ParentID, Flag),
FOREIGN KEY (ParentID) REFERENCES parent (ID) ON DELETE SET NULL
ON UPDATE CASCADE
);
INSERT INTO parent (ID) VALUES (100);
INSERT INTO child (ID,ParentID,Value) VALUES (123123,100,1);
DELETE FROM parent WHERE ID=100;
select * from child;
ID ParentID Value Flag
123123 NULL 1 1
INSERT INTO parent (ID) VALUES (100);
UPDATE child SET ParentID=100 WHERE ID=123123;
DROP TABLE child, parent;
......@@ -605,3 +605,35 @@ ALTER TABLE t1 ADD CONSTRAINT fk FOREIGN KEY (v4) REFERENCES nosuch(col);
SHOW CREATE TABLE t1;
# Cleanup
DROP TABLE t1;
--echo #
--echo # MDEV-20396 Server crashes after DELETE with SEL NULL Foreign key and a
--echo # virtual column in index
--echo #
CREATE TABLE parent
(
ID int unsigned NOT NULL,
PRIMARY KEY (ID)
);
CREATE TABLE child
(
ID int unsigned NOT NULL,
ParentID int unsigned NULL,
Value int unsigned NOT NULL DEFAULT 0,
Flag int unsigned AS (Value) VIRTUAL,
PRIMARY KEY (ID),
KEY (ParentID, Flag),
FOREIGN KEY (ParentID) REFERENCES parent (ID) ON DELETE SET NULL
ON UPDATE CASCADE
);
INSERT INTO parent (ID) VALUES (100);
INSERT INTO child (ID,ParentID,Value) VALUES (123123,100,1);
DELETE FROM parent WHERE ID=100;
select * from child;
INSERT INTO parent (ID) VALUES (100);
UPDATE child SET ParentID=100 WHERE ID=123123;
# Cleanup
DROP TABLE child, parent;
......@@ -6,8 +6,7 @@ SET GLOBAL innodb_file_per_table=1;
#
SET GLOBAL innodb_file_per_table=ON;
create table t1 (a int not null, d varchar(15) not null, b
varchar(198) not null, c char(156),
fulltext ftsic(c)) engine=InnoDB
varchar(198) not null, c char(156)) engine=InnoDB
row_format=redundant;
insert into t1 values(123, 'abcdef', 'jghikl', 'mnop');
insert into t1 values(456, 'abcdef', 'jghikl', 'mnop');
......@@ -76,7 +75,7 @@ DROP TABLE t1;
Warnings:
Warning 1932 Table 'test.t1' doesn't exist in engine
DROP TABLE t2,t3;
FOUND 50 /\[ERROR\] InnoDB: Table `test`\.`t1` in InnoDB data dictionary contains invalid flags\. SYS_TABLES\.TYPE=1 SYS_TABLES\.MIX_LEN=511\b/ in mysqld.1.err
FOUND 6 /\[ERROR\] InnoDB: Table `test`\.`t1` in InnoDB data dictionary contains invalid flags\. SYS_TABLES\.TYPE=1 SYS_TABLES\.MIX_LEN=511\b/ in mysqld.1.err
# restart
ib_buffer_pool
ib_logfile0
......
......@@ -32,8 +32,7 @@ SET GLOBAL innodb_file_per_table=1;
SET GLOBAL innodb_file_per_table=ON;
create table t1 (a int not null, d varchar(15) not null, b
varchar(198) not null, c char(156),
fulltext ftsic(c)) engine=InnoDB
varchar(198) not null, c char(156)) engine=InnoDB
row_format=redundant;
insert into t1 values(123, 'abcdef', 'jghikl', 'mnop');
......
include/master-slave.inc
[connection master]
connection slave;
###############
# If Using_Gtid != 'No', backup gtid_slave_pos
########################
include/stop_slave.inc
change master to master_use_gtid=slave_pos;
include/start_slave.inc
connection master;
CREATE TABLE t(i INT);
connection slave;
"using_gtid: Slave_Pos"
FOUND 1 /gtid_slave_pos/ in xtrabackup_slave_info
NOT FOUND /MASTER_LOG_FILE/ in xtrabackup_slave_info
###############
# If Using_Gtid != 'No' and !gtid_slave_pos, backup master position
########################
include/stop_slave.inc
SET GLOBAL gtid_slave_pos="";
NOT FOUND /gtid_slave_pos/ in xtrabackup_slave_info
FOUND 1 /MASTER_LOG_FILE/ in xtrabackup_slave_info
###############
# If Using_Gtid == 'No', backup Exec_Master_Log_Pos
########################
change master to master_use_gtid=no;
include/start_slave.inc
connection master;
INSERT INTO t VALUES(1);
connection slave;
"using_gtid: No"
NOT FOUND /gtid_slave_pos/ in xtrabackup_slave_info
FOUND 1 /MASTER_LOG_FILE/ in xtrabackup_slave_info
connection master;
DROP TABLE t;
connection slave;
include/rpl_end.inc
--source include/master-slave.inc
--connection slave
--echo ###############
--echo # If Using_Gtid != 'No', backup gtid_slave_pos
--echo ########################
--source include/stop_slave.inc
change master to master_use_gtid=slave_pos;
--source include/start_slave.inc
--connection master
CREATE TABLE t(i INT);
--sync_slave_with_master
--let $using_gtid=query_get_value(SHOW SLAVE STATUS,Using_Gtid,1)
--echo "using_gtid: $using_gtid"
--let $targetdir=$MYSQLTEST_VARDIR/tmp/backup
--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group-suffix=.2 --slave-info --backup --target-dir=$targetdir;
--enable_result_log
--let SEARCH_FILE=$targetdir/xtrabackup_slave_info
--let SEARCH_PATTERN=gtid_slave_pos
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN=MASTER_LOG_FILE
--source include/search_pattern_in_file.inc
rmdir $targetdir;
--echo ###############
--echo # If Using_Gtid != 'No' and !gtid_slave_pos, backup master position
--echo ########################
--source include/stop_slave.inc
SET GLOBAL gtid_slave_pos="";
--let $targetdir=$MYSQLTEST_VARDIR/tmp/backup
--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group-suffix=.2 --slave-info --backup --target-dir=$targetdir;
--enable_result_log
--let SEARCH_FILE=$targetdir/xtrabackup_slave_info
--let SEARCH_PATTERN=gtid_slave_pos
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN=MASTER_LOG_FILE
--source include/search_pattern_in_file.inc
rmdir $targetdir;
--echo ###############
--echo # If Using_Gtid == 'No', backup Exec_Master_Log_Pos
--echo ########################
change master to master_use_gtid=no;
--source include/start_slave.inc
--connection master
INSERT INTO t VALUES(1);
--sync_slave_with_master
--let $using_gtid=query_get_value(SHOW SLAVE STATUS,Using_Gtid,1)
--echo "using_gtid: $using_gtid"
--let $targetdir=$MYSQLTEST_VARDIR/tmp/backup
--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group-suffix=.2 --slave-info --backup --target-dir=$targetdir;
--enable_result_log
--let SEARCH_FILE=$targetdir/xtrabackup_slave_info
--let SEARCH_PATTERN=gtid_slave_pos
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN=MASTER_LOG_FILE
--source include/search_pattern_in_file.inc
rmdir $targetdir;
# Cleanup
--connection master
DROP TABLE t;
--sync_slave_with_master
--source include/rpl_end.inc
......@@ -19,8 +19,62 @@
#include "m_string.h"
#undef my_rename
/* On unix rename deletes to file if it exists */
#ifdef _WIN32
#define RENAME_MAX_RETRIES 50
/*
On Windows, bad 3rd party programs (backup or anitivirus, or something else)
can have file open with a sharing mode incompatible with renaming, i.e they
won't use FILE_SHARE_DELETE when opening file.
The following function will do a couple of retries, in case MoveFileEx returns
ERROR_SHARING_VIOLATION.
*/
static BOOL win_rename_with_retries(const char *from, const char *to)
{
#ifndef DBUG_OFF
FILE *fp = NULL;
DBUG_EXECUTE_IF("rename_sharing_violation",
{
fp= fopen(from, "r");
DBUG_ASSERT(fp);
}
);
#endif
for (int retry= RENAME_MAX_RETRIES; retry--;)
{
DWORD ret = MoveFileEx(from, to,
MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING);
DBUG_ASSERT(fp == NULL || (ret == FALSE && GetLastError() == ERROR_SHARING_VIOLATION));
if (!ret && (GetLastError() == ERROR_SHARING_VIOLATION))
{
#ifndef DBUG_OFF
/*
If error was injected in via DBUG_EXECUTE_IF, close the file
that is causing ERROR_SHARING_VIOLATION, so that retry succeeds.
*/
if (fp)
{
fclose(fp);
fp= NULL;
}
#endif
Sleep(10);
}
else
return ret;
}
return FALSE;
}
#endif
/* On unix rename deletes to file if it exists */
int my_rename(const char *from, const char *to, myf MyFlags)
{
int error = 0;
......@@ -28,8 +82,7 @@ int my_rename(const char *from, const char *to, myf MyFlags)
DBUG_PRINT("my",("from %s to %s MyFlags %lu", from, to, MyFlags));
#if defined(__WIN__)
if (!MoveFileEx(from, to, MOVEFILE_COPY_ALLOWED |
MOVEFILE_REPLACE_EXISTING))
if (!win_rename_with_retries(from, to))
{
my_osmaperr(GetLastError());
#elif defined(HAVE_RENAME)
......
......@@ -337,3 +337,26 @@ extern "C" bool wsrep_thd_set_wsrep_aborter(THD *bf_thd, THD *victim_thd)
victim_thd->wsrep_aborter = bf_thd->thread_id;
return false;
}
extern "C" void wsrep_report_bf_lock_wait(const THD *thd,
unsigned long long trx_id)
{
if (thd)
{
WSREP_ERROR("Thread %s trx_id: %llu thread: %ld "
"seqno: %lld client_state: %s client_mode: %s transaction_mode: %s "
"applier: %d toi: %d local: %d "
"query: %s",
wsrep_thd_is_BF(thd, false) ? "BF" : "normal",
trx_id,
thd_get_thread_id(thd),
wsrep_thd_trx_seqno(thd),
wsrep_thd_client_state_str(thd),
wsrep_thd_client_mode_str(thd),
wsrep_thd_transaction_state_str(thd),
wsrep_thd_is_applying(thd),
wsrep_thd_is_toi(thd),
wsrep_thd_is_local(thd),
wsrep_thd_query(thd));
}
}
......@@ -174,7 +174,8 @@ static struct wsrep_service_st wsrep_handler = {
wsrep_get_debug,
wsrep_commit_ordered,
wsrep_thd_is_applying,
wsrep_thd_set_wsrep_aborter
wsrep_thd_set_wsrep_aborter,
wsrep_report_bf_lock_wait
};
static struct thd_specifics_service_st thd_specifics_handler=
......
......@@ -145,3 +145,7 @@ my_bool wsrep_thd_is_applying(const THD*)
bool wsrep_thd_set_wsrep_aborter(THD*, THD*)
{ return 0;}
void wsrep_report_bf_lock_wait(const THD*,
unsigned long long)
{}
......@@ -148,9 +148,7 @@ fts_config_create_index_param_name(
::strcpy(name, param);
name[len] = '_';
fts_write_object_id(index->id, name + len + 1,
DICT_TF2_FLAG_IS_SET(index->table,
DICT_TF2_FTS_AUX_HEX_NAME));
fts_write_object_id(index->id, name + len + 1);
return(name);
}
......
This diff is collapsed.
......@@ -55,28 +55,23 @@ fts_get_table_id(
long */
{
int len;
bool hex_name = DICT_TF2_FLAG_IS_SET(fts_table->table,
DICT_TF2_FTS_AUX_HEX_NAME);
ut_a(fts_table->table != NULL);
switch (fts_table->type) {
case FTS_COMMON_TABLE:
len = fts_write_object_id(fts_table->table_id, table_id,
hex_name);
len = fts_write_object_id(fts_table->table_id, table_id);
break;
case FTS_INDEX_TABLE:
len = fts_write_object_id(fts_table->table_id, table_id,
hex_name);
len = fts_write_object_id(fts_table->table_id, table_id);
table_id[len] = '_';
++len;
table_id += len;
len += fts_write_object_id(fts_table->index_id, table_id,
hex_name);
len += fts_write_object_id(fts_table->index_id, table_id);
break;
default:
......
......@@ -734,12 +734,9 @@ fts_savepoint_rollback_last_stmt(
/*=============================*/
trx_t* trx); /*!< in: transaction */
/***********************************************************************//**
Drop all orphaned FTS auxiliary tables, those that don't have a parent
/** Drop all orphaned FTS auxiliary tables, those that don't have a parent
table or FTS index defined on them. */
void
fts_drop_orphaned_tables(void);
/*==========================*/
void fts_drop_orphaned_tables();
/** Run SYNC on the table, i.e., write out data from the cache to the
FTS auxiliary INDEX table and clear the cache at the end.
......@@ -773,15 +770,6 @@ fts_init_doc_id(
/*============*/
const dict_table_t* table); /*!< in: table */
/* Get parent table name if it's a fts aux table
@param[in] aux_table_name aux table name
@param[in] aux_table_len aux table length
@return parent table name, or NULL */
char*
fts_get_parent_table_name(
const char* aux_table_name,
ulint aux_table_len);
/******************************************************************//**
compare two character string according to their charset. */
extern
......@@ -988,4 +976,14 @@ and there are no new fts index to add.
@param[in] trx transaction to drop all fts tables */
void fts_clear_all(dict_table_t *table, trx_t *trx);
/** Check whether the given name is fts auxiliary table
and fetch the parent table id and index id
@param[in] name table name
@param[in,out] table_id parent table id
@param[in,out] index_id index id
@return true if it is auxilary table */
bool fts_check_aux_table(const char *name,
table_id_t *table_id,
index_id_t *index_id);
#endif /*!< fts0fts.h */
......@@ -461,11 +461,7 @@ int
fts_write_object_id(
/*================*/
ib_id_t id, /*!< in: a table/index id */
char* str, /*!< in: buffer to write the id to */
bool hex_format MY_ATTRIBUTE((unused)))
/*!< in: true for fixed hex format,
false for old ambiguous format */
MY_ATTRIBUTE((nonnull));
char* str); /*!< in: buffer to write the id to */
/******************************************************************//**
Read the table id from the string generated by fts_write_object_id().
@return TRUE if parse successful */
......
......@@ -32,10 +32,7 @@ int
fts_write_object_id(
/*================*/
ib_id_t id, /* in: a table/index id */
char* str, /* in: buffer to write the id to */
bool hex_format MY_ATTRIBUTE((unused)))
/* in: true for fixed hex format,
false for old ambiguous format */
char* str) /* in: buffer to write the id to */
{
#ifdef _WIN32
......@@ -60,11 +57,6 @@ fts_write_object_id(
#endif /* _WIN32 */
/* As above, but this is only for those tables failing to rename. */
if (!hex_format) {
return(sprintf(str, "%016llu", (ulonglong) id));
}
return(sprintf(str, "%016llx", (ulonglong) id));
}
......
This diff is collapsed.
......@@ -908,8 +908,6 @@ row_ins_foreign_fill_virtual(
&ext, cascade->heap);
n_diff = update->n_fields;
update->n_fields += n_v_fld;
if (index->table->vc_templ == NULL) {
/** This can occur when there is a cascading
delete or update after restart. */
......@@ -942,7 +940,7 @@ row_ins_foreign_fill_virtual(
return DB_COMPUTE_VALUE_FAILED;
}
upd_field = upd_get_nth_field(update, n_diff);
upd_field = update->fields + n_diff;
upd_field->old_v_val = static_cast<dfield_t*>(
mem_heap_alloc(cascade->heap,
......@@ -952,30 +950,27 @@ row_ins_foreign_fill_virtual(
upd_field_set_v_field_no(upd_field, i, index);
if (node->is_delete
? (foreign->type & DICT_FOREIGN_ON_DELETE_SET_NULL)
: (foreign->type & DICT_FOREIGN_ON_UPDATE_SET_NULL)) {
dfield_set_null(&upd_field->new_val);
}
if (!node->is_delete
&& (foreign->type & DICT_FOREIGN_ON_UPDATE_CASCADE)) {
dfield_t* new_vfield = innobase_get_computed_value(
update->old_vrow, col, index,
&vc.heap, update->heap, NULL, thd,
mysql_table, record, NULL,
node->update, foreign);
bool set_null =
node->is_delete
? (foreign->type & DICT_FOREIGN_ON_DELETE_SET_NULL)
: (foreign->type & DICT_FOREIGN_ON_UPDATE_SET_NULL);
if (new_vfield == NULL) {
return DB_COMPUTE_VALUE_FAILED;
}
dfield_t* new_vfield = innobase_get_computed_value(
update->old_vrow, col, index,
&vc.heap, update->heap, NULL, thd,
mysql_table, record, NULL,
set_null ? update : node->update, foreign);
dfield_copy(&(upd_field->new_val), new_vfield);
if (new_vfield == NULL) {
return DB_COMPUTE_VALUE_FAILED;
}
n_diff++;
dfield_copy(&upd_field->new_val, new_vfield);
if (!dfield_datas_are_binary_equal(
upd_field->old_v_val,
&upd_field->new_val, 0))
n_diff++;
}
update->n_fields = n_diff;
......
......@@ -3931,9 +3931,21 @@ row_drop_database_for_mysql(
avoid accessing dropped fts aux tables in information
scheam when parent table still exists.
Note: Drop parent table will drop fts aux tables. */
char* parent_table_name;
parent_table_name = fts_get_parent_table_name(
table_name, strlen(table_name));
char* parent_table_name = NULL;
table_id_t table_id;
index_id_t index_id;
if (fts_check_aux_table(
table_name, &table_id, &index_id)) {
dict_table_t* parent_table = dict_table_open_on_id(
table_id, TRUE, DICT_TABLE_OP_NORMAL);
if (parent_table != NULL) {
parent_table_name = mem_strdupl(
parent_table->name.m_name,
strlen(parent_table->name.m_name));
dict_table_close(parent_table, TRUE, FALSE);
}
}
if (parent_table_name != NULL) {
ut_free(table_name);
......
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