mariadb/mysql-test/suite/galera/t/galera_parallel_simple.test

56 lines
1.3 KiB
Text

#
# Test that SHOW PROCESSLIST reports that two slave threads have been involved in applying
# two independent transactions
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--let $wsrep_slave_threads_orig = `SELECT @@wsrep_slave_threads`
CREATE TABLE t1 (id INT) ENGINE=InnoDB;
CREATE TABLE t2 (id INT) ENGINE=InnoDB;
--connection node_2
SET GLOBAL wsrep_slave_threads = 2;
LOCK TABLE t1 WRITE;
--connection node_1
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
--connection node_2
SET SESSION wsrep_sync_wait = 0;
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Waiting for table metadata lock%';
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'applied write set%';
--source include/wait_condition.inc
UNLOCK TABLES;
SET SESSION wsrep_sync_wait = 7;
SELECT COUNT(*) = 10 FROM t1;
SELECT COUNT(*) = 10 FROM t2;
--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig;
DROP TABLE t1;
DROP TABLE t2;