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

54 lines
1.4 KiB
Text

##
## Tests the parallel application of many small-ish auto-increment insert transactions
##
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/big_test.inc
# Create a second connection to node1 so that we can run transactions concurrently
--let $galera_connection_name = node_1a
--let $galera_server_number = 1
--source include/galera_connect.inc
--connection node_1
CREATE TABLE ten (f1 INTEGER);
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB;
--connection node_2
--let $wsrep_slave_threads_orig = `SELECT @@wsrep_slave_threads`
SET GLOBAL wsrep_slave_threads = 4;
--connection node_1
--let $count = 1000
while ($count)
{
--disable_query_log
INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1;
--enable_query_log
--dec $count
}
--connection node_2
--let $count = 1000
while ($count)
{
--disable_query_log
INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1;
--enable_query_log
--dec $count
}
SELECT COUNT(*) = 20000 FROM t1;
SELECT COUNT(DISTINCT f1) = 20000 FROM t1;
SELECT COUNT(*) = 4 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE 'committed%';
--disable_query_log
--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig;
--enable_query_log
--connection default
DROP TABLE t1;
DROP TABLE ten;