1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge 10.11 into 11.0

This commit is contained in:
Marko Mäkelä
2024-01-03 15:55:17 +02:00
74 changed files with 1301 additions and 202 deletions

View File

@@ -12,8 +12,6 @@
galera_as_slave_ctas : MDEV-28378 timeout
galera_pc_recovery : MDEV-25199 cluster fails to start up
galera_sst_encrypted : MDEV-29876 Galera test failure on galera_sst_encrypted
galera_var_node_address : MDEV-20485 Galera test failure
galera_bf_kill_debug : timeout after 900 seconds
galera_ssl_upgrade : [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 130: Incorrect file format 'gtid_slave_pos'
galera_parallel_simple : timeout related to wsrep_sync_wait

View File

@@ -0,0 +1,24 @@
connection node_2;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) engine=innodb;
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) engine=aria;
START TRANSACTION;
INSERT INTO t1 VALUES (1);
SELECT * FROM t2;
f1
SAVEPOINT s1;
ERROR 42000: The storage engine for the table doesn't support SAVEPOINT
INSERT INTO t1 VALUES (2);
COMMIT;
connection node_1;
SELECT * FROM t1;
f1
1
2
connection node_2;
SELECT * FROM t1;
f1
1
2
connection node_1;
DROP TABLE t1,t2;

View File

@@ -47,4 +47,4 @@ SET GLOBAL debug_dbug = NULL;
SET debug_sync='RESET';
SELECT @@debug_sync;
@@debug_sync
ON - current signal: ''
ON - current signals: ''

View File

@@ -4,7 +4,7 @@ SET @orig_debug=@@debug_dbug;
connection node_2;
SELECT @@debug_sync;
@@debug_sync
ON - current signal: ''
ON - current signals: ''
set debug_sync='RESET';
SET SESSION wsrep_sync_wait = 1;
SET GLOBAL debug_dbug = "+d,sync.wsrep_apply_cb";
@@ -45,4 +45,4 @@ SET SESSION wsrep_sync_wait = default;
DROP TABLE t_wait1;
SELECT @@debug_sync;
@@debug_sync
ON - current signal: ''
ON - current signals: ''

View File

@@ -4,7 +4,7 @@ SET @orig_debug=@@debug_dbug;
connection node_2;
SELECT @@debug_sync;
@@debug_sync
ON - current signal: ''
ON - current signals: ''
SET SESSION wsrep_sync_wait = 8;
SET GLOBAL debug_dbug = "+d,sync.wsrep_apply_cb";
connection node_1;
@@ -46,4 +46,4 @@ SET SESSION wsrep_sync_wait = default;
DROP TABLE t_wait8;
SELECT @@debug_sync;
@@debug_sync
ON - current signal: ''
ON - current signals: ''

View File

@@ -1,5 +1,6 @@
connection node_2;
connection node_1;
SET GLOBAL wsrep_mode=REPLICATE_MYISAM;
CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2), (3);
@@ -22,6 +23,8 @@ COUNT(*) = 0
1
SELECT COUNT(*) = 0 FROM t2;
COUNT(*) = 0
1
0
connection node_1;
DROP TABLE t1;
DROP TABLE t2;
SET GLOBAL wsrep_mode=DEFAULT;

View File

@@ -36,10 +36,7 @@ SET DEBUG_SYNC = 'now SIGNAL wsrep_retry_autocommit_continue';
connection node_1;
SELECT COUNT(*) FROM t1;
COUNT(*)
connection node_1;
SELECT COUNT(*) FROM t1;
COUNT(*)
0
1
SET DEBUG_SYNC = 'RESET';
SET GLOBAL debug_dbug = NULL;
DROP TABLE t1;

View File

@@ -71,13 +71,17 @@ push @::global_suppressions,
sub which($) { return `sh -c "command -v $_[0]"` }
sub skip_combinations {
my %skip = ();
my @combinations;
$skip{'include/have_mariabackup.inc'} = 'Need socket statistics utility'
unless which("lsof") || which("sockstat") || which("ss");
$skip{'include/have_stunnel.inc'} = "Need 'stunnel' utility"
unless which("stunnel");
$skip{'include/have_qpress.inc'} = "Need 'qpress' utility"
unless which("qpress");
$skip{'../encryption/include/have_file_key_management_plugin.combinations'} = [ 'ctr' ]
unless $::mysqld_variables{'version-ssl-library'} =~ /OpenSSL (\S+)/
and $1 ge "1.0.1";
%skip;
}

View File

@@ -1,6 +1,8 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
--disable_ps2_protocol
# NEXTVAL
--connection node_1
@@ -54,3 +56,4 @@ SELECT NEXTVAL(seq_transaction) = 4;
DROP SEQUENCE seq_transaction;
DROP TABLE t1;
--enable_ps2_protocol

View File

@@ -0,0 +1,28 @@
#
# MDEV-32549: Cluster is inconsitent after savepoint
# statement is rolled back
#
--source include/galera_cluster.inc
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) engine=innodb;
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) engine=aria;
START TRANSACTION;
INSERT INTO t1 VALUES (1);
SELECT * FROM t2;
--error ER_CHECK_NOT_IMPLEMENTED
SAVEPOINT s1;
INSERT INTO t1 VALUES (2);
COMMIT;
--connection node_1
SELECT * FROM t1;
# If bug is present: only the second INSERT
# is replicated, causing an inconsistent
# cluster.
--connection node_2
SELECT * FROM t1;
--connection node_1
DROP TABLE t1,t2;

View File

