From 3f619478f796eddbba6e39502fe941b285dd97b1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 20:00:34 +0200 Subject: Adding upstream version 1:10.11.6. Signed-off-by: Daniel Baumann --- mysql-test/suite/wsrep/t/MDEV-20625.cnf | 8 + mysql-test/suite/wsrep/t/MDEV-20625.test | 10 ++ mysql-test/suite/wsrep/t/MDEV-22443.cnf | 8 + mysql-test/suite/wsrep/t/MDEV-22443.test | 12 ++ mysql-test/suite/wsrep/t/MDEV-23081.cnf | 9 + mysql-test/suite/wsrep/t/MDEV-23081.combinations | 4 + mysql-test/suite/wsrep/t/MDEV-23081.test | 57 ++++++ mysql-test/suite/wsrep/t/MDEV-23092.cnf | 8 + mysql-test/suite/wsrep/t/MDEV-23092.test | 22 +++ mysql-test/suite/wsrep/t/MDEV-23466.cnf | 8 + mysql-test/suite/wsrep/t/MDEV-23466.test | 10 ++ mysql-test/suite/wsrep/t/alter_table_innodb.cnf | 12 ++ mysql-test/suite/wsrep/t/alter_table_innodb.test | 10 ++ mysql-test/suite/wsrep/t/binlog_format.cnf | 8 + mysql-test/suite/wsrep/t/binlog_format.opt | 1 + mysql-test/suite/wsrep/t/binlog_format.test | 48 +++++ mysql-test/suite/wsrep/t/foreign_key.opt | 1 + mysql-test/suite/wsrep/t/foreign_key.test | 20 +++ mysql-test/suite/wsrep/t/mdev_10186.cnf | 15 ++ mysql-test/suite/wsrep/t/mdev_10186.test | 12 ++ mysql-test/suite/wsrep/t/mdev_22681.cnf | 10 ++ mysql-test/suite/wsrep/t/mdev_22681.test | 15 ++ mysql-test/suite/wsrep/t/mdev_6832.cnf | 7 + mysql-test/suite/wsrep/t/mdev_6832.test | 17 ++ mysql-test/suite/wsrep/t/mdev_7798.cnf | 7 + mysql-test/suite/wsrep/t/mdev_7798.test | 18 ++ mysql-test/suite/wsrep/t/plugin.opt | 1 + mysql-test/suite/wsrep/t/plugin.test | 8 + mysql-test/suite/wsrep/t/pool_of_threads.opt | 1 + mysql-test/suite/wsrep/t/pool_of_threads.test | 12 ++ mysql-test/suite/wsrep/t/trans.opt | 1 + mysql-test/suite/wsrep/t/trans.test | 14 ++ mysql-test/suite/wsrep/t/variables.cnf | 7 + mysql-test/suite/wsrep/t/variables.test | 26 +++ mysql-test/suite/wsrep/t/variables_debug.cnf | 7 + mysql-test/suite/wsrep/t/variables_debug.test | 28 +++ mysql-test/suite/wsrep/t/wsrep-recover-step.inc | 41 +++++ mysql-test/suite/wsrep/t/wsrep-recover-v25.cnf | 7 + .../suite/wsrep/t/wsrep-recover-v25.combinations | 4 + mysql-test/suite/wsrep/t/wsrep-recover-v25.test | 119 +++++++++++++ mysql-test/suite/wsrep/t/wsrep-recover.cnf | 9 + .../suite/wsrep/t/wsrep-recover.combinations | 4 + mysql-test/suite/wsrep/t/wsrep-recover.test | 194 +++++++++++++++++++++ mysql-test/suite/wsrep/t/wsrep_on_basic.opt | 1 + mysql-test/suite/wsrep/t/wsrep_on_basic.test | 47 +++++ mysql-test/suite/wsrep/t/wsrep_rpl.cnf | 1 + mysql-test/suite/wsrep/t/wsrep_rpl.test | 44 +++++ .../suite/wsrep/t/wsrep_variables_no_provider.cnf | 12 ++ .../suite/wsrep/t/wsrep_variables_no_provider.test | 38 ++++ .../suite/wsrep/t/wsrep_variables_sst_method.cnf | 7 + .../suite/wsrep/t/wsrep_variables_sst_method.test | 50 ++++++ .../suite/wsrep/t/wsrep_variables_wsrep_off.cnf | 12 ++ .../suite/wsrep/t/wsrep_variables_wsrep_off.test | 30 ++++ 53 files changed, 1082 insertions(+) create mode 100644 mysql-test/suite/wsrep/t/MDEV-20625.cnf create mode 100644 mysql-test/suite/wsrep/t/MDEV-20625.test create mode 100644 mysql-test/suite/wsrep/t/MDEV-22443.cnf create mode 100644 mysql-test/suite/wsrep/t/MDEV-22443.test create mode 100644 mysql-test/suite/wsrep/t/MDEV-23081.cnf create mode 100644 mysql-test/suite/wsrep/t/MDEV-23081.combinations create mode 100644 mysql-test/suite/wsrep/t/MDEV-23081.test create mode 100644 mysql-test/suite/wsrep/t/MDEV-23092.cnf create mode 100644 mysql-test/suite/wsrep/t/MDEV-23092.test create mode 100644 mysql-test/suite/wsrep/t/MDEV-23466.cnf create mode 100644 mysql-test/suite/wsrep/t/MDEV-23466.test create mode 100644 mysql-test/suite/wsrep/t/alter_table_innodb.cnf create mode 100644 mysql-test/suite/wsrep/t/alter_table_innodb.test create mode 100644 mysql-test/suite/wsrep/t/binlog_format.cnf create mode 100644 mysql-test/suite/wsrep/t/binlog_format.opt create mode 100644 mysql-test/suite/wsrep/t/binlog_format.test create mode 100644 mysql-test/suite/wsrep/t/foreign_key.opt create mode 100644 mysql-test/suite/wsrep/t/foreign_key.test create mode 100644 mysql-test/suite/wsrep/t/mdev_10186.cnf create mode 100644 mysql-test/suite/wsrep/t/mdev_10186.test create mode 100644 mysql-test/suite/wsrep/t/mdev_22681.cnf create mode 100644 mysql-test/suite/wsrep/t/mdev_22681.test create mode 100644 mysql-test/suite/wsrep/t/mdev_6832.cnf create mode 100644 mysql-test/suite/wsrep/t/mdev_6832.test create mode 100644 mysql-test/suite/wsrep/t/mdev_7798.cnf create mode 100644 mysql-test/suite/wsrep/t/mdev_7798.test create mode 100644 mysql-test/suite/wsrep/t/plugin.opt create mode 100644 mysql-test/suite/wsrep/t/plugin.test create mode 100644 mysql-test/suite/wsrep/t/pool_of_threads.opt create mode 100644 mysql-test/suite/wsrep/t/pool_of_threads.test create mode 100644 mysql-test/suite/wsrep/t/trans.opt create mode 100644 mysql-test/suite/wsrep/t/trans.test create mode 100644 mysql-test/suite/wsrep/t/variables.cnf create mode 100644 mysql-test/suite/wsrep/t/variables.test create mode 100644 mysql-test/suite/wsrep/t/variables_debug.cnf create mode 100644 mysql-test/suite/wsrep/t/variables_debug.test create mode 100644 mysql-test/suite/wsrep/t/wsrep-recover-step.inc create mode 100644 mysql-test/suite/wsrep/t/wsrep-recover-v25.cnf create mode 100644 mysql-test/suite/wsrep/t/wsrep-recover-v25.combinations create mode 100644 mysql-test/suite/wsrep/t/wsrep-recover-v25.test create mode 100644 mysql-test/suite/wsrep/t/wsrep-recover.cnf create mode 100644 mysql-test/suite/wsrep/t/wsrep-recover.combinations create mode 100644 mysql-test/suite/wsrep/t/wsrep-recover.test create mode 100644 mysql-test/suite/wsrep/t/wsrep_on_basic.opt create mode 100644 mysql-test/suite/wsrep/t/wsrep_on_basic.test create mode 100644 mysql-test/suite/wsrep/t/wsrep_rpl.cnf create mode 100644 mysql-test/suite/wsrep/t/wsrep_rpl.test create mode 100644 mysql-test/suite/wsrep/t/wsrep_variables_no_provider.cnf create mode 100644 mysql-test/suite/wsrep/t/wsrep_variables_no_provider.test create mode 100644 mysql-test/suite/wsrep/t/wsrep_variables_sst_method.cnf create mode 100644 mysql-test/suite/wsrep/t/wsrep_variables_sst_method.test create mode 100644 mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.cnf create mode 100644 mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.test (limited to 'mysql-test/suite/wsrep/t') diff --git a/mysql-test/suite/wsrep/t/MDEV-20625.cnf b/mysql-test/suite/wsrep/t/MDEV-20625.cnf new file mode 100644 index 00000000..75f8a25c --- /dev/null +++ b/mysql-test/suite/wsrep/t/MDEV-20625.cnf @@ -0,0 +1,8 @@ +!include ../my.cnf + +[mysqld.1] +wsrep-on=OFF +binlog-format=ROW +wsrep-provider=@ENV.WSREP_PROVIDER +wsrep-cluster-address='gcomm://' +innodb_autoinc_lock_mode=2 diff --git a/mysql-test/suite/wsrep/t/MDEV-20625.test b/mysql-test/suite/wsrep/t/MDEV-20625.test new file mode 100644 index 00000000..2a537fe4 --- /dev/null +++ b/mysql-test/suite/wsrep/t/MDEV-20625.test @@ -0,0 +1,10 @@ +# +# Check SHOW GLOBAL STATUS after dynamic setting WSREP=ON +# +--source include/have_innodb.inc +--source include/have_wsrep_provider.inc +--source include/have_binlog_format_row.inc + +SET GLOBAL wsrep_on=ON; +SHOW GLOBAL STATUS LIKE 'wsrep_cluster_size'; +SET GLOBAL wsrep_on=OFF; diff --git a/mysql-test/suite/wsrep/t/MDEV-22443.cnf b/mysql-test/suite/wsrep/t/MDEV-22443.cnf new file mode 100644 index 00000000..851f2999 --- /dev/null +++ b/mysql-test/suite/wsrep/t/MDEV-22443.cnf @@ -0,0 +1,8 @@ +!include ../my.cnf + +[mysqld.1] +wsrep-on=OFF +binlog-format=ROW +wsrep-provider=none +wsrep-cluster-address='gcomm://' +innodb_autoinc_lock_mode=2 diff --git a/mysql-test/suite/wsrep/t/MDEV-22443.test b/mysql-test/suite/wsrep/t/MDEV-22443.test new file mode 100644 index 00000000..674cb5ae --- /dev/null +++ b/mysql-test/suite/wsrep/t/MDEV-22443.test @@ -0,0 +1,12 @@ +# +# MDEV-22443: terminate called after throwing an instance of +# 'wsrep::runtime_error' in std::terminate on START TRANSACTION +# + +--source include/have_innodb.inc +--source include/have_wsrep.inc +--source include/have_binlog_format_row.inc + +SET SESSION wsrep_sync_wait=15; +SET SESSION wsrep_on=1; +START TRANSACTION READ WRITE; diff --git a/mysql-test/suite/wsrep/t/MDEV-23081.cnf b/mysql-test/suite/wsrep/t/MDEV-23081.cnf new file mode 100644 index 00000000..489c4385 --- /dev/null +++ b/mysql-test/suite/wsrep/t/MDEV-23081.cnf @@ -0,0 +1,9 @@ +!include ../my.cnf + +[mysqld.1] +wsrep-on=ON +binlog-format=ROW +innodb-flush-log-at-trx-commit=1 +wsrep-cluster-address=gcomm:// +wsrep-provider=@ENV.WSREP_PROVIDER +innodb-autoinc-lock-mode=2 diff --git a/mysql-test/suite/wsrep/t/MDEV-23081.combinations b/mysql-test/suite/wsrep/t/MDEV-23081.combinations new file mode 100644 index 00000000..1ce3b45a --- /dev/null +++ b/mysql-test/suite/wsrep/t/MDEV-23081.combinations @@ -0,0 +1,4 @@ +[binlogon] +log-bin + +[binlogoff] diff --git a/mysql-test/suite/wsrep/t/MDEV-23081.test b/mysql-test/suite/wsrep/t/MDEV-23081.test new file mode 100644 index 00000000..04305b22 --- /dev/null +++ b/mysql-test/suite/wsrep/t/MDEV-23081.test @@ -0,0 +1,57 @@ +# +# MDEV-23081: Stray XA transactions at startup +# if node restarts with wsrep_on=OFF +# +--source include/have_wsrep.inc +--source include/have_innodb.inc +--source include/have_wsrep_provider.inc +--source include/have_debug_sync.inc + +CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; + +# +# Execute two inserts on block those after becoming +# prepared, and before they are committed +# +--connect con1, localhost, root +SET DEBUG_SYNC = "wsrep_after_certification SIGNAL after_certification_reached WAIT_FOR continue_after_certification"; +SET DEBUG_SYNC = "wsrep_before_commit_order_enter SIGNAL before_commit_order_reached_1 WAIT_FOR continue_before_commit_order_1"; +--send INSERT INTO t1 VALUES (9) + +--connect con_ctrl, localhost, root +SET DEBUG_SYNC = "now WAIT_FOR after_certification_reached"; + +--connect con2, localhost, root +SET DEBUG_SYNC = "wsrep_before_commit_order_enter SIGNAL before_commit_order_reached_2 WAIT_FOR continue_before_commit_order_2"; +--send INSERT INTO t1 VALUES (10) + +--connection con_ctrl +SET DEBUG_SYNC = "now WAIT_FOR before_commit_order_reached_2"; +SET DEBUG_SYNC = "now SIGNAL continue_after_certification"; +SET DEBUG_SYNC = "now WAIT_FOR before_commit_order_reached_1"; + +# +# Kill the server +# +--connection default +--source include/kill_mysqld.inc + +# +# and restart it with wsrep-on=OFF +# +let $restart_noprint=2; +--let $restart_parameters=--wsrep-on=OFF +--source include/start_mysqld.inc + +# +# Expect no prepared XA transactions to be reported +# +XA RECOVER; + +--disconnect con1 +--disconnect con2 +--disconnect con_ctrl +--connection default + +DROP TABLE t1; +CALL mtr.add_suppression("You need to use --log-bin to make --binlog-format work"); diff --git a/mysql-test/suite/wsrep/t/MDEV-23092.cnf b/mysql-test/suite/wsrep/t/MDEV-23092.cnf new file mode 100644 index 00000000..851f2999 --- /dev/null +++ b/mysql-test/suite/wsrep/t/MDEV-23092.cnf @@ -0,0 +1,8 @@ +!include ../my.cnf + +[mysqld.1] +wsrep-on=OFF +binlog-format=ROW +wsrep-provider=none +wsrep-cluster-address='gcomm://' +innodb_autoinc_lock_mode=2 diff --git a/mysql-test/suite/wsrep/t/MDEV-23092.test b/mysql-test/suite/wsrep/t/MDEV-23092.test new file mode 100644 index 00000000..92a6e392 --- /dev/null +++ b/mysql-test/suite/wsrep/t/MDEV-23092.test @@ -0,0 +1,22 @@ +# +# MDEV-23092: SIGABRT in wsrep::server_state::provider when setting +# invalid wsrep_provider (on optimized builds) +# + +--source include/have_innodb.inc +--source include/have_wsrep.inc +--source include/have_binlog_format_row.inc + +SET COLLATION_CONNECTION='utf16le_bin'; +--error 1231 +SET GLOBAL wsrep_provider='/invalid/path/libgalera_smm.so'; +SET GLOBAL wsrep_cluster_address='OFF'; +SET GLOBAL wsrep_slave_threads=10; +SELECT 1; + +SET GLOBAL wsrep_cluster_address='gcomm://'; +SET GLOBAL wsrep_slave_threads=DEFAULT; + +CALL mtr.add_suppression("wsrep_load()"); +CALL mtr.add_suppression("Failed to create a new provider"); +CALL mtr.add_suppression("Failed to load provider"); diff --git a/mysql-test/suite/wsrep/t/MDEV-23466.cnf b/mysql-test/suite/wsrep/t/MDEV-23466.cnf new file mode 100644 index 00000000..851f2999 --- /dev/null +++ b/mysql-test/suite/wsrep/t/MDEV-23466.cnf @@ -0,0 +1,8 @@ +!include ../my.cnf + +[mysqld.1] +wsrep-on=OFF +binlog-format=ROW +wsrep-provider=none +wsrep-cluster-address='gcomm://' +innodb_autoinc_lock_mode=2 diff --git a/mysql-test/suite/wsrep/t/MDEV-23466.test b/mysql-test/suite/wsrep/t/MDEV-23466.test new file mode 100644 index 00000000..26152982 --- /dev/null +++ b/mysql-test/suite/wsrep/t/MDEV-23466.test @@ -0,0 +1,10 @@ +# +# MDEV-23466: SIGABRT in wsrep::server_state::provider on +# SELECT WSREP_LAST_SEEN_GTID() on optimized builds +# + +--source include/have_innodb.inc +--source include/have_wsrep.inc +--source include/have_binlog_format_row.inc + +SELECT WSREP_LAST_SEEN_GTID(); diff --git a/mysql-test/suite/wsrep/t/alter_table_innodb.cnf b/mysql-test/suite/wsrep/t/alter_table_innodb.cnf new file mode 100644 index 00000000..d8e27463 --- /dev/null +++ b/mysql-test/suite/wsrep/t/alter_table_innodb.cnf @@ -0,0 +1,12 @@ +!include include/default_mysqld.cnf + +[mysqld] +wsrep-on=0 + +[mysqld.1] +wsrep-on=0 +#galera_port=@OPT.port +#ist_port=@OPT.port +#sst_port=@OPT.port +wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M' +wsrep_cluster_address='not empty but invalid' diff --git a/mysql-test/suite/wsrep/t/alter_table_innodb.test b/mysql-test/suite/wsrep/t/alter_table_innodb.test new file mode 100644 index 00000000..ca06be02 --- /dev/null +++ b/mysql-test/suite/wsrep/t/alter_table_innodb.test @@ -0,0 +1,10 @@ +--source include/have_innodb.inc + +--echo # +--echo # MDEV-7374 : Losing connection to MySQL while running ALTER TABLE +--echo # +CREATE TABLE t1(i INT) ENGINE=INNODB; +INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8); +INSERT INTO t1 SELECT a.* FROM t1 a, t1 b, t1 c, t1 d, t1 e; +ALTER TABLE t1 MODIFY i FLOAT; +DROP TABLE t1; diff --git a/mysql-test/suite/wsrep/t/binlog_format.cnf b/mysql-test/suite/wsrep/t/binlog_format.cnf new file mode 100644 index 00000000..7ec24c14 --- /dev/null +++ b/mysql-test/suite/wsrep/t/binlog_format.cnf @@ -0,0 +1,8 @@ +!include ../my.cnf + +[mysqld.1] +wsrep-on=ON +wsrep-provider=@ENV.WSREP_PROVIDER +wsrep-cluster-address=gcomm:// +innodb_autoinc_lock_mode=2 + diff --git a/mysql-test/suite/wsrep/t/binlog_format.opt b/mysql-test/suite/wsrep/t/binlog_format.opt new file mode 100644 index 00000000..299096e5 --- /dev/null +++ b/mysql-test/suite/wsrep/t/binlog_format.opt @@ -0,0 +1 @@ +--wsrep-on=1 diff --git a/mysql-test/suite/wsrep/t/binlog_format.test b/mysql-test/suite/wsrep/t/binlog_format.test new file mode 100644 index 00000000..695859a2 --- /dev/null +++ b/mysql-test/suite/wsrep/t/binlog_format.test @@ -0,0 +1,48 @@ +--source include/have_innodb.inc +--source include/have_wsrep_provider.inc +--source include/have_binlog_format_row.inc + +call mtr.add_suppression("WSREP: MariaDB Galera does not support binlog format"); +call mtr.add_suppression("WSREP: Cannot get fake transaction ID from storage engine."); + +--echo # +--echo # MDEV-4227: Galera server should stop crashing on setting binlog_format STATEMENT +--echo # + +SHOW VARIABLES LIKE 'binlog_format'; +SET binlog_format=STATEMENT; +SHOW WARNINGS; +SHOW VARIABLES LIKE 'binlog_format'; +CREATE TABLE IF NOT EXISTS test.t1 AS SELECT * FROM information_schema.routines WHERE 1 = 0; +SET binlog_format=MIXED; +SHOW WARNINGS; +SHOW VARIABLES LIKE 'binlog_format'; +CREATE TABLE IF NOT EXISTS test.t2 AS SELECT * FROM information_schema.routines WHERE 1 = 0; +SET binlog_format=ROW; +SHOW WARNINGS; +SHOW VARIABLES LIKE 'binlog_format'; +CREATE TABLE IF NOT EXISTS test.t3 AS SELECT * FROM information_schema.routines WHERE 1 = 0; +DROP TABLE IF EXISTS test.t1; +DROP TABLE IF EXISTS test.t2; +DROP TABLE IF EXISTS test.t3; + +--echo # +--echo # MDEV-7322: Option to allow setting the binlog_format with Galera +--echo # + +-- error ER_WRONG_VALUE_FOR_VAR +SET @@GLOBAL.binlog_format=STATEMENT; +SHOW GLOBAL VARIABLES LIKE 'binlog_format'; + +-- error ER_WRONG_VALUE_FOR_VAR +SET @@GLOBAL.binlog_format=MIXED; +SHOW GLOBAL VARIABLES LIKE 'binlog_format'; + +-- error ER_WRONG_VALUE_FOR_VAR +SET @@GLOBAL.binlog_format=DEFAULT; +SHOW GLOBAL VARIABLES LIKE 'binlog_format'; + +SET @@GLOBAL.binlog_format=ROW; +SHOW GLOBAL VARIABLES LIKE 'binlog_format'; + +--echo # End of test. diff --git a/mysql-test/suite/wsrep/t/foreign_key.opt b/mysql-test/suite/wsrep/t/foreign_key.opt new file mode 100644 index 00000000..e3f2470c --- /dev/null +++ b/mysql-test/suite/wsrep/t/foreign_key.opt @@ -0,0 +1 @@ +--innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// diff --git a/mysql-test/suite/wsrep/t/foreign_key.test b/mysql-test/suite/wsrep/t/foreign_key.test new file mode 100644 index 00000000..71f6076a --- /dev/null +++ b/mysql-test/suite/wsrep/t/foreign_key.test @@ -0,0 +1,20 @@ +--source include/have_wsrep_enabled.inc +--source include/have_binlog_format_row.inc +--source include/have_innodb.inc + +USE test; +create table p(v varchar(20), i int, primary key(v,i)) engine=innodb character set = utf8; +create table c(k int primary key, v varchar(20), i int, foreign key(v,i) references p(v,i)) engine=innodb character set = utf8; +insert into p values (_utf32 0x000004100000041100000412, 1); +insert into c values (1, _utf32 0x000004100000041100000412, 1); + +SELECT * FROM test.p; +SELECT * FROM test.c; + +SELECT * FROM test.p; +SELECT * FROM test.c; + +# Cleanup +DROP TABLE c; +DROP TABLE p; + diff --git a/mysql-test/suite/wsrep/t/mdev_10186.cnf b/mysql-test/suite/wsrep/t/mdev_10186.cnf new file mode 100644 index 00000000..284c8876 --- /dev/null +++ b/mysql-test/suite/wsrep/t/mdev_10186.cnf @@ -0,0 +1,15 @@ +!include include/default_mysqld.cnf + +[mysqld] +wsrep-on=0 + +[mysqld.1] +wsrep-on=0 +#galera_port=@OPT.port +#ist_port=@OPT.port +#sst_port=@OPT.port +wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M' +wsrep_cluster_address='not empty but invalid' +innodb_autoinc_lock_mode=2 +wsrep-provider=$WSREP_PROVIDER +wsrep-cluster-address=gcomm:// diff --git a/mysql-test/suite/wsrep/t/mdev_10186.test b/mysql-test/suite/wsrep/t/mdev_10186.test new file mode 100644 index 00000000..0f0aa287 --- /dev/null +++ b/mysql-test/suite/wsrep/t/mdev_10186.test @@ -0,0 +1,12 @@ +--source include/have_innodb.inc +--source include/have_wsrep_provider.inc +--source include/have_binlog_format_row.inc + +--echo # +--echo # MDEV-10186: mysqld crash when runtime setting +--echo # wsrep_cluster_address without wsrep_on=ON +--echo # + +SELECT @@wsrep_on; +SET @@GLOBAL.wsrep_cluster_address='gcomm://'; + diff --git a/mysql-test/suite/wsrep/t/mdev_22681.cnf b/mysql-test/suite/wsrep/t/mdev_22681.cnf new file mode 100644 index 00000000..2f310476 --- /dev/null +++ b/mysql-test/suite/wsrep/t/mdev_22681.cnf @@ -0,0 +1,10 @@ +!include ../my.cnf + +[mysqld.1] +wsrep-on=ON +log-bin +binlog-format=ROW +innodb-flush-log-at-trx-commit=1 +wsrep-cluster-address=gcomm:// +wsrep-provider=@ENV.WSREP_PROVIDER +innodb-autoinc-lock-mode=2 diff --git a/mysql-test/suite/wsrep/t/mdev_22681.test b/mysql-test/suite/wsrep/t/mdev_22681.test new file mode 100644 index 00000000..ce1129c7 --- /dev/null +++ b/mysql-test/suite/wsrep/t/mdev_22681.test @@ -0,0 +1,15 @@ +# +# MDEV-22681: Server crashes in galera::ReplicatorSMM::CommitOrder::CommitOrder +# or assertion failed in wsrep::transaction::before_prepare. +# +# EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t1 ENGINE=InnoDB AS SELECT 1 AS b' +# crashes the server if binlog is on (see mdev_22681.cnf for configuration). +# +--source include/have_wsrep.inc +--source include/have_wsrep_provider.inc +--source include/have_innodb.inc + +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t1 ENGINE=InnoDB AS SELECT 1 AS b'; + +DROP TABLE t1; diff --git a/mysql-test/suite/wsrep/t/mdev_6832.cnf b/mysql-test/suite/wsrep/t/mdev_6832.cnf new file mode 100644 index 00000000..0bf01f81 --- /dev/null +++ b/mysql-test/suite/wsrep/t/mdev_6832.cnf @@ -0,0 +1,7 @@ +!include ../my.cnf + +[mysqld.1] +wsrep-on=ON +wsrep-provider=@ENV.WSREP_PROVIDER +wsrep-cluster-address=gcomm:// + diff --git a/mysql-test/suite/wsrep/t/mdev_6832.test b/mysql-test/suite/wsrep/t/mdev_6832.test new file mode 100644 index 00000000..d5303ce3 --- /dev/null +++ b/mysql-test/suite/wsrep/t/mdev_6832.test @@ -0,0 +1,17 @@ +--source include/have_innodb.inc +--source include/have_wsrep_provider.inc +--source include/have_binlog_format_row.inc + +--echo # +--echo # MDEV-6832: ER_LOCK_WAIT_TIMEOUT on SHOW STATUS +--echo # + +SHOW STATUS LIKE 'wsrep_ready'; +--disable_query_log +eval SET @@global.wsrep_provider='$WSREP_PROVIDER'; +--enable_query_log +SHOW STATUS LIKE 'wsrep_ready'; +SET @@global.wsrep_cluster_address='gcomm://'; +--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; +--source include/wait_condition.inc +--echo # End of test. diff --git a/mysql-test/suite/wsrep/t/mdev_7798.cnf b/mysql-test/suite/wsrep/t/mdev_7798.cnf new file mode 100644 index 00000000..0bf01f81 --- /dev/null +++ b/mysql-test/suite/wsrep/t/mdev_7798.cnf @@ -0,0 +1,7 @@ +!include ../my.cnf + +[mysqld.1] +wsrep-on=ON +wsrep-provider=@ENV.WSREP_PROVIDER +wsrep-cluster-address=gcomm:// + diff --git a/mysql-test/suite/wsrep/t/mdev_7798.test b/mysql-test/suite/wsrep/t/mdev_7798.test new file mode 100644 index 00000000..b9938d93 --- /dev/null +++ b/mysql-test/suite/wsrep/t/mdev_7798.test @@ -0,0 +1,18 @@ +--source include/have_innodb.inc +--source include/have_wsrep_provider.inc +--source include/have_binlog_format_row.inc + +--echo # +--echo # MDEV-7798: mysql.server init script can't stop mysqld when WSREP is +--echo # turned off +--echo # + +SELECT @@GLOBAL.WSREP_ON; +SET GLOBAL WSREP_ON= 0; + +--echo Restart the node. +--source include/restart_mysqld.inc + +SELECT @@GLOBAL.WSREP_ON; + +--echo # End of test. diff --git a/mysql-test/suite/wsrep/t/plugin.opt b/mysql-test/suite/wsrep/t/plugin.opt new file mode 100644 index 00000000..f043a4a2 --- /dev/null +++ b/mysql-test/suite/wsrep/t/plugin.opt @@ -0,0 +1 @@ +--binlog_format=ROW --log-bin --wsrep-on=1 --innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// diff --git a/mysql-test/suite/wsrep/t/plugin.test b/mysql-test/suite/wsrep/t/plugin.test new file mode 100644 index 00000000..73d605b0 --- /dev/null +++ b/mysql-test/suite/wsrep/t/plugin.test @@ -0,0 +1,8 @@ +--source include/have_wsrep.inc +--source include/have_innodb.inc + +# +# MDEV-7604: wsrep plugin lists its status as Unknown +# + +SELECT plugin_name,plugin_version,plugin_maturity FROM information_schema.plugins where plugin_name like 'wsrep' ORDER BY plugin_maturity,plugin_name; \ No newline at end of file diff --git a/mysql-test/suite/wsrep/t/pool_of_threads.opt b/mysql-test/suite/wsrep/t/pool_of_threads.opt new file mode 100644 index 00000000..e75bba66 --- /dev/null +++ b/mysql-test/suite/wsrep/t/pool_of_threads.opt @@ -0,0 +1 @@ +--innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --thread_handling=pool-of-threads --wsrep-on=1 diff --git a/mysql-test/suite/wsrep/t/pool_of_threads.test b/mysql-test/suite/wsrep/t/pool_of_threads.test new file mode 100644 index 00000000..8e95d0ca --- /dev/null +++ b/mysql-test/suite/wsrep/t/pool_of_threads.test @@ -0,0 +1,12 @@ +--source include/have_wsrep_enabled.inc +--source include/have_binlog_format_row.inc + +--echo +--echo # +--echo # MDEV#5687: Maria doesn't shutdown following upgrade to 5.5.35-galera +--echo # + +# Note: This test is to ensure that server shuts down properly. +SELECT @@GLOBAL.thread_handling; + +--echo # End of test. diff --git a/mysql-test/suite/wsrep/t/trans.opt b/mysql-test/suite/wsrep/t/trans.opt new file mode 100644 index 00000000..a8b72174 --- /dev/null +++ b/mysql-test/suite/wsrep/t/trans.opt @@ -0,0 +1 @@ +--wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep_on=1 --binlog_format=ROW diff --git a/mysql-test/suite/wsrep/t/trans.test b/mysql-test/suite/wsrep/t/trans.test new file mode 100644 index 00000000..d8c4a472 --- /dev/null +++ b/mysql-test/suite/wsrep/t/trans.test @@ -0,0 +1,14 @@ +--source include/have_wsrep.inc +--source include/have_innodb.inc + +--echo # +--echo # MDEV-4222 : Assertion `( ((global_system_variables.wsrep_on) && +--echo # (thd && thd->variables.wsrep_on)) && srep_emulate_bin_log) +--echo # || mysql_bin_log .is_open()' fails on SAVEPOINT with +--echo # disabled wsrep_provider +--echo # + +START TRANSACTION WITH CONSISTENT SNAPSHOT; +SAVEPOINT A; + +--echo End of test. diff --git a/mysql-test/suite/wsrep/t/variables.cnf b/mysql-test/suite/wsrep/t/variables.cnf new file mode 100644 index 00000000..b1c96d26 --- /dev/null +++ b/mysql-test/suite/wsrep/t/variables.cnf @@ -0,0 +1,7 @@ +!include ../my.cnf + +[mysqld.1] +wsrep-on=ON +wsrep-cluster-address=gcomm:// +wsrep-provider=@ENV.WSREP_PROVIDER +binlog-format=ROW diff --git a/mysql-test/suite/wsrep/t/variables.test b/mysql-test/suite/wsrep/t/variables.test new file mode 100644 index 00000000..c28638e7 --- /dev/null +++ b/mysql-test/suite/wsrep/t/variables.test @@ -0,0 +1,26 @@ +--source include/have_wsrep.inc +--source include/force_restart.inc +--source include/have_innodb.inc +--source include/galera_no_debug_sync.inc + +--let $galera_version=26.4.11 +source include/check_galera_version.inc; + +source include/galera_variables_ok.inc; + +--replace_column 2 # +SHOW GLOBAL STATUS LIKE 'wsrep%'; + +--echo # Should show nothing. +SHOW STATUS LIKE 'x'; + +SELECT @@global.wsrep_cluster_address; +SELECT @@global.wsrep_on; + +SHOW STATUS LIKE 'threads_connected'; +SHOW STATUS LIKE 'wsrep_thread_count'; + +--echo # variables + +SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep%" ORDER BY VARIABLE_NAME; + diff --git a/mysql-test/suite/wsrep/t/variables_debug.cnf b/mysql-test/suite/wsrep/t/variables_debug.cnf new file mode 100644 index 00000000..b1c96d26 --- /dev/null +++ b/mysql-test/suite/wsrep/t/variables_debug.cnf @@ -0,0 +1,7 @@ +!include ../my.cnf + +[mysqld.1] +wsrep-on=ON +wsrep-cluster-address=gcomm:// +wsrep-provider=@ENV.WSREP_PROVIDER +binlog-format=ROW diff --git a/mysql-test/suite/wsrep/t/variables_debug.test b/mysql-test/suite/wsrep/t/variables_debug.test new file mode 100644 index 00000000..5e90d61c --- /dev/null +++ b/mysql-test/suite/wsrep/t/variables_debug.test @@ -0,0 +1,28 @@ +--source include/have_wsrep.inc +--source include/force_restart.inc +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc +--source include/galera_have_debug_sync.inc + +--let $galera_version=26.4.11 +source include/check_galera_version.inc; + +source include/galera_variables_ok.inc; + +--replace_column 2 # +SHOW GLOBAL STATUS LIKE 'wsrep%'; + +--echo # Should show nothing. +SHOW STATUS LIKE 'x'; + +SELECT @@global.wsrep_cluster_address; +SELECT @@global.wsrep_on; + +SHOW STATUS LIKE 'threads_connected'; +SHOW STATUS LIKE 'wsrep_thread_count'; + +--echo # variables + +SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep%" ORDER BY VARIABLE_NAME; + diff --git a/mysql-test/suite/wsrep/t/wsrep-recover-step.inc b/mysql-test/suite/wsrep/t/wsrep-recover-step.inc new file mode 100644 index 00000000..22669438 --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep-recover-step.inc @@ -0,0 +1,41 @@ +# +# Macro to run wsrep recovery step. This is adapted from +# suite/galera/include/galera_wsrep_recover.inc, with additional +# option to pass binlog argument to recovery command. The macro +# returns recovered position split in uuid and seqno parts. +# +# Arguments: +# +# wsrep_recover_binlog_opt - Binlog options to recovery command +# +# Return: +# +# wsrep_recover_start_position_uuid - UUID corresponding to recovered position +# wsrep_recover_start_position_seqno - seqno corresponding to recovered position +# + +--exec $MYSQLD --defaults-group-suffix=.1 --defaults-file=$MYSQLTEST_VARDIR/my.cnf --log-error=$MYSQL_TMP_DIR/galera_wsrep_recover.log --innodb --wsrep-recover $wsrep_recover_binlog_opt --core-file > $MYSQL_TMP_DIR/galera_wsrep_recover.log 2>&1 + +--perl + use strict; + my $wsrep_start_position = `grep 'WSREP: Recovered position:' $ENV{MYSQL_TMP_DIR}/galera_wsrep_recover.log | sed 's/.*WSREP\:\ Recovered\ position://' | sed 's/^[ \t]*//'`; + chomp($wsrep_start_position); + die if $wsrep_start_position eq ''; + open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/galera_wsrep_start_position.inc") or die; + my ($uuid, $seqno) = split /:/, $wsrep_start_position; + print FILE "--let \$wsrep_recover_start_position_uuid = $uuid\n"; + print FILE "--let \$wsrep_recover_start_position_seqno = $seqno\n"; + close FILE; +EOF + +--source $MYSQL_TMP_DIR/galera_wsrep_start_position.inc + +if ($wsrep_recover_start_position_uuid == '') { + --die "Could not obtain start_position_uuid." +} + +if ($wsrep_recover_start_position_seqno == '') { + --die "Could not obtain start_position_seqno." +} + +--remove_file $MYSQL_TMP_DIR/galera_wsrep_start_position.inc diff --git a/mysql-test/suite/wsrep/t/wsrep-recover-v25.cnf b/mysql-test/suite/wsrep/t/wsrep-recover-v25.cnf new file mode 100644 index 00000000..b1c96d26 --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep-recover-v25.cnf @@ -0,0 +1,7 @@ +!include ../my.cnf + +[mysqld.1] +wsrep-on=ON +wsrep-cluster-address=gcomm:// +wsrep-provider=@ENV.WSREP_PROVIDER +binlog-format=ROW diff --git a/mysql-test/suite/wsrep/t/wsrep-recover-v25.combinations b/mysql-test/suite/wsrep/t/wsrep-recover-v25.combinations new file mode 100644 index 00000000..1ce3b45a --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep-recover-v25.combinations @@ -0,0 +1,4 @@ +[binlogon] +log-bin + +[binlogoff] diff --git a/mysql-test/suite/wsrep/t/wsrep-recover-v25.test b/mysql-test/suite/wsrep/t/wsrep-recover-v25.test new file mode 100644 index 00000000..743e2795 --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep-recover-v25.test @@ -0,0 +1,119 @@ +# +# Verify that the wsrep XID gets updated in InnoDB rollback segment +# properly and can be recovered with --wsrep-recover +# +# The test runs the following scenarios: +# +# 1) The server is started but no SQL is run +# 2) DDL is executed +# 3) INSERT is executed +# 4) Two INSERTs are executed so that the first one in order will be +# blocked after certification and the second one before entering +# commit order critical section. +# 5) Two DMLs are executed so that the prepare step is run out of order. +# Both transactions are blocked before commit order critical section. +# +# After each scenario server is killed and the recovered position +# is validated. +# + +--source include/have_wsrep.inc +--source include/have_innodb.inc +--source include/have_wsrep_provider.inc +--source include/have_debug_sync.inc + +# +# Binlog option for recovery run. This must be set in the test because +# combinations file causes log-bin option to be set from command line, +# not via my.cnf. +# +--let $log_bin = `SELECT @@log_bin` +if ($log_bin) { +--let $wsrep_recover_binlog_opt = --log-bin +} + +# +# Scenario 1 +# The expected recovered seqno is 1 corresponding to initial cluster +# configuration change. +# +let $restart_noprint=2; + +--source include/kill_mysqld.inc +--source wsrep-recover-step.inc +--echo Expect seqno 1 +--echo $wsrep_recover_start_position_seqno + +--let $restart_parameters = --wsrep-start-position=$wsrep_recover_start_position_uuid:$wsrep_recover_start_position_seqno +--source include/start_mysqld.inc +--source include/wait_wsrep_ready.inc + +# +# Senario 2 +# The expected recovered seqno is 3 corresponding to two configuration +# changes and CREATE TABLE +# + +CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; +let $restart_noprint=2; +--source include/kill_mysqld.inc +--source wsrep-recover-step.inc +--echo Expect seqno 3 +--echo $wsrep_recover_start_position_seqno + +--let $restart_parameters = --wsrep-start-position=$wsrep_recover_start_position_uuid:$wsrep_recover_start_position_seqno +--source include/start_mysqld.inc +--source include/wait_wsrep_ready.inc + +# +# Scenario 3 +# The expected recovered seqno is 5 corresponding to three configuration +# changes, CREATE TABLE and INSERT. +# +# The expected wsrep_last_committed after the server is restarted is 6. +# + +INSERT INTO t1 VALUES (5); +let $restart_noprint=2; +--source include/kill_mysqld.inc +--source wsrep-recover-step.inc +--echo Expect seqno 5 +--echo $wsrep_recover_start_position_seqno +--let $restart_parameters = --wsrep-start-position=$wsrep_recover_start_position_uuid:$wsrep_recover_start_position_seqno +--source include/start_mysqld.inc +--source include/wait_wsrep_ready.inc + +SELECT VARIABLE_VALUE `expect 6` FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'; + +# +# Scenario 4 +# +# The INSERT gets prepared but not committed. +# +# This scenario is not applicable if binlog is not on since the +# commit is not 2PC. +# +# If binlog is on, the INSERT +# should be rolled back during recovery phase since it has not yet +# been logged into binlog. +# +if ($log_bin) { + --connect con1, localhost, root + SET DEBUG_SYNC = "ha_commit_trans_after_prepare SIGNAL after_prepare_reached WAIT_FOR continue"; + --send INSERT INTO t1 VALUES (7) + + --connection default + let $restart_noprint=2; + SET DEBUG_SYNC = "now WAIT_FOR after_prepare_reached"; + --source include/kill_mysqld.inc + --source wsrep-recover-step.inc + --echo Expect seqno 6 + --echo $wsrep_recover_start_position_seqno + --let $restart_parameters = --wsrep-start-position=$wsrep_recover_start_position_uuid:$wsrep_recover_start_position_seqno + --source include/start_mysqld.inc + --source include/wait_wsrep_ready.inc + --echo Expect 5 + SELECT * FROM t1; +} + +DROP TABLE t1; diff --git a/mysql-test/suite/wsrep/t/wsrep-recover.cnf b/mysql-test/suite/wsrep/t/wsrep-recover.cnf new file mode 100644 index 00000000..19986cd9 --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep-recover.cnf @@ -0,0 +1,9 @@ +!include ../my.cnf + +[mysqld.1] +wsrep-on=ON +binlog-format=ROW +innodb-flush-log-at-trx-commit=1 +wsrep-cluster-address=gcomm:// +wsrep-provider=@ENV.WSREP_PROVIDER +innodb-autoinc-lock-mode=2 \ No newline at end of file diff --git a/mysql-test/suite/wsrep/t/wsrep-recover.combinations b/mysql-test/suite/wsrep/t/wsrep-recover.combinations new file mode 100644 index 00000000..1ce3b45a --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep-recover.combinations @@ -0,0 +1,4 @@ +[binlogon] +log-bin + +[binlogoff] diff --git a/mysql-test/suite/wsrep/t/wsrep-recover.test b/mysql-test/suite/wsrep/t/wsrep-recover.test new file mode 100644 index 00000000..75271e45 --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep-recover.test @@ -0,0 +1,194 @@ +# +# Verify that the wsrep XID gets updated in InnoDB rollback segment +# properly and can be recovered with --wsrep-recover +# +# The test runs the following scenarios: +# +# 1) The server is started but no SQL is run +# 2) DDL is executed +# 3) INSERT is executed +# 4) Two INSERTs are executed so that the first one in order will be +# blocked after certification and the second one before entering +# commit order critical section. +# 5) Two DMLs are executed so that the prepare step is run out of order. +# Both transactions are blocked before commit order critical section. +# +# After each scenario server is killed and the recovered position +# is validated. +# + +--source include/have_wsrep.inc +--source include/have_innodb.inc +--source include/have_wsrep_provider.inc +--source include/have_debug_sync.inc + +# Binlog option for recovery run. This must be set in the test because +# combinations file causes log-bin option to be set from command line, +# not via my.cnf. +# +--let $log_bin = `SELECT @@log_bin` +if ($log_bin) { +--let $wsrep_recover_binlog_opt = --log-bin +} + +# +# Scenario 1 +# The expected recovered seqno is 1 corresponding to initial cluster +# configuration change. +# +let $restart_noprint=2; +--source include/kill_mysqld.inc +--source wsrep-recover-step.inc +--echo Expect seqno 1 +--echo $wsrep_recover_start_position_seqno + +--let $restart_parameters = --wsrep-start-position=$wsrep_recover_start_position_uuid:$wsrep_recover_start_position_seqno +--source include/start_mysqld.inc +--source include/wait_wsrep_ready.inc + +# +# Senario 2 +# The expected recovered seqno is 3 corresponding to two configuration +# change events and CREATE TABLE. +# +let $restart_noprint=2; + +CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; +--source include/kill_mysqld.inc +--source wsrep-recover-step.inc +--echo Expect seqno 3 +--echo $wsrep_recover_start_position_seqno + +--let $restart_parameters = --wsrep-start-position=$wsrep_recover_start_position_uuid:$wsrep_recover_start_position_seqno +--source include/start_mysqld.inc +--source include/wait_wsrep_ready.inc + +# +# Scenario 3 +# The expected recovered seqno is 5 corresponding to three configuration +# change events, CREATE TABLE and INSERT. +# +# The expected wsrep_last_committed after the server is restarted is 6. +# +let $restart_noprint=2; + +INSERT INTO t1 VALUES (5); +--source include/kill_mysqld.inc +--source wsrep-recover-step.inc +--echo Expect seqno 5 +--echo $wsrep_recover_start_position_seqno +--let $restart_parameters = --wsrep-start-position=$wsrep_recover_start_position_uuid:$wsrep_recover_start_position_seqno +--source include/start_mysqld.inc +--source include/wait_wsrep_ready.inc + +SELECT VARIABLE_VALUE `expect 6` FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'; + +# +# Scenario 4 +# +# This will cause the following +# +# Seqno 7 - the first INSERT is blocked after it is certified but before +# it gets prepared +# Seqno 8 - the second INSERT is blocked before it will be ordered for +# commit, so it becomes prepared +# +# As an outcome, the recovery process should return seqno 6 because +# the range of prepared transactions found after the crash recovery +# is not continuous up to 8. +# +# The expected wsrep_last_committed after server is restarted is 7. +# + +# Send INSERT which will block after certification +--connect con1, localhost, root +SET DEBUG_SYNC = "wsrep_after_certification SIGNAL after_certification_reached WAIT_FOR continue"; +--send INSERT INTO t1 VALUES (7) + +--connect con_ctrl, localhost, root +SET DEBUG_SYNC = "now WAIT_FOR after_certification_reached"; + +# Send INSERT which will block before commit order critical section +--connect con2, localhost, root +SET DEBUG_SYNC = "wsrep_before_commit_order_enter SIGNAL before_commit_order_reached WAIT_FOR continue"; +--send INSERT INTO t1 VALUES (8) + +--connection con_ctrl +SET DEBUG_SYNC = "now WAIT_FOR before_commit_order_reached"; + +--connection default +let $restart_noprint=2; +--source include/kill_mysqld.inc +--source wsrep-recover-step.inc +--echo Expect seqno 6 +--echo $wsrep_recover_start_position_seqno +--let $restart_parameters = --wsrep-start-position=$wsrep_recover_start_position_uuid:$wsrep_recover_start_position_seqno +--source include/start_mysqld.inc +--source include/wait_wsrep_ready.inc + +--disconnect con1 +--disconnect con2 +--disconnect con_ctrl +--connection default + +SELECT VARIABLE_VALUE `expect 7` FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'; + +# +# Scenario 5 +# +# This scenario will run two INSERTs in parallel so that they are +# prepared out of order. The execution is stopped before commit +# and the server is killed. +# +# The transactions will be recovered from InnoDB but +# will be rolled back: +# - If binlog is on, the binlog acts as a transaction coordinator. +# The transaction is not logged into binlog, so the transaction is rolled +# back. +# - If binlog is not on, the transaction is 1PC and the wsrep XID +# is not persisted before commit is complete. +# + +--connect con1, localhost, root +SET DEBUG_SYNC = "wsrep_after_certification SIGNAL after_certification_reached WAIT_FOR continue_after_certification"; +SET DEBUG_SYNC = "wsrep_before_commit_order_enter SIGNAL before_commit_order_reached_1 WAIT_FOR continue_before_commit_order_1"; +--send INSERT INTO t1 VALUES (9) + +--connect con_ctrl, localhost, root +SET DEBUG_SYNC = "now WAIT_FOR after_certification_reached"; + +--connect con2, localhost, root +SET DEBUG_SYNC = "wsrep_before_commit_order_enter SIGNAL before_commit_order_reached_2 WAIT_FOR continue_before_commit_order_2"; +--send INSERT INTO t1 VALUES (10) + +--connection con_ctrl +SET DEBUG_SYNC = "now WAIT_FOR before_commit_order_reached_2"; +SET DEBUG_SYNC = "now SIGNAL continue_after_certification"; +SET DEBUG_SYNC = "now WAIT_FOR before_commit_order_reached_1"; + +--connection default +let $restart_noprint=2; +--source include/kill_mysqld.inc +--source wsrep-recover-step.inc +--echo Expect seqno 7 + +--echo $wsrep_recover_start_position_seqno +--let $restart_parameters = --wsrep-start-position=$wsrep_recover_start_position_uuid:$wsrep_recover_start_position_seqno +--source include/start_mysqld.inc +--source include/wait_wsrep_ready.inc + +--disconnect con1 +--disconnect con2 +--disconnect con_ctrl +--connection default + + +SELECT VARIABLE_VALUE `expect 8` FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'; + +# +# Final sanity check: The successful inserts into t1 should result single row +# +--echo Expect row 5 +SELECT * FROM t1; + +DROP TABLE t1; diff --git a/mysql-test/suite/wsrep/t/wsrep_on_basic.opt b/mysql-test/suite/wsrep/t/wsrep_on_basic.opt new file mode 100644 index 00000000..9da4dd32 --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep_on_basic.opt @@ -0,0 +1 @@ +--wsrep-provider=$WSREP_PROVIDER --binlog_format=ROW --wsrep-cluster-address=gcomm:// diff --git a/mysql-test/suite/wsrep/t/wsrep_on_basic.test b/mysql-test/suite/wsrep/t/wsrep_on_basic.test new file mode 100644 index 00000000..98062dbe --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep_on_basic.test @@ -0,0 +1,47 @@ +--source include/have_wsrep.inc +--source include/have_wsrep_provider.inc +--source include/have_innodb.inc + +--echo # +--echo # wsrep_on +--echo # + +--echo # save the initial values +SET @wsrep_on_global_saved = @@global.wsrep_on; +SET @wsrep_on_session_saved = @@session.wsrep_on; + +--echo # default +SELECT @@global.wsrep_on; +SELECT @@session.wsrep_on; + +--echo +--echo # scope and valid values +SET @@global.wsrep_on=OFF; +SELECT @@global.wsrep_on; +SET @@global.wsrep_on=ON; +SELECT @@global.wsrep_on; + +SET @@session.wsrep_on=OFF; +SELECT @@session.wsrep_on; +SET @@session.wsrep_on=ON; +SELECT @@session.wsrep_on; +SET @@session.wsrep_on=default; +SELECT @@session.wsrep_on; + +--echo +--echo # invalid values +--error ER_WRONG_VALUE_FOR_VAR +SET @@global.wsrep_on=NULL; +--error ER_WRONG_VALUE_FOR_VAR +SET @@global.wsrep_on='junk'; +--error ER_WRONG_VALUE_FOR_VAR +SET @@session.wsrep_on=NULL; +--error ER_WRONG_VALUE_FOR_VAR +SET @@session.wsrep_on='junk'; + +--echo +--echo # restore the initial values +SET @@global.wsrep_on = @wsrep_on_global_saved; +SET @@session.wsrep_on = @wsrep_on_session_saved; + +--echo # End of test diff --git a/mysql-test/suite/wsrep/t/wsrep_rpl.cnf b/mysql-test/suite/wsrep/t/wsrep_rpl.cnf new file mode 100644 index 00000000..56e874f2 --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep_rpl.cnf @@ -0,0 +1 @@ +!include ../../rpl/my.cnf diff --git a/mysql-test/suite/wsrep/t/wsrep_rpl.test b/mysql-test/suite/wsrep/t/wsrep_rpl.test new file mode 100644 index 00000000..4f34aadc --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep_rpl.test @@ -0,0 +1,44 @@ +--source include/have_wsrep.inc +--source include/have_innodb.inc +--source include/master-slave.inc + +--echo # +--echo # MDEV-10714: Could not execute Delete_rows event on table; +--echo # wsrep_max_ws_rows exceeded. Error_Code 1180 +--echo # +# Save wsrep_max_ws_rows on master and slave. +connection master; +let $wsrep_max_ws_rows_master = `SELECT @@GLOBAL.wsrep_max_ws_rows`; +connection slave; +let $wsrep_max_ws_rows_slave = `SELECT @@GLOBAL.wsrep_max_ws_rows`; + +connection master; +CREATE TABLE t1(i INT) ENGINE = INNODB; + +SET @@GLOBAL.wsrep_max_ws_rows = 2; +INSERT INTO t1 VALUES(1), (2); +sync_slave_with_master; +SELECT COUNT(*) = 2 FROM t1; + +connection slave; +SET @@GLOBAL.wsrep_max_ws_rows = 2; + +connection master; +DELETE FROM t1; + +sync_slave_with_master; +SELECT COUNT(*) = 0 FROM t1; + +connection master; +DROP TABLE t1; + +sync_slave_with_master; +# Restore wsrep_max_ws_rows on master and slave +connection master; +eval SET @@GLOBAL.wsrep_max_ws_rows = $wsrep_max_ws_rows_master; +connection slave; +eval SET @@GLOBAL.wsrep_max_ws_rows = $wsrep_max_ws_rows_slave; + +--source include/rpl_end.inc +--echo # End of test. + diff --git a/mysql-test/suite/wsrep/t/wsrep_variables_no_provider.cnf b/mysql-test/suite/wsrep/t/wsrep_variables_no_provider.cnf new file mode 100644 index 00000000..b73146d2 --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep_variables_no_provider.cnf @@ -0,0 +1,12 @@ +# Use default setting for mysqld processes +!include include/default_mysqld.cnf + +[mysqld.1] +wsrep-on=ON +binlog-format=ROW +wsrep-provider=@ENV.WSREP_PROVIDER +wsrep-cluster-address='gcomm://' +#galera_port=@OPT.port +#ist_port=@OPT.port +#sst_port=@OPT.port + diff --git a/mysql-test/suite/wsrep/t/wsrep_variables_no_provider.test b/mysql-test/suite/wsrep/t/wsrep_variables_no_provider.test new file mode 100644 index 00000000..b44c9c5e --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep_variables_no_provider.test @@ -0,0 +1,38 @@ +--source include/have_wsrep.inc +--source include/have_innodb.inc + +SELECT @@wsrep_on; + +SET @wsrep_slave_threads_global_saved = @@global.wsrep_slave_threads; +SET @wsrep_debug_saved = @@global.wsrep_debug; +SET @wsrep_provider_options_saved= @@global.wsrep_provider_options; +SET @wsrep_cluster_address_saved= @@global.wsrep_cluster_address; + +SET GLOBAL wsrep_provider=none; + +--error ER_WRONG_ARGUMENTS +SET SESSION wsrep_trx_fragment_size=DEFAULT; +SELECT @@session.wsrep_trx_fragment_size; +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL wsrep_start_position='12345678-1234-1234-1234-123456789012:100'; +SHOW WARNINGS; +SELECT @@global.wsrep_start_position; +SET GLOBAL wsrep_debug=1; +SELECT @@global.wsrep_debug; +SET GLOBAL wsrep_slave_threads=5; +SELECT @@global.wsrep_slave_threads; +--error ER_WRONG_ARGUMENTS +SET GLOBAL wsrep_desync=1; +SELECT @@global.wsrep_desync; +--error ER_WRONG_ARGUMENTS +SET SESSION wsrep_trx_fragment_unit='rows'; +SELECT @@session.wsrep_trx_fragment_unit; + +--disable_query_log +eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; +SET GLOBAL wsrep_cluster_address= @wsrep_cluster_address_saved; +SET GLOBAL wsrep_provider_options= @wsrep_provider_options_saved; +--source include/galera_wait_ready.inc +SET @@global.wsrep_slave_threads = @wsrep_slave_threads_global_saved; +SET @@global.wsrep_debug = @wsrep_debug_saved; +--enable_query_log diff --git a/mysql-test/suite/wsrep/t/wsrep_variables_sst_method.cnf b/mysql-test/suite/wsrep/t/wsrep_variables_sst_method.cnf new file mode 100644 index 00000000..b1c96d26 --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep_variables_sst_method.cnf @@ -0,0 +1,7 @@ +!include ../my.cnf + +[mysqld.1] +wsrep-on=ON +wsrep-cluster-address=gcomm:// +wsrep-provider=@ENV.WSREP_PROVIDER +binlog-format=ROW diff --git a/mysql-test/suite/wsrep/t/wsrep_variables_sst_method.test b/mysql-test/suite/wsrep/t/wsrep_variables_sst_method.test new file mode 100644 index 00000000..b4171879 --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep_variables_sst_method.test @@ -0,0 +1,50 @@ +--source include/have_wsrep.inc +--source include/have_innodb.inc + +SELECT @@wsrep_on; + +SET @wsrep_sst_method_saved = @@global.wsrep_sst_method; + +/* test currently supported methods */ +SET GLOBAL wsrep_sst_method=DEFAULT; +SELECT @@global.wsrep_sst_method; + +SET GLOBAL wsrep_sst_method='rsync'; +SELECT @@global.wsrep_sst_method; + +SET GLOBAL wsrep_sst_method='mysqldump'; +SELECT @@global.wsrep_sst_method; + +SET GLOBAL wsrep_sst_method='mariabackup'; +SELECT @@global.wsrep_sst_method; + +SET GLOBAL wsrep_sst_method='backup'; +SELECT @@global.wsrep_sst_method; + +SET GLOBAL wsrep_sst_method='backup1.sh'; +SELECT @@global.wsrep_sst_method; + +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL wsrep_sst_method='my method'; +SELECT @@global.wsrep_sst_method; +SHOW WARNINGS; + +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL wsrep_sst_method='/method'; +SELECT @@global.wsrep_sst_method; +SHOW WARNINGS; + +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL wsrep_sst_method='method!'; +SELECT @@global.wsrep_sst_method; +SHOW WARNINGS; + +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL wsrep_sst_method='method;'; +SELECT @@global.wsrep_sst_method; +SHOW WARNINGS; + + +--disable_query_log +SET @@global.wsrep_sst_method = @wsrep_sst_method_saved; +--enable_query_log diff --git a/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.cnf b/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.cnf new file mode 100644 index 00000000..2e66b1ef --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.cnf @@ -0,0 +1,12 @@ +# Use default setting for mysqld processes +!include include/default_mysqld.cnf + +[mysqld] +wsrep-on=OFF + +[mysqld.1] +wsrep-on=OFF +#galera_port=@OPT.port +#ist_port=@OPT.port +#sst_port=@OPT.port + diff --git a/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.test b/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.test new file mode 100644 index 00000000..4a9cd2ba --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.test @@ -0,0 +1,30 @@ +--source include/have_wsrep.inc +--source include/have_innodb.inc + +SELECT @@wsrep_on; + +SET @wsrep_slave_threads_global_saved = @@global.wsrep_slave_threads; +SET @wsrep_debug_saved = @@global.wsrep_debug; + +--error ER_WRONG_ARGUMENTS +SET SESSION wsrep_trx_fragment_size=DEFAULT; +SELECT @@session.wsrep_trx_fragment_size; +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL wsrep_start_position='12345678-1234-1234-1234-123456789012:100'; +SHOW WARNINGS; +SELECT @@global.wsrep_start_position; +SET GLOBAL wsrep_debug=1; +SELECT @@global.wsrep_debug; +SET GLOBAL wsrep_slave_threads=5; +SELECT @@global.wsrep_slave_threads; +--error ER_WRONG_ARGUMENTS +SET GLOBAL wsrep_desync=1; +SELECT @@global.wsrep_desync; +--error ER_WRONG_ARGUMENTS +SET SESSION wsrep_trx_fragment_unit='rows'; +SELECT @@session.wsrep_trx_fragment_unit; + +--disable_query_log +SET @@global.wsrep_slave_threads = @wsrep_slave_threads_global_saved; +SET @@global.wsrep_debug = @wsrep_debug_saved; +--enable_query_log -- cgit v1.2.3