summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2019-05-08 08:14:43 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2019-05-08 08:14:43 +0300
commit1aeaad1069cd5713e36012d6f8ef9de4d67fe495 (patch)
treea66eb36466c37cb692097bd56ddc996c2c644ec4
parente0271a7b43c6df652c6a074858853a6d0da20c1e (diff)
parentdb9622f1f5c62340165d6bbf91802ef9ab24acdf (diff)
downloadmariadb-git-bb-10.2-merge-jan.tar.gz
Merge 10.1 into 10.2bb-10.2-merge-jan
-rw-r--r--mysql-test/suite/galera/r/galera_parallel_autoinc_largetrx.result8
-rw-r--r--mysql-test/suite/galera/r/galera_parallel_autoinc_manytrx.result33
-rw-r--r--mysql-test/suite/galera/t/galera_parallel_autoinc_largetrx.test10
-rw-r--r--mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test87
4 files changed, 95 insertions, 43 deletions
diff --git a/mysql-test/suite/galera/r/galera_parallel_autoinc_largetrx.result b/mysql-test/suite/galera/r/galera_parallel_autoinc_largetrx.result
index 827b2aa9dac..b21a9d0bdca 100644
--- a/mysql-test/suite/galera/r/galera_parallel_autoinc_largetrx.result
+++ b/mysql-test/suite/galera/r/galera_parallel_autoinc_largetrx.result
@@ -1,8 +1,9 @@
connection node_1;
-CREATE TABLE ten (f1 INTEGER);
+CREATE TABLE ten (f1 INTEGER) Engine=InnoDB;
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;
+set session wsrep_sync_wait=15;
SET GLOBAL wsrep_slave_threads = 4;
connection node_1;
INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;;
@@ -13,16 +14,13 @@ INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;;
connection node_1;
connection node_1a;
connection node_2;
+disconnect node_1a;
SELECT COUNT(*) FROM t1;
COUNT(*)
30000
SELECT COUNT(DISTINCT f1) FROM t1;
COUNT(DISTINCT f1)
30000
-SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE
-USER = 'system user' AND STATE NOT LIKE 'InnoDB%';
-COUNT(*)
-3
connection default;
DROP TABLE t1;
DROP TABLE ten;
diff --git a/mysql-test/suite/galera/r/galera_parallel_autoinc_manytrx.result b/mysql-test/suite/galera/r/galera_parallel_autoinc_manytrx.result
index c8c07221cb1..0fd0f0b505a 100644
--- a/mysql-test/suite/galera/r/galera_parallel_autoinc_manytrx.result
+++ b/mysql-test/suite/galera/r/galera_parallel_autoinc_manytrx.result
@@ -1,20 +1,33 @@
connection node_1;
-CREATE TABLE ten (f1 INTEGER);
+CREATE TABLE ten (f1 INTEGER) Engine=InnoDB;
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;
+set session wsrep_sync_wait=15;
SET GLOBAL wsrep_slave_threads = 4;
connection node_1;
+CREATE PROCEDURE p1 (repeat_count int)
+BEGIN
+DECLARE current_num int;
+SET current_num = 0;
+WHILE current_num < repeat_count do
+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1;
+COMMIT;
+SET current_num = current_num + 1;
+END WHILE;
+END|
+connection node_1a;
+connection node_1b;
connection node_2;
-SELECT COUNT(*) = 20000 FROM t1;
-COUNT(*) = 20000
-1
-SELECT COUNT(DISTINCT f1) = 20000 FROM t1;
-COUNT(DISTINCT f1) = 20000
-1
-SELECT COUNT(*) = 4 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE 'committed%';
-COUNT(*) = 4
-1
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+40000
+SELECT COUNT(DISTINCT f1) FROM t1;
+COUNT(DISTINCT f1)
+40000
+disconnect node_1a;
+disconnect node_1b;
connection default;
DROP TABLE t1;
DROP TABLE ten;
+DROP PROCEDURE p1;
diff --git a/mysql-test/suite/galera/t/galera_parallel_autoinc_largetrx.test b/mysql-test/suite/galera/t/galera_parallel_autoinc_largetrx.test
index 644b4687cb3..34558283462 100644
--- a/mysql-test/suite/galera/t/galera_parallel_autoinc_largetrx.test
+++ b/mysql-test/suite/galera/t/galera_parallel_autoinc_largetrx.test
@@ -12,13 +12,18 @@
--source include/galera_connect.inc
--connection node_1
-CREATE TABLE ten (f1 INTEGER);
+CREATE TABLE ten (f1 INTEGER) Engine=InnoDB;
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
+set session wsrep_sync_wait=15;
--let $wsrep_slave_threads_orig = `SELECT @@wsrep_slave_threads`
SET GLOBAL wsrep_slave_threads = 4;
+--let $wait_condition = SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%');
+--source include/wait_condition.inc
+
--connection node_1
--send INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
@@ -37,10 +42,9 @@ SET GLOBAL wsrep_slave_threads = 4;
--connection node_2
--reap
+--disconnect node_1a
SELECT COUNT(*) FROM t1;
SELECT COUNT(DISTINCT f1) FROM t1;
-SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE
- USER = 'system user' AND STATE NOT LIKE 'InnoDB%';
--disable_query_log
--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig;
diff --git a/mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test b/mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test
index 8680d62a36d..d04603891db 100644
--- a/mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test
+++ b/mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test
@@ -6,43 +6,78 @@
--source include/have_innodb.inc
--source include/big_test.inc
-# Create a second connection to node1 so that we can run transactions concurrently
+--connection node_1
+CREATE TABLE ten (f1 INTEGER) Engine=InnoDB;
+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;
+
+# Create few connections 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);
+--let $galera_connection_name = node_1b
+--let $galera_server_number = 1
+--source include/galera_connect.inc
-CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB;
--connection node_2
+set session wsrep_sync_wait=15;
--let $wsrep_slave_threads_orig = `SELECT @@wsrep_slave_threads`
SET GLOBAL wsrep_slave_threads = 4;
+--let $wait_condition = SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%');
+--source include/wait_condition.inc
+
+--connection node_1
+DELIMITER |;
+CREATE PROCEDURE p1 (repeat_count int)
+BEGIN
+ DECLARE current_num int;
+ SET current_num = 0;
+ WHILE current_num < repeat_count do
+ INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1;
+ COMMIT;
+ SET current_num = current_num + 1;
+ END WHILE;
+END|
+DELIMITER ;|
+
+--disable_query_log
+send call p1(1000);
+
+--connection node_1a
+--disable_query_log
+send call p1(1000);
+
+--connection node_1b
+--disable_query_log
+send call p1(1000);
+
+--connection node_2
+--disable_query_log
+send call p1(1000);
--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
-}
+reap;
+--enable_query_log
+
+--connection node_1a
+reap;
+--enable_query_log
+
+--connection node_1b
+reap;
+--enable_query_log
--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%';
+reap;
+--enable_query_log
+
+SELECT COUNT(*) FROM t1;
+SELECT COUNT(DISTINCT f1) FROM t1;
+
+--disconnect node_1a
+--disconnect node_1b
--disable_query_log
--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig;
@@ -51,4 +86,6 @@ SELECT COUNT(*) = 4 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system use
--connection default
DROP TABLE t1;
DROP TABLE ten;
+DROP PROCEDURE p1;
+