summaryrefslogtreecommitdiff
path: root/mysql-test/suite/galera/t/galera_to_error.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/galera/t/galera_to_error.test')
-rw-r--r--mysql-test/suite/galera/t/galera_to_error.test71
1 files changed, 71 insertions, 0 deletions
diff --git a/mysql-test/suite/galera/t/galera_to_error.test b/mysql-test/suite/galera/t/galera_to_error.test
new file mode 100644
index 00000000000..576fa01e64d
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_to_error.test
@@ -0,0 +1,71 @@
+#
+# Confirm that with two nodes, killing one causes the other to stop accepting connections
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+--connection node_1
+call mtr.add_suppression("WSREP: TO isolation failed for: ");
+--let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address`
+
+CREATE TABLE t2(a int not null auto_increment primary key, b int, key(b)) engine=innodb;
+INSERT INTO t2 values (NULL,1),(NULL,2),(NULL,3),(NULL,4),(NULL,5),(NULL,6);
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+BEGIN;
+--send UPDATE t2 set b = b + 20 where b BETWEEN 2 and 5;
+
+#
+# Take thread id for above query
+#
+--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1b
+--let $k_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'root' AND COMMAND = 'Sleep' LIMIT 1`
+
+--connection node_2
+--source include/kill_galera.inc
+
+--connect node_1c, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1c
+--error ER_LOCK_DEADLOCK,ER_UNKNOWN_COM_ERROR
+CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
+
+--disable_query_log
+--error ER_LOCK_DEADLOCK, ER_CANNOT_USER,ER_KILL_QUERY_DENIED_ERROR
+--eval KILL QUERY $k_thread;
+--enable_query_log
+
+# Reset the master and restart the slave so that post-test checks can run
+--error ER_LOCK_DEADLOCK,ER_UNKNOWN_COM_ERROR
+CREATE UNIQUE INDEX b2 ON t2(b);
+
+--connection node_1
+--disconnect node_1a
+--disconnect node_1b
+--disconnect node_1c
+
+--connection node_2
+--source include/start_mysqld.inc
+--source include/wait_until_connected_again.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--source include/wait_until_connected_again.inc
+
+DROP TABLE t2;
+
+# Restore original auto_increment_offset values.
+--let $node_2=node_2a
+--source include/auto_increment_offset_restore.inc
+
+--source include/galera_end.inc
+