summaryrefslogtreecommitdiff
path: root/mysql-test/suite/galera_sr
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-03-29 16:16:21 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-03-29 16:16:21 +0300
commitb242c3141f263f9f73f179ad5edd385906109262 (patch)
treefcba93da0a91e2b615e4f85a5ba449641641b49f /mysql-test/suite/galera_sr
parentb2fa874e462e7352be173a3075a65e49f2fcc404 (diff)
parentc14f60a72f28bb5102d529b3946c2daf8f3b590b (diff)
downloadmariadb-git-b242c3141f263f9f73f179ad5edd385906109262.tar.gz
Merge 10.5 into 10.6
Diffstat (limited to 'mysql-test/suite/galera_sr')
-rw-r--r--mysql-test/suite/galera_sr/disabled.def1
-rw-r--r--mysql-test/suite/galera_sr/r/MDEV-27553.result25
-rw-r--r--mysql-test/suite/galera_sr/t/MDEV-27553.test65
3 files changed, 76 insertions, 15 deletions
diff --git a/mysql-test/suite/galera_sr/disabled.def b/mysql-test/suite/galera_sr/disabled.def
index 9f6ae2a51ef..e45118f6f0a 100644
--- a/mysql-test/suite/galera_sr/disabled.def
+++ b/mysql-test/suite/galera_sr/disabled.def
@@ -14,4 +14,5 @@ GCF-1018B : MDEV-18534 wsrep::transaction::adopt(): Assertion `transaction.is_st
GCF-1060 : MDEV-20848 galera_sr.GCF_1060
GCF-585 : MDEV-24698 galera_sr.GCF-585 MTR failed with SIGABRT: no such a transition REPLICATING -> APPLYING
galera-features#56 : MDEV-24896
+GCF-1060 : MDEV-26528 wrong usage of mutex LOCK_thd_kill and LOCK_thd_kill
galera_sr_shutdown_master : MDEV-23612: galera_sr.galera_sr_shutdown_master MTR failed: WSREP_SST: [ERROR] Possible timeout in receving first data from donor in gtid stage
diff --git a/mysql-test/suite/galera_sr/r/MDEV-27553.result b/mysql-test/suite/galera_sr/r/MDEV-27553.result
index f6f81bd13f1..5a6a5bd4956 100644
--- a/mysql-test/suite/galera_sr/r/MDEV-27553.result
+++ b/mysql-test/suite/galera_sr/r/MDEV-27553.result
@@ -1,23 +1,36 @@
connection node_2;
connection node_1;
-CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
connection node_1;
+connection node_2;
+connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+connection node_2;
SET SESSION wsrep_trx_fragment_size=1;
START TRANSACTION;
INSERT INTO t1 VALUES (1);
+SELECT COUNT(*) `Expect 1` FROM mysql.wsrep_streaming_log;
+Expect 1
+1
SET @@global.debug_dbug="+d,ha_index_init_fail";
ROLLBACK;
-connection node_2;
+connection node_1;
+SET SESSION wsrep_sync_wait = 0;
SELECT COUNT(*) `Expect 0` FROM mysql.wsrep_streaming_log;
Expect 0
0
-connection node_1;
+connection node_2;
SET @@global.debug_dbug="";
+SET SESSION wsrep_sync_wait = 0;
SELECT COUNT(*) `Expect 1` FROM mysql.wsrep_streaming_log;
Expect 1
1
-SET SESSION wsrep_on=OFF;
-DELETE FROM mysql.wsrep_streaming_log;
-SET SESSION wsrep_on=ON;
+connection node_2;
+SET GLOBAL wsrep_on=OFF;
+# restart
+SELECT COUNT(*) `Expect 0` FROM mysql.wsrep_streaming_log;
+Expect 0
+0
DROP TABLE t1;
CALL mtr.add_suppression("WSREP: Failed to init table for index scan");
+CALL mtr.add_suppression("WSREP: Failed to apply write set");
+CALL mtr.add_suppression("Failed to report last committed");
diff --git a/mysql-test/suite/galera_sr/t/MDEV-27553.test b/mysql-test/suite/galera_sr/t/MDEV-27553.test
index d17af175512..5c557db9201 100644
--- a/mysql-test/suite/galera_sr/t/MDEV-27553.test
+++ b/mysql-test/suite/galera_sr/t/MDEV-27553.test
@@ -5,29 +5,76 @@
--source include/galera_cluster.inc
--source include/have_debug.inc
+--let $node_1=node_1
+--let $node_2=node_2
+--source suite/galera/include/auto_increment_offset_save.inc
+
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
---connection node_1
---let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address`
+--connection node_2
SET SESSION wsrep_trx_fragment_size=1;
START TRANSACTION;
INSERT INTO t1 VALUES (1);
-# This will result in failure to remove fragments
-# from streaming log, in the following ROLLBACK.
+SELECT COUNT(*) `Expect 1` FROM mysql.wsrep_streaming_log;
+
+#
+# Issue ROLLBACK and make sure it fails to clean up
+# the streaming log. Failure to remove fragments
+# results in apply failure of the rollback fragment.
+# The node should disconnect from the cluster.
+#
SET @@global.debug_dbug="+d,ha_index_init_fail";
ROLLBACK;
---connection node_2
+
+#
+# Expect the cluster to shrink
+#
+--connection node_1
+SET SESSION wsrep_sync_wait = 0;
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+#
+# ROLLBACK should clean up the streaming log just fine in node 1
+#
SELECT COUNT(*) `Expect 0` FROM mysql.wsrep_streaming_log;
---connection node_1
+#
+# Expect the failure on ROLLBACK to leave a entry in streaming log
+#
+--connection node_2
SET @@global.debug_dbug="";
+SET SESSION wsrep_sync_wait = 0;
+# Expect node to be disconnected
+--let wait_condition = SELECT VARIABLE_VALUE = 'Disconnected' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+
SELECT COUNT(*) `Expect 1` FROM mysql.wsrep_streaming_log;
-SET SESSION wsrep_on=OFF;
-DELETE FROM mysql.wsrep_streaming_log;
-SET SESSION wsrep_on=ON;
+
+#
+# Restart node 2, so that it joins the cluster back
+#
+--connection node_2
+SET GLOBAL wsrep_on=OFF;
+--source include/restart_mysqld.inc
+
+#
+# After restart, the streaming log is empty in node 2
+#
+SELECT COUNT(*) `Expect 0` FROM mysql.wsrep_streaming_log;
+
+#
+# Cleanup
+#
DROP TABLE t1;
CALL mtr.add_suppression("WSREP: Failed to init table for index scan");
+CALL mtr.add_suppression("WSREP: Failed to apply write set");
+CALL mtr.add_suppression("Failed to report last committed");
+
+--source suite/galera/include/auto_increment_offset_restore.inc