Commit 49fa5f6b authored by Jan Lindström's avatar Jan Lindström Committed by Julius Goryavsky

MDEV-33138 : Galera test case MW-336 unstable

Add more inserts before wsrep_slave_threads is set to 1 and
add wait_condition to wait all of them are replicated before
wait_condition about number of wsrep_slave_threads.
Signed-off-by: default avatarJulius Goryavsky <julius.goryavsky@mariadb.com>
parent 736e4293
connection node_2;
connection node_1;
connection node_1;
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
SET @wsrep_slave_threads_orig = @@wsrep_slave_threads;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) Engine=InnoDB;
SET GLOBAL wsrep_slave_threads = 10;
# Set slave threads to 10 step 1
SELECT VARIABLE_VALUE AS EXPECT_10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
......@@ -9,7 +10,7 @@ EXPECT_10
10
SET GLOBAL wsrep_slave_threads = 1;
connection node_2;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (NULL);
connection node_1;
# Wait until one of the appliers has exited
SELECT VARIABLE_VALUE AS EXPECT_9 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
......@@ -27,33 +28,14 @@ EXPECT_20
20
SET GLOBAL wsrep_slave_threads = 1;
connection node_2;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (5);
INSERT INTO t1 VALUES (6);
INSERT INTO t1 VALUES (7);
INSERT INTO t1 VALUES (8);
INSERT INTO t1 VALUES (9);
INSERT INTO t1 VALUES (10);
INSERT INTO t1 VALUES (11);
INSERT INTO t1 VALUES (12);
INSERT INTO t1 VALUES (13);
INSERT INTO t1 VALUES (14);
INSERT INTO t1 VALUES (16);
INSERT INTO t1 VALUES (17);
INSERT INTO t1 VALUES (18);
INSERT INTO t1 VALUES (19);
INSERT INTO t1 VALUES (20);
connection node_1;
# Wait until 19 of the appliers has exited
SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
EXPECT_1
1
SELECT COUNT(*) FROM t1;
COUNT(*)
20
SELECT COUNT(*) AS EXPECT_51 FROM t1;
EXPECT_51
51
SET GLOBAL wsrep_slave_threads = 10;
# Set slave threads to 10 step 3
SELECT VARIABLE_VALUE AS EXPECT_10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
......@@ -62,22 +44,12 @@ EXPECT_10
connection node_1;
SET GLOBAL wsrep_slave_threads = 1;
connection node_2;
INSERT INTO t1 VALUES (21);
INSERT INTO t1 VALUES (22);
INSERT INTO t1 VALUES (23);
INSERT INTO t1 VALUES (24);
INSERT INTO t1 VALUES (25);
INSERT INTO t1 VALUES (26);
INSERT INTO t1 VALUES (27);
INSERT INTO t1 VALUES (28);
INSERT INTO t1 VALUES (29);
INSERT INTO t1 VALUES (30);
connection node_1;
# Wait until slave threads back to 1
SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
EXPECT_1
1
SELECT COUNT(*) FROM t1;
COUNT(*)
30
SELECT COUNT(*) AS EXPECT_101 FROM t1;
EXPECT_101
101
DROP TABLE t1;
......@@ -2,6 +2,8 @@
[mysqld.1]
wsrep-debug=SERVER
loose-wsrep-mw-336=1
[mysqld.2]
wsrep-debug=SERVER
loose-wsrep-mw-336=2
......@@ -3,11 +3,12 @@
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/force_restart.inc
--source include/have_sequence.inc
--connection node_1
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
SET @wsrep_slave_threads_orig = @@wsrep_slave_threads;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) Engine=InnoDB;
SET GLOBAL wsrep_slave_threads = 10;
......@@ -22,7 +23,7 @@ SELECT VARIABLE_VALUE AS EXPECT_10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE V
SET GLOBAL wsrep_slave_threads = 1;
--connection node_2
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (NULL);
--connection node_1
--echo # Wait until one of the appliers has exited
......@@ -54,27 +55,19 @@ SELECT VARIABLE_VALUE AS EXPECT_20 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE V
SET GLOBAL wsrep_slave_threads = 1;
--connection node_2
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (5);
INSERT INTO t1 VALUES (6);
INSERT INTO t1 VALUES (7);
INSERT INTO t1 VALUES (8);
INSERT INTO t1 VALUES (9);
INSERT INTO t1 VALUES (10);
INSERT INTO t1 VALUES (11);
INSERT INTO t1 VALUES (12);
INSERT INTO t1 VALUES (13);
INSERT INTO t1 VALUES (14);
INSERT INTO t1 VALUES (16);
INSERT INTO t1 VALUES (17);
INSERT INTO t1 VALUES (18);
INSERT INTO t1 VALUES (19);
INSERT INTO t1 VALUES (20);
--disable_query_log
let $c = 50;
while ($c) {
INSERT INTO t1 VALUES(NULL); COMMIT;
dec $c;
}
--enable_query_log
--connection node_1
--let $wait_condition = SELECT COUNT(*) = 51 FROM t1;
--let $wait_condition_on_error_output = SELECT COUNT(*) FROM t1;
--source include/wait_condition_with_debug.inc
--echo # Wait until 19 of the appliers has exited
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
--let $wait_condition_on_error_output = SELECT COUNT(*), 1 as EXPECTED_VALUE FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep applier idle'; show processlist
......@@ -82,7 +75,7 @@ INSERT INTO t1 VALUES (20);
SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) AS EXPECT_51 FROM t1;
SET GLOBAL wsrep_slave_threads = 10;
--echo # Set slave threads to 10 step 3
......@@ -96,16 +89,13 @@ SELECT VARIABLE_VALUE AS EXPECT_10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE V
SET GLOBAL wsrep_slave_threads = 1;
--connection node_2
INSERT INTO t1 VALUES (21);
INSERT INTO t1 VALUES (22);
INSERT INTO t1 VALUES (23);
INSERT INTO t1 VALUES (24);
INSERT INTO t1 VALUES (25);
INSERT INTO t1 VALUES (26);
INSERT INTO t1 VALUES (27);
INSERT INTO t1 VALUES (28);
INSERT INTO t1 VALUES (29);
INSERT INTO t1 VALUES (30);
--disable_query_log
let $c = 50;
while ($c) {
INSERT INTO t1 VALUES(NULL); COMMIT;
dec $c;
}
--enable_query_log
--connection node_1
--echo # Wait until slave threads back to 1
......@@ -115,6 +105,10 @@ INSERT INTO t1 VALUES (30);
SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) AS EXPECT_101 FROM t1;
DROP TABLE t1;
--disable_query_log
SET GLOBAL wsrep_slave_threads = @wsrep_slave_threads_orig;
--enable_query_log
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