@@ -12,13 +12,17 @@ INSERT INTO t1 VALUES (1);
SELECT COUNT(*) > 0 FROM mysql.general_log;
--disable_ps2_protocol
SELECT 1 = 1 FROM t1;
SELECT COUNT(*) = 1 FROM mysql.slow_log WHERE sql_text = 'SELECT 1 = 1 FROM t1';
--enable_ps2_protocol
--connection node_2
--disable_ps2_protocol
SELECT 2 = 2 FROM t1;
SELECT COUNT(*) = 1 FROM mysql.slow_log WHERE sql_text = 'SELECT 2 = 2 FROM t1';
--enable_ps2_protocol
--connection node_1
DROP TABLE t1;

View File

@@ -7,6 +7,8 @@
# Without a PK
SET GLOBAL wsrep_mode=REPLICATE_MYISAM;
CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1);
@@ -41,5 +43,7 @@ TRUNCATE TABLE t1;
SELECT COUNT(*) = 0 FROM t1;
SELECT COUNT(*) = 0 FROM t2;
--connection node_1
DROP TABLE t1;
DROP TABLE t2;
SET GLOBAL wsrep_mode=DEFAULT;

View File

@@ -2,6 +2,8 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
--disable_ps2_protocol
#
# Ensure that the query cache behaves properly with respect to Galera
#
@@ -65,3 +67,4 @@ SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_
DROP TABLE t1;
--enable_ps2_protocol

View File

@@ -4,6 +4,8 @@
--source include/have_query_cache.inc
--source include/galera_have_debug_sync.inc
--disable_ps2_protocol
CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
@@ -88,3 +90,5 @@ DROP TABLE t1;
--connection node_2a
SET DEBUG_SYNC = "RESET";
--enable_ps2_protocol

View File

@@ -14,6 +14,7 @@ select @@wsrep_gtid_domain_id,@@wsrep_node_name;
@@wsrep_gtid_domain_id @@wsrep_node_name
100 node3
connection node_3;
connection node_1;
connection node_2;
connection node_1;
connection node_1;

View File

@@ -0,0 +1,219 @@
connection node_2;
connection node_1;
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
connect node_2b, 127.0.0.1, root, , test, $NODE_MYPORT_2;
set wsrep_sync_wait=0;
connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1;
set wsrep_sync_wait=0;
connection node_1;
CREATE PROCEDURE insert_row (IN node varchar(10), IN repeat_count int)
BEGIN
DECLARE current_num int;
SET current_num = 0;
WHILE current_num < repeat_count do
INSERT INTO t1(node, name) VALUES (node, UUID());
SET current_num = current_num + 1;
END WHILE;
END|
CREATE TABLE t1 (id bigint not null primary key auto_increment, node VARCHAR(10), name VARCHAR(64)) ENGINE=innodb;
# node_1
show variables like '%gtid_binlog_pos%';
Variable_name Value
gtid_binlog_pos 1111-1-2
connection node_2;
# node_2
show variables like '%gtid_binlog_pos%';
Variable_name Value
gtid_binlog_pos 1111-1-2
connection node_3;
# node_3
show variables like '%gtid_binlog_pos%';
Variable_name Value
gtid_binlog_pos 1111-1-2
connection node_1;
CALL insert_row('node1', 500);;
connection node_2;
CALL insert_row('node2', 500);;
connection node_3;
CALL insert_row('node3', 500);;
connection node_2;
# Shutdown node_2, force SST
connection node_2b;
# Wait until node_2 leaves cluster
connection node_1b;
connection node_1;
connection node_3;
connection node_1;
CALL insert_row('node1', 500);
connection node_3;
CALL insert_row('node3', 500);
CREATE TABLE t2(i int primary key) engine=innodb;
connection node_2;
# Restart node_2
# restart
connection node_1b;
# Wait until node_2 is back in cluster
# node2 has joined
# GTID in node1
show variables like 'wsrep_gtid_domain_id';
Variable_name Value
wsrep_gtid_domain_id 1111
show variables like '%gtid_binlog_pos%';
Variable_name Value
gtid_binlog_pos 1111-1-2503
connection node_2;
# GTID in node2
show variables like 'wsrep_gtid_domain_id';
Variable_name Value
wsrep_gtid_domain_id 1111
show variables like '%gtid_binlog_pos%';
Variable_name Value
gtid_binlog_pos 1111-1-2503
connection node_3;
# GTID in node3
show variables like 'wsrep_gtid_domain_id';
Variable_name Value
wsrep_gtid_domain_id 1111
show variables like '%gtid_binlog_pos%';
Variable_name Value
gtid_binlog_pos 1111-1-2503
# Shutdown node_3
connection node_3;
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
# Wait until node_3 leaves cluster
connection node_1b;
connection node_1;
CALL insert_row('node1', 50);
CREATE TABLE t3(i int primary key) engine=innodb;
connection node_3;
# Rejoin node_3
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0';
connection node_1b;
# Wait until node_3 is back in cluster
# node3 has joined
connection node_1;
# GTID in node1
show variables like 'wsrep_gtid_domain_id';
Variable_name Value
wsrep_gtid_domain_id 1111
show variables like '%gtid_binlog_pos%';
Variable_name Value
gtid_binlog_pos 1111-1-2554
connection node_2;
# GTID in node2
show variables like 'wsrep_gtid_domain_id';
Variable_name Value
wsrep_gtid_domain_id 1111
show variables like '%gtid_binlog_pos%';
Variable_name Value
gtid_binlog_pos 1111-1-2554
connection node_3;
# GTID in node3
show variables like 'wsrep_gtid_domain_id';
Variable_name Value
wsrep_gtid_domain_id 1111
show variables like '%gtid_binlog_pos%';
Variable_name Value
gtid_binlog_pos 1111-1-2554
# One by one shutdown all nodes
connection node_3;
# shutdown node_3
connection node_2;
# wait until node_3 is out of cluster
# shutdown node_2
connection node_1;
# wait until node_2 is out of cluster
# shutdown node_1
# Bootstrap from node_1
connection node_1;
# restart: --wsrep_new_cluster
show variables like 'wsrep_gtid_domain_id';
Variable_name Value
wsrep_gtid_domain_id 1111
show variables like '%gtid_binlog_pos%';
Variable_name Value
gtid_binlog_pos 1111-1-2554
ANALYZE TABLE t2;
Table Op Msg_type Msg_text
test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status OK
CALL insert_row('node1', 100);;
# Restart node_2
connection node_2;
# restart
connect node_1c, 127.0.0.1, root, , test, $NODE_MYPORT_1;
set wsrep_sync_wait=0;
connection node_1c;
# wait until node_1 and node_2 are in cluster
connection node_2;
ALTER TABLE t2 ADD COLUMN (k int);
CALL insert_row('node2', 100);;
# Restart node_3
connection node_3;
# restart
connection node_1c;
# wait until all nodes are back in cluster
after cluster restart
connection node_2;
connection node_1;
connection node_1;
node1 GTID
show variables like 'wsrep_gtid_domain_id';
Variable_name Value
wsrep_gtid_domain_id 1111
show variables like '%gtid_binlog_pos%';
Variable_name Value
gtid_binlog_pos 1111-1-2756
connection node_2;
node2 GTID
show variables like 'wsrep_gtid_domain_id';
Variable_name Value
wsrep_gtid_domain_id 1111
show variables like '%gtid_binlog_pos%';
Variable_name Value
gtid_binlog_pos 1111-1-2756
connection node_3;
node3 GTID
show variables like 'wsrep_gtid_domain_id';
Variable_name Value
wsrep_gtid_domain_id 1111
show variables like '%gtid_binlog_pos%';
Variable_name Value
gtid_binlog_pos 1111-1-2756
connection node_1;
table size in node1
SELECT COUNT(*) FROM t1;
COUNT(*)
2750
connection node_2;
table size in node2
SELECT COUNT(*) FROM t1;
COUNT(*)
2750
connection node_3;
table size in node3
SELECT COUNT(*) FROM t1;
COUNT(*)
2750
connection node_2;
call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node");
call mtr.add_suppression("WSREP: Sending JOIN failed:.*");
call mtr.add_suppression("Sending JOIN failed:.*");
call mtr.add_suppression("WSREP: Failed to JOIN the cluster after SST.*");
connection node_3;
call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node");
call mtr.add_suppression("WSREP: Sending JOIN failed:.*");
call mtr.add_suppression("Sending JOIN failed:.*");
call mtr.add_suppression("WSREP: Failed to JOIN the cluster after SST.*");
# cleanup
connection node_1;
DROP PROCEDURE insert_row;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
connection node_3;
connection node_2;
disconnect node_3;
disconnect node_2b;
disconnect node_1b;
disconnect node_1c;

View File

@@ -1,22 +1,22 @@
connection node_2;
connection node_1;
call mtr.add_suppression("WSREP: Stray state UUID msg: .*");
call mtr.add_suppression("WSREP: Protocol violation. JOIN message sender .*");
call mtr.add_suppression("WSREP: Sending JOIN failed: .*");
flush tables;
connection node_1;
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE
4
connection node_1;
3
CREATE TABLE t1 (f1 INTEGER) ENGINE=INNODB;
connection node_2;
set global wsrep_sync_wait=15;
INSERT INTO t1 VALUES (1);
SELECT COUNT(*) AS EXPECT_1 FROM t1;
EXPECT_1
1
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
connection node_3;
set global wsrep_sync_wait=15;
SELECT COUNT(*) FROM t1;
COUNT(*)
SELECT COUNT(*) AS EXPECT_1 FROM t1;
EXPECT_1
1
connection node_1;
SELECT COUNT(*) AS EXPECT_1 FROM t1;
EXPECT_1
1
DROP TABLE t1;

View File

@@ -4,11 +4,13 @@
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/galera_sst_method.inc
--source include/force_restart.inc
#
# Initially wsrep gtid domain id is 100
#
--connection node_1
select @@wsrep_gtid_domain_id,@@wsrep_node_name;
@@ -26,6 +28,10 @@ select @@wsrep_gtid_domain_id,@@wsrep_node_name;
--connection node_3
--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
--connection node_2
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
@@ -36,6 +42,7 @@ select @@wsrep_gtid_domain_id,@@wsrep_node_name;
--source include/wait_condition.inc
--source include/shutdown_mysqld.inc
--sleep 5
#
# Bootstrap from node_1 and change wsrep_gtid_domain_id to 200
@@ -45,12 +52,11 @@ select @@wsrep_gtid_domain_id,@@wsrep_node_name;
--source include/start_mysqld.inc
show variables like 'wsrep_gtid_domain_id';
#
# Restart node_2, expect that wsrep_gtid_domain_id has changed to 200
#
--connection node_2
--let $restart_parameters =
--let $restart_parameters =
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
--source include/start_mysqld.inc
show variables like 'wsrep_gtid_domain_id';

View File

@@ -0,0 +1,35 @@
!include ../galera_3nodes.cnf
[mysqld.1]
wsrep-node-name="node1"
wsrep_gtid_domain_id=1111
gtid_domain_id=2
server_id=10999
wsrep_sst_auth="root:"
wsrep_sst_method=mariabackup
log_slave_updates=ON
log_bin=mariadb-bin-log
binlog-format=row
wsrep-gtid-mode=ON
[mysqld.2]
wsrep-node-name="node2"
wsrep_gtid_domain_id=1112
gtid_domain_id=3
wsrep_sst_auth="root:"
wsrep_sst_method=mariabackup
log_slave_updates=ON
log_bin=mariadb-bin-log
binlog-format=row
wsrep-gtid-mode=ON
[mysqld.3]
wsrep-node-name="node3"
wsrep_gtid_domain_id=1113
gtid_domain_id=4
wsrep_sst_auth="root:"
wsrep_sst_method=mariabackup
log_slave_updates=ON
log_bin=mariadb-bin-log
binlog-format=row
wsrep-gtid-mode=ON

View File

@@ -0,0 +1,346 @@
--source include/galera_cluster.inc
--source include/big_test.inc
--source include/force_restart.inc
#
# Testing gtid consistency in 3 node cluster when nodes drop
# and join back to cluster.
# The tests verify that wsrep_gtid_domain_id and gtid_binlog_pos
# remains same across the cluster
# In the configuration, nodes have different wsrep_gtid_domain_id
# but all nodes are supposed to receive effective domain id
# from the bootstrap node (node_1), and use it
#
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--connect node_2b, 127.0.0.1, root, , test, $NODE_MYPORT_2
set wsrep_sync_wait=0;
--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1
set wsrep_sync_wait=0;
--connection node_1
DELIMITER |;
CREATE PROCEDURE insert_row (IN node varchar(10), IN repeat_count int)
BEGIN
DECLARE current_num int;
SET current_num = 0;
WHILE current_num < repeat_count do
INSERT INTO t1(node, name) VALUES (node, UUID());
SET current_num = current_num + 1;
END WHILE;
END|
DELIMITER ;|
CREATE TABLE t1 (id bigint not null primary key auto_increment, node VARCHAR(10), name VARCHAR(64)) ENGINE=innodb;
#
# report initial gtid positions after table t1 is created
#
--echo # node_1
show variables like '%gtid_binlog_pos%';
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'
--source include/wait_condition.inc
--echo # node_2
show variables like '%gtid_binlog_pos%';
--connection node_3
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'
--source include/wait_condition.inc
--echo # node_3
show variables like '%gtid_binlog_pos%';
###########################################
# scenario: join node 2 by SST
##########################################
#
# start concurrent insert load and stop node2 while the load is on
#
--connection node_1
--send CALL insert_row('node1', 500);
--connection node_2
--send CALL insert_row('node2', 500);
--connection node_3
--send CALL insert_row('node3', 500);
#
# stop load to node 2 and shutdown the node, force SST
#
--connection node_2
--reap
--echo # Shutdown node_2, force SST
--connection node_2b
--source include/shutdown_mysqld.inc
--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
--echo # Wait until node_2 leaves cluster
--connection node_1b
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
#
# stop the remaining load to node 1 and 3
#
--connection node_1
--reap
--connection node_3
--reap
#
# some more inserts and DDL to nodes 1 and 3
# while node 2 is absent
#
--connection node_1
CALL insert_row('node1', 500);
--connection node_3
CALL insert_row('node3', 500);
CREATE TABLE t2(i int primary key) engine=innodb;
#
# restart node 2, should join by SST
#
--connection node_2
--echo # Restart node_2
--source include/start_mysqld.inc
--connection node_1b
--echo # Wait until node_2 is back in cluster
--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
--echo # node2 has joined
#
# check gtid positions in all nodes
#
--echo # GTID in node1
show variables like 'wsrep_gtid_domain_id';
show variables like '%gtid_binlog_pos%';
--connection node_2
--echo # GTID in node2
show variables like 'wsrep_gtid_domain_id';
show variables like '%gtid_binlog_pos%';
--connection node_3
--echo # GTID in node3
show variables like 'wsrep_gtid_domain_id';
show variables like '%gtid_binlog_pos%';
###########################################
# scenario: join node 3 by IST
##########################################
--echo # Shutdown node_3
--connection node_3
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
--echo # Wait until node_3 leaves cluster
--connection node_1b
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
#
# do some inserts and DDL to node 1
# while node 3 is absent
#
--connection node_1
CALL insert_row('node1', 50);
CREATE TABLE t3(i int primary key) engine=innodb;
#
# remove isolation in node 3, should join by IST
#
--connection node_3
--echo # Rejoin node_3
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0';
--connection node_1b
--echo # Wait until node_3 is back in cluster
--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
--echo # node3 has joined
#
# check gtid positions in all nodes
#
--connection node_1
--echo # GTID in node1
show variables like 'wsrep_gtid_domain_id';
show variables like '%gtid_binlog_pos%';
--connection node_2
--echo # GTID in node2
show variables like 'wsrep_gtid_domain_id';
show variables like '%gtid_binlog_pos%';
--connection node_3
--echo # GTID in node3
show variables like 'wsrep_gtid_domain_id';
show variables like '%gtid_binlog_pos%';
###########################################
# scenario: restart full custer
##########################################
#
# stop all nodes, one by one
#
--echo # One by one shutdown all nodes
--connection node_3
--echo # shutdown node_3
--source include/shutdown_mysqld.inc
--remove_file $MYSQLTEST_VARDIR/mysqld.3/data/grastate.dat
--connection node_2
--echo # wait until node_3 is out of cluster
--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
--source include/shutdown_mysqld.inc
--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
--connection node_1
--echo # wait until node_2 is out of cluster
--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
--source include/shutdown_mysqld.inc
#
# bootstap cluster in order node1 - node2 - node3
# send some inserts and DDL after each node started
#
--sleep 5
--echo # Bootstrap from node_1
--connection node_1
--let $restart_parameters = --wsrep_new_cluster
--source include/start_mysqld.inc
show variables like 'wsrep_gtid_domain_id';
show variables like '%gtid_binlog_pos%';
ANALYZE TABLE t2;
--send CALL insert_row('node1', 100);
--echo # Restart node_2
--connection node_2
--let $restart_parameters =
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
--source include/start_mysqld.inc
#
# connection node_1b may not be functional anymore, after node was
# shutdown, open node_1c for controlling node 1 state
#
--connect node_1c, 127.0.0.1, root, , test, $NODE_MYPORT_1
set wsrep_sync_wait=0;
--connection node_1c
--echo # wait until node_1 and node_2 are in cluster
--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
ALTER TABLE t2 ADD COLUMN (k int);
--send CALL insert_row('node2', 100);
--echo # Restart node_3
--connection node_3
--let $restart_parameters =
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.3.expect
--source include/start_mysqld.inc
--connection node_1c
--echo # wait until all nodes are back in cluster
--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
--echo after cluster restart
# stop load for nodes 1 and 2
--connection node_2
--reap
--connection node_1
--reap
#
# check gtid positions in all nodes
#
--connection node_1
--echo node1 GTID
show variables like 'wsrep_gtid_domain_id';
show variables like '%gtid_binlog_pos%';
--connection node_2
--echo node2 GTID
show variables like 'wsrep_gtid_domain_id';
show variables like '%gtid_binlog_pos%';
--connection node_3
--echo node3 GTID
show variables like 'wsrep_gtid_domain_id';
show variables like '%gtid_binlog_pos%';
#
# check table size in all nodes
#
--connection node_1
--echo table size in node1
SELECT COUNT(*) FROM t1;
--connection node_2
--echo table size in node2
SELECT COUNT(*) FROM t1;
--connection node_3
--echo table size in node3
SELECT COUNT(*) FROM t1;
#
# cleanups
#
--connection node_2
call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node");
call mtr.add_suppression("WSREP: Sending JOIN failed:.*");
call mtr.add_suppression("Sending JOIN failed:.*");
call mtr.add_suppression("WSREP: Failed to JOIN the cluster after SST.*");
--connection node_3
call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node");
call mtr.add_suppression("WSREP: Sending JOIN failed:.*");
call mtr.add_suppression("Sending JOIN failed:.*");
call mtr.add_suppression("WSREP: Failed to JOIN the cluster after SST.*");
--echo # cleanup
--connection node_1
DROP PROCEDURE insert_row;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
--connection node_3
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't2'
--source include/wait_condition.inc
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't2'
--source include/wait_condition.inc
--disconnect node_3
--disconnect node_2b
--disconnect node_1b
--disconnect node_1c

View File

@@ -1,4 +1,4 @@
!include ../galera_4nodes.cnf
!include ../galera_3nodes.cnf
[mysqld.2]
wsrep_node_address=127.0.0.1
@@ -6,5 +6,3 @@ wsrep_node_address=127.0.0.1
[mysqld.3]
wsrep_node_address=localhost
[mysqld.4]
wsrep_node_address=lo

View File

@@ -6,27 +6,27 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
call mtr.add_suppression("WSREP: Stray state UUID msg: .*");
call mtr.add_suppression("WSREP: Protocol violation. JOIN message sender .*");
call mtr.add_suppression("WSREP: Sending JOIN failed: .*");
flush tables;
--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--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 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--connection node_1
CREATE TABLE t1 (f1 INTEGER) ENGINE=INNODB;
--connection node_2
set global wsrep_sync_wait=15;
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
INSERT INTO t1 VALUES (1);
SELECT COUNT(*) AS EXPECT_1 FROM t1;
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--connection node_3
set global wsrep_sync_wait=15;
SELECT COUNT(*) FROM t1;
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
SELECT COUNT(*) AS EXPECT_1 FROM t1;
--connection node_1
SELECT COUNT(*) AS EXPECT_1 FROM t1;
DROP TABLE t1;

View File

@@ -9,5 +9,3 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
galera_sr_kill_slave_after_apply_rollback2 : MDEV-29892 Galera test failure on galera_sr_kill_slave_after_apply_rollback2

View File

@@ -1,5 +1,7 @@
--source include/galera_cluster.inc
--disable_ps2_protocol
--connection node_2
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
@@ -45,3 +47,6 @@ CALL mtr.add_suppression("WSREP: failed to send SR rollback for ");
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--connection node_3
--source include/galera_wait_ready.inc
--enable_ps2_protocol

View File

@@ -1,6 +1,7 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
--disable_ps2_protocol
#
# Test the effect of gmcast.isolate on master during an SR transaction
#
@@ -133,3 +134,4 @@ CALL mtr.add_suppression("failed to send SR rollback for");
DROP TABLE t1;
--source ../galera/include/auto_increment_offset_restore.inc
--enable_ps2_protocol

View File

@@ -11,6 +11,5 @@
##############################################################################
GCF-1060 : MDEV-32160 GCF-1060 test failure due to wsrep MDL conflict
galera_sr_cc_master : MDEV-29882 Galera test failure on galera_sr_cc_master
# Links to below failures in MDEV-30172
MDEV-25718 : timeout related to wsrep_sync_wait and DEBUG_SYNC

View File

@@ -13,12 +13,12 @@ INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (5);
SELECT COUNT(*) FROM mysql.wsrep_streaming_log;
COUNT(*)
SELECT COUNT(*) AS EXPECT_5 FROM mysql.wsrep_streaming_log;
EXPECT_5
5
connection node_1;
SELECT COUNT(*) FROM mysql.wsrep_streaming_log;
COUNT(*)
SELECT COUNT(*) AS EXPECT_5 FROM mysql.wsrep_streaming_log;
EXPECT_5
5
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
connection node_2a;
@@ -29,8 +29,8 @@ connection node_2;
INSERT INTO t1 VALUES (6);
ERROR HY000: Lost connection to server during query
connection node_1;
SELECT COUNT(*) FROM mysql.wsrep_streaming_log;
COUNT(*)
SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log;
EXPECT_0
0
connection node_2a;
connection node_1;
@@ -38,8 +38,8 @@ connect node_2b, 127.0.0.1, root, , test, $NODE_MYPORT_2;
connection node_2b;
SELECT * FROM mysql.wsrep_streaming_log;
node_uuid trx_id seqno flags frag
SELECT COUNT(*) FROM mysql.wsrep_streaming_log;
COUNT(*)
SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log;
EXPECT_0
0
SET AUTOCOMMIT=OFF;
START TRANSACTION;
@@ -49,18 +49,20 @@ INSERT INTO t1 VALUES (3);
INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (5);
COMMIT;
SELECT COUNT(*) FROM mysql.wsrep_streaming_log;
COUNT(*)
SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log;
EXPECT_0
0
connection node_1;
SELECT COUNT(*) FROM t1;
COUNT(*)
SELECT COUNT(*) AS EXPECT_5 FROM t1;
EXPECT_5
5
SELECT COUNT(*) FROM mysql.wsrep_streaming_log;
COUNT(*)
SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log;
EXPECT_0
0
DROP TABLE t1;
connection node_2b;
CALL mtr.add_suppression("WSREP: Failed to replicate rollback fragment for");
disconnect node_2;
connect node_2, 127.0.0.1, root, , test, $NODE_MYPORT_2;
disconnect node_2a;
disconnect node_2b;

View File

@@ -26,6 +26,7 @@ f1 f2
connection node_1c;
SET AUTOCOMMIT=ON;
INSERT INTO t1 VALUES (3, 'c');
connection node_1;
connection node_2;
SELECT * FROM t1;
f1 f2
@@ -91,6 +92,7 @@ f1 f2
connection node_1c;
SET AUTOCOMMIT=ON;
INSERT INTO t1 VALUES (3, 'c');
connection node_1;
connection node_2;
SELECT * FROM t1;
f1 f2
@@ -156,6 +158,7 @@ f1 f2
connection node_1c;
SET AUTOCOMMIT=ON;
INSERT INTO t1 VALUES (3, 'c');
connection node_1;
connection node_2;
SELECT * FROM t1;
f1 f2
@@ -221,6 +224,7 @@ f1 f2
connection node_1c;
SET AUTOCOMMIT=ON;
INSERT INTO t1 VALUES (3, 'c');
connection node_1;
connection node_2;
SELECT * FROM t1;
f1 f2
@@ -286,6 +290,7 @@ f1 f2
connection node_1c;
SET AUTOCOMMIT=ON;
INSERT INTO t1 VALUES (3, 'c');
connection node_1;
connection node_2;
SELECT * FROM t1;
f1 f2
@@ -351,6 +356,7 @@ f1 f2
connection node_1c;
SET AUTOCOMMIT=ON;
INSERT INTO t1 VALUES (3, 'c');
connection node_1;
connection node_2;
SELECT * FROM t1;
f1 f2
@@ -416,6 +422,7 @@ f1 f2
connection node_1c;
SET AUTOCOMMIT=ON;
INSERT INTO t1 VALUES (3, 'c');
connection node_1;
connection node_2;
SELECT * FROM t1;
f1 f2
@@ -481,6 +488,7 @@ f1 f2
connection node_1c;
SET AUTOCOMMIT=ON;
INSERT INTO t1 VALUES (3, 'c');
connection node_1;
connection node_2;
SELECT * FROM t1;
f1 f2
@@ -546,6 +554,7 @@ f1 f2
connection node_1c;
SET AUTOCOMMIT=ON;
INSERT INTO t1 VALUES (3, 'c');
connection node_1;
connection node_2;
SELECT * FROM t1;
f1 f2
@@ -611,6 +620,7 @@ f1 f2
connection node_1c;
SET AUTOCOMMIT=ON;
INSERT INTO t1 VALUES (3, 'c');
connection node_1;
connection node_2;
SELECT * FROM t1;
f1 f2
@@ -676,6 +686,7 @@ f1 f2
connection node_1c;
SET AUTOCOMMIT=ON;
INSERT INTO t1 VALUES (3, 'c');
connection node_1;
connection node_2;
SELECT * FROM t1;
f1 f2
@@ -741,6 +752,7 @@ f1 f2
connection node_1c;
SET AUTOCOMMIT=ON;
INSERT INTO t1 VALUES (3, 'c');
connection node_1;
connection node_2;
SELECT * FROM t1;
f1 f2
@@ -806,6 +818,7 @@ f1 f2
connection node_1c;
SET AUTOCOMMIT=ON;
INSERT INTO t1 VALUES (3, 'c');
connection node_1;
connection node_2;
SELECT * FROM t1;
f1 f2
@@ -871,6 +884,7 @@ f1 f2
connection node_1c;
SET AUTOCOMMIT=ON;
INSERT INTO t1 VALUES (3, 'c');
connection node_1;
connection node_2;
SELECT * FROM t1;
f1 f2
@@ -936,6 +950,7 @@ f1 f2
connection node_1c;
SET AUTOCOMMIT=ON;
INSERT INTO t1 VALUES (3, 'c');
connection node_1;
connection node_2;
SELECT * FROM t1;
f1 f2
@@ -1001,6 +1016,7 @@ f1 f2
connection node_1c;
SET AUTOCOMMIT=ON;
INSERT INTO t1 VALUES (3, 'c');
connection node_1;
connection node_2;
SELECT * FROM t1;
f1 f2

View File

@@ -32,10 +32,13 @@ INSERT INTO t1 VALUES (3);
INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (5);
SELECT COUNT(*) FROM mysql.wsrep_streaming_log;
SELECT COUNT(*) AS EXPECT_5 FROM mysql.wsrep_streaming_log;
--connection node_1
SELECT COUNT(*) FROM mysql.wsrep_streaming_log;
--let $wait_condition = SELECT COUNT(*) = 5 FROM mysql.wsrep_streaming_log
--source include/wait_condition.inc
SELECT COUNT(*) AS EXPECT_5 FROM mysql.wsrep_streaming_log;
#
# Trigger CC . The transaction is aborted and we expect the SR tables to be cleaned up
@@ -56,7 +59,9 @@ SET SESSION wsrep_sync_wait = DEFAULT;
INSERT INTO t1 VALUES (6);
--connection node_1
SELECT COUNT(*) FROM mysql.wsrep_streaming_log;
--let $wait_condition = SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log
--source include/wait_condition.inc
SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log;
# Restore cluster
@@ -73,8 +78,10 @@ SELECT COUNT(*) FROM mysql.wsrep_streaming_log;
--connect node_2b, 127.0.0.1, root, , test, $NODE_MYPORT_2
--connection node_2b
--source include/galera_wait_ready.inc
--let $wait_condition = SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log
--source include/wait_condition.inc
SELECT * FROM mysql.wsrep_streaming_log;
SELECT COUNT(*) FROM mysql.wsrep_streaming_log;
SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log;
# Repeat transaction to confirm no locks are left from previous transaction
@@ -87,11 +94,13 @@ INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (5);
COMMIT;
SELECT COUNT(*) FROM mysql.wsrep_streaming_log;
SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log;
--connection node_1
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) FROM mysql.wsrep_streaming_log;
--let $wait_condition = SELECT COUNT(*) = 5 FROM t1
--source include/wait_condition.inc
SELECT COUNT(*) AS EXPECT_5 FROM t1;
SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log;
DROP TABLE t1;
@@ -102,3 +111,6 @@ CALL mtr.add_suppression("WSREP: Failed to replicate rollback fragment for");
--connect node_2, 127.0.0.1, root, , test, $NODE_MYPORT_2
# Restore original auto_increment_offset values.
--source ../galera/include/auto_increment_offset_restore.inc
--disconnect node_2a
--disconnect node_2b

View File

@@ -6,6 +6,8 @@
--source include/have_innodb.inc
--source include/big_test.inc
--disable_ps2_protocol
CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
@@ -56,3 +58,4 @@ CALL mtr.add_suppression('InnoDB: Resizing redo log from');
CALL mtr.add_suppression('InnoDB: Starting to delete and rewrite log files');
CALL mtr.add_suppression('InnoDB: New log files created, LSN=');
--enable_ps2_protocol

View File

@@ -6,6 +6,8 @@
--source include/have_innodb.inc
--source include/big_test.inc
--disable_ps2_protocol
CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
@@ -51,3 +53,5 @@ SELECT COUNT(*) = 0 FROM t1;
DROP TABLE ten;
DROP TABLE t1;
--enable_ps2_protocol

View File

@@ -46,6 +46,10 @@ SELECT * FROM t1;
SET AUTOCOMMIT=ON;
--send INSERT INTO t1 VALUES (3, 'c')
--connection node_1
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS;
--source include/wait_condition.inc
--connection node_2
SELECT * FROM t1;
@@ -54,7 +58,7 @@ SELECT * FROM t1;
--send UPDATE t1 SET f2 = 'a' WHERE f1 = 2
--connection node_1
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER != 'system user' AND STATE = 'Updating';
--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS;
--source include/wait_condition.inc
# Will deadlock

View File

@@ -1 +0,0 @@
doublewrite_debug : MDEV-33098 occasionally fails to start up InnoDB

View File

@@ -9,7 +9,7 @@ INSERT INTO t2 VALUES(1);
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
SELECT * FROM t1;
ERROR HY000: Table test/t1 is corrupted. Please drop the table and recreate.
Got one of the listed errors
SELECT * FROM t2;
a
1

View File

@@ -12,7 +12,7 @@ innodb_fil_make_page_dirty_debug 0
show variables like 'innodb_saved_page_number_debug';
Variable_name Value
innodb_saved_page_number_debug 0
create table t1 (f1 int primary key, f2 blob) engine=innodb;
create table t1 (f1 int primary key, f2 blob) engine=innodb stats_persistent=0;
start transaction;
insert into t1 values(1, repeat('#',12));
insert into t1 values(2, repeat('+',12));
@@ -23,7 +23,7 @@ commit work;
# Test Begin: Test if recovery works if 1st page and 2nd page
# of system tablespace is full of zeroes.
SET GLOBAL innodb_fast_shutdown = 0;
# restart
# restart: --debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0
begin;
insert into t1 values (6, repeat('%', 400));
# Make the first page dirty for system tablespace
@@ -33,6 +33,7 @@ set global innodb_fil_make_page_dirty_debug = 0;
set global innodb_saved_page_number_debug = 1;
set global innodb_fil_make_page_dirty_debug = 0;
set global innodb_buf_flush_list_now = 1;
# Kill the server
# Make the 1st page (page_no=0) and 2nd page (page_no=1)
# of the system tablespace all zeroes.
# restart
@@ -52,7 +53,7 @@ f1 f2
# ---------------------------------------------------------------
# Test Begin: Test if recovery works if 1st page of
# system tablespace is corrupted and 2nd page as corrupted.
set global innodb_log_checkpoint_now = 1;
# restart: --debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0
begin;
insert into t1 values (6, repeat('%', 400));
# Make the first page dirty for system tablespace
@@ -62,6 +63,7 @@ set global innodb_fil_make_page_dirty_debug = 0;
set global innodb_saved_page_number_debug = 1;
set global innodb_fil_make_page_dirty_debug = 0;
set global innodb_buf_flush_list_now = 1;
# Kill the server
# Corrupt the 1st page (page_no=0) and 2nd page of the system tablespace.
# restart
FOUND 2 /InnoDB: Restoring page \[page id: space=0, page number=0\] of datafile/ in mysqld.1.err
@@ -83,7 +85,7 @@ drop table t1;
# MDEV-12600 crash during install_db with innodb_page_size=32K
# and ibdata1=3M
#
# restart: --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/doublewrite --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/doublewrite --innodb-data-file-path=ibdata1:1M;ibdata2:1M:autoextend
# restart: --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/doublewrite --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/doublewrite --innodb-undo-tablespaces=0 --innodb-data-file-path=ibdata1:1M;ibdata2:1M:autoextend
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');

View File

@@ -9,13 +9,9 @@ Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_par
t1 1 idx1 1 col_1 A 0 NULL NULL YES BTREE NO
t1 1 idx2 1 col_2 A 0 NULL NULL YES BTREE NO
INSERT INTO t1 VALUES ("col1_00001", "col2_00001"), ("col1_00002", "col2_00002");
SHOW INDEXES FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
t1 1 idx1 1 col_1 A 1 NULL NULL YES BTREE NO
t1 1 idx2 1 col_2 A 1 NULL NULL YES BTREE NO
SET STATEMENT use_stat_tables=never FOR
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
SHOW INDEXES FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored

View File

@@ -59,7 +59,7 @@ SELECT * FROM t1;
let $restart_parameters=--innodb_force_recovery=1;
--source include/restart_mysqld.inc
--error ER_TABLE_CORRUPT
--error ER_NO_SUCH_TABLE_IN_ENGINE,ER_TABLE_CORRUPT
SELECT * FROM t1;
SELECT * FROM t2;
CHECK TABLE t2;

View File

@@ -1,9 +1,7 @@
[strict_crc32]
--innodb-checksum-algorithm=strict_crc32
--innodb-use-atomic-writes=0
--innodb-undo-tablespaces=0
[strict_full_crc32]
--innodb-checksum-algorithm=strict_full_crc32
--innodb-use-atomic-writes=0
--innodb-undo-tablespaces=0

View File

@@ -28,7 +28,7 @@ show variables like 'innodb_doublewrite';
show variables like 'innodb_fil_make_page_dirty_debug';
show variables like 'innodb_saved_page_number_debug';
create table t1 (f1 int primary key, f2 blob) engine=innodb;
create table t1 (f1 int primary key, f2 blob) engine=innodb stats_persistent=0;
start transaction;
insert into t1 values(1, repeat('#',12));
@@ -44,7 +44,9 @@ commit work;
# Slow shutdown and restart to make sure ibuf merge is finished
SET GLOBAL innodb_fast_shutdown = 0;
let $shutdown_timeout=;
let $restart_parameters="--debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0";
--source include/restart_mysqld.inc
--source ../include/no_checkpoint_start.inc
begin;
insert into t1 values (6, repeat('%', 400));
@@ -57,8 +59,20 @@ set global innodb_saved_page_number_debug = 1;
set global innodb_fil_make_page_dirty_debug = 0;
set global innodb_buf_flush_list_now = 1;
let $shutdown_timeout=0;
--source include/shutdown_mysqld.inc
--let CLEANUP_IF_CHECKPOINT=drop table t1, unexpected_checkpoint;
# Occasionally, a checkpoint would occur on the MSAN builder.
# We do not know the reason, because the failure can only be reproduced if there is
# enough load in that environment.
# Therefore, we allow the test to be skipped when run on MSAN.
# In other environments, we want the test to fail if a checkpoint occurs,
# so that we would catch it if it starts to happen regularly.
if (`select count(*) from information_schema.system_variables where variable_name='have_sanitizer' and global_value like "MSAN%"`)
{
--let CLEANUP_IF_CHECKPOINT=drop table t1;
}
--source ../include/no_checkpoint_end.inc
--echo # Make the 1st page (page_no=0) and 2nd page (page_no=1)
--echo # of the system tablespace all zeroes.
@@ -74,6 +88,7 @@ print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'});
close FILE;
EOF
let $restart_parameters=;
--source include/start_mysqld.inc
let SEARCH_PATTERN=InnoDB: Restoring page \[page id: space=0, page number=0\] of datafile;
@@ -90,7 +105,9 @@ select f1, f2 from t1;
--echo # Test Begin: Test if recovery works if 1st page of
--echo # system tablespace is corrupted and 2nd page as corrupted.
set global innodb_log_checkpoint_now = 1;
let $restart_parameters="--debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0";
--source include/restart_mysqld.inc
--source ../include/no_checkpoint_start.inc
begin;
insert into t1 values (6, repeat('%', 400));
@@ -103,8 +120,8 @@ set global innodb_saved_page_number_debug = 1;
set global innodb_fil_make_page_dirty_debug = 0;
set global innodb_buf_flush_list_now = 1;
let $shutdown_timeout=0;
--source include/shutdown_mysqld.inc
--source ../include/no_checkpoint_end.inc
--echo # Corrupt the 1st page (page_no=0) and 2nd page of the system tablespace.
perl;
@@ -119,6 +136,7 @@ print FILE chr(0) x ($ENV{'INNODB_PAGE_SIZE'}/2);
close FILE;
EOF
let $restart_parameters=;
--source include/start_mysqld.inc
let SEARCH_PATTERN=InnoDB: Restoring page \[page id: space=0, page number=0\] of datafile;
@@ -145,7 +163,7 @@ WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
--let $ibp=--innodb-log-group-home-dir=$bugdir --innodb-data-home-dir=$bugdir
--let $ibd=$ibp --innodb-undo-tablespaces=0
--let $ibp=$ibp --innodb-undo-tablespaces=0
--let $ibp=$ibp --innodb-data-file-path=ibdata1:1M;ibdata2:1M:autoextend
--let $restart_parameters= $ibp

View File

@@ -19,8 +19,10 @@ SHOW INDEXES FROM t1;
INSERT INTO t1 VALUES ("col1_00001", "col2_00001"), ("col1_00002", "col2_00002");
SHOW INDEXES FROM t1;
# Here, the cardinality would sometimes be 2 (already updated), sometimes 1.
# SHOW INDEXES FROM t1;
SET STATEMENT use_stat_tables=never FOR
ANALYZE TABLE t1;
SHOW INDEXES FROM t1;