Commit b513e371 authored by Marko Mäkelä's avatar Marko Mäkelä

Clean up some Galera tests.

Note: At least one test is unstable, failing with the following:
./mtr --mysqld=--innodb-purge-threads=9 --big-test --no-reorder \
galera.galera_parallel_autoinc_largetrx galera.galera_var_slave_threads

The result difference is dependent on innodb_purge_threads.
parent 51af1985
...@@ -2,10 +2,15 @@ ...@@ -2,10 +2,15 @@
# MDEV-10812: On COM_STMT_CLOSE/COM_QUIT, when wsrep_conflict_state # MDEV-10812: On COM_STMT_CLOSE/COM_QUIT, when wsrep_conflict_state
# is ABORTED, it causes wrong response to be sent to the client # is ABORTED, it causes wrong response to be sent to the client
# #
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
CREATE TABLE t1(a INT PRIMARY KEY); CREATE TABLE t1(a INT PRIMARY KEY);
INSERT INTO t1 VALUES(1),(2),(3); INSERT INTO t1 VALUES(1),(2),(3);
START TRANSACTION ; START TRANSACTION ;
UPDATE t1 SET a=a+100; UPDATE t1 SET a=a+100;
connection node_2;
UPDATE t1 SET a=a+100; UPDATE t1 SET a=a+100;
connection node_1a;
disconnect node_1a;
connection node_2;
DROP TABLE t1; DROP TABLE t1;
...@@ -13,16 +13,16 @@ INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;; ...@@ -13,16 +13,16 @@ INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;;
connection node_1; connection node_1;
connection node_1a; connection node_1a;
connection node_2; connection node_2;
SELECT COUNT(*) = 30000 FROM t1; SELECT COUNT(*) FROM t1;
COUNT(*) = 30000 COUNT(*)
1 30000
SELECT COUNT(DISTINCT f1) = 30000 FROM t1; SELECT COUNT(DISTINCT f1) FROM t1;
COUNT(DISTINCT f1) = 30000 COUNT(DISTINCT f1)
1 30000
SELECT COUNT(*) = 5 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE
USER = 'system user' AND NOT STATE <=> 'InnoDB background thread'; USER = 'system user' AND NOT STATE <=> 'InnoDB background thread';
COUNT(*) = 5 COUNT(*)
1 5
connection default; connection default;
DROP TABLE t1; DROP TABLE t1;
DROP TABLE ten; DROP TABLE ten;
...@@ -24,4 +24,7 @@ connection node_2; ...@@ -24,4 +24,7 @@ connection node_2;
SET GLOBAL wsrep_certify_nonPK = 1; SET GLOBAL wsrep_certify_nonPK = 1;
DROP TABLE t1; DROP TABLE t1;
DROP TABLE t2; DROP TABLE t2;
connection node_1;
call mtr.add_suppression("SQL statement was ineffective"); call mtr.add_suppression("SQL statement was ineffective");
disconnect node_2;
disconnect node_1;
...@@ -118,12 +118,14 @@ DROP TABLE ten; ...@@ -118,12 +118,14 @@ DROP TABLE ten;
# wsrep_max_ws_rows causes cluster to break when running # wsrep_max_ws_rows causes cluster to break when running
# Galera cluster in TOI mode # Galera cluster in TOI mode
# #
connection node_1;
CREATE TABLE t1(c1 INT)ENGINE = INNODB; CREATE TABLE t1(c1 INT)ENGINE = INNODB;
SET GLOBAL wsrep_max_ws_rows= DEFAULT; SET GLOBAL wsrep_max_ws_rows= DEFAULT;
INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(1);
INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1;
SET GLOBAL wsrep_max_ws_rows= 1; SET GLOBAL wsrep_max_ws_rows= 1;
ALTER TABLE t1 CHANGE COLUMN c1 c1 BIGINT; ALTER TABLE t1 CHANGE COLUMN c1 c1 BIGINT;
connection node_2;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
...@@ -133,3 +135,6 @@ SELECT COUNT(*) FROM t1; ...@@ -133,3 +135,6 @@ SELECT COUNT(*) FROM t1;
COUNT(*) COUNT(*)
2 2
DROP TABLE t1; DROP TABLE t1;
connection node_1;
disconnect node_2;
disconnect node_1;
...@@ -12,26 +12,26 @@ SELECT @@wsrep_slave_threads = 1; ...@@ -12,26 +12,26 @@ SELECT @@wsrep_slave_threads = 1;
@@wsrep_slave_threads = 1 @@wsrep_slave_threads = 1
1 1
SET GLOBAL wsrep_slave_threads = 1; SET GLOBAL wsrep_slave_threads = 1;
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE USER = 'system user' AND NOT STATE <=> 'InnoDB background thread'; WHERE USER = 'system user' AND NOT STATE <=> 'InnoDB background thread';
COUNT(*) = 2 COUNT(*)
1 2
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
COUNT(*) = 1 COUNT(*)
1 1
SET GLOBAL wsrep_slave_threads = 64; SET GLOBAL wsrep_slave_threads = 64;
connection node_1; connection node_1;
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
connection node_2; connection node_2;
SELECT COUNT(*) = 1 FROM t1; SELECT COUNT(*) FROM t1;
COUNT(*) = 1 COUNT(*)
1 1
SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST SELECT COUNT(*) - @@wsrep_slave_threads FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE USER = 'system user' AND NOT STATE <=> 'InnoDB background thread'; WHERE USER = 'system user' AND NOT STATE <=> 'InnoDB background thread';
COUNT(*) = @@wsrep_slave_threads + 1 COUNT(*) - @@wsrep_slave_threads
1 1
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
COUNT(*) = 1 COUNT(*)
1 1
SET GLOBAL wsrep_slave_threads = 1; SET GLOBAL wsrep_slave_threads = 1;
connection node_1; connection node_1;
...@@ -100,15 +100,15 @@ INSERT INTO t2 VALUES (DEFAULT); ...@@ -100,15 +100,15 @@ INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT); INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT); INSERT INTO t2 VALUES (DEFAULT);
connection node_2; connection node_2;
SELECT COUNT(*) = 64 FROM t2; SELECT COUNT(*) FROM t2;
COUNT(*) = 64 COUNT(*)
1 64
SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST SELECT COUNT(*) - @@wsrep_slave_threads FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE USER = 'system user' AND NOT STATE <=> 'InnoDB background thread'; WHERE USER = 'system user' AND NOT STATE <=> 'InnoDB background thread';
COUNT(*) = @@wsrep_slave_threads + 1 COUNT(*) - @@wsrep_slave_threads
1 1
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
COUNT(*) = 1 COUNT(*)
1 1
SET GLOBAL wsrep_slave_threads = 1; SET GLOBAL wsrep_slave_threads = 1;
DROP TABLE t1; DROP TABLE t1;
......
...@@ -37,9 +37,9 @@ SET GLOBAL wsrep_slave_threads = 4; ...@@ -37,9 +37,9 @@ SET GLOBAL wsrep_slave_threads = 4;
--connection node_2 --connection node_2
--reap --reap
SELECT COUNT(*) = 30000 FROM t1; SELECT COUNT(*) FROM t1;
SELECT COUNT(DISTINCT f1) = 30000 FROM t1; SELECT COUNT(DISTINCT f1) FROM t1;
SELECT COUNT(*) = 5 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE
USER = 'system user' AND NOT STATE <=> 'InnoDB background thread'; USER = 'system user' AND NOT STATE <=> 'InnoDB background thread';
--disable_query_log --disable_query_log
......
...@@ -22,9 +22,9 @@ SELECT @@wsrep_slave_threads = 1; ...@@ -22,9 +22,9 @@ SELECT @@wsrep_slave_threads = 1;
SET GLOBAL wsrep_slave_threads = 1; SET GLOBAL wsrep_slave_threads = 1;
# There is a separate wsrep_aborter thread at all times # There is a separate wsrep_aborter thread at all times
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE USER = 'system user' AND NOT STATE <=> 'InnoDB background thread'; WHERE USER = 'system user' AND NOT STATE <=> 'InnoDB background thread';
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
# #
# Increase the number of slave threads. The change takes effect immediately # Increase the number of slave threads. The change takes effect immediately
...@@ -37,11 +37,11 @@ SET GLOBAL wsrep_slave_threads = 64; ...@@ -37,11 +37,11 @@ SET GLOBAL wsrep_slave_threads = 64;
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
--connection node_2 --connection node_2
SELECT COUNT(*) = 1 FROM t1; SELECT COUNT(*) FROM t1;
SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST SELECT COUNT(*) - @@wsrep_slave_threads FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE USER = 'system user' AND NOT STATE <=> 'InnoDB background thread'; WHERE USER = 'system user' AND NOT STATE <=> 'InnoDB background thread';
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
# #
# Reduce the number of slave threads. The change is not immediate -- a thread will only exit after a replication event # Reduce the number of slave threads. The change is not immediate -- a thread will only exit after a replication event
...@@ -60,11 +60,11 @@ while ($count) ...@@ -60,11 +60,11 @@ while ($count)
} }
--connection node_2 --connection node_2
SELECT COUNT(*) = 64 FROM t2; SELECT COUNT(*) FROM t2;
SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST SELECT COUNT(*) - @@wsrep_slave_threads FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE USER = 'system user' AND NOT STATE <=> 'InnoDB background thread'; WHERE USER = 'system user' AND NOT STATE <=> 'InnoDB background thread';
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig --eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment