Skip to content

Commit

Permalink
MDEV-13549: Timeout in wait_condition.inc for PROCESSLIST
Browse files Browse the repository at this point in the history
Use wsrep sync wait instead of unnecessary waits and
correct slave setting.
  • Loading branch information
Jan Lindström committed May 17, 2019
1 parent 579c1a8 commit 61469b3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 29 deletions.
1 change: 0 additions & 1 deletion mysql-test/suite/galera/disabled.def
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ MW-328A : MDEV-17847 Galera test failure on MW-328[A|B|C]
MW-328B : MDEV-17847 Galera test failure on MW-328[A|B|C]
MW-328C : MDEV-17847 Galera test failure on MW-328[A|B|C]
MW-329 : wsrep_local_replays not stable
MW-336 : MDEV-13549 Timeout in wait_condition.inc for PROCESSLIST
MW-416 : MDEV-13549 Galera test failures
MW-44 : MDEV-15809 Test failure on galera.MW-44
galera_account_management : MariaDB 10.0 does not support ALTER USER
Expand Down
18 changes: 9 additions & 9 deletions mysql-test/suite/galera/r/MW-336.result
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@ INSERT INTO t1 values(0);
SET GLOBAL wsrep_slave_threads = 10;
SET GLOBAL wsrep_slave_threads = 1;
# Wait 10 slave threads to start 1
# Generate 12 replication events
SET SESSION wsrep_sync_wait=15;
# Generate 100 replication events
SET SESSION wsrep_sync_wait=15;
SELECT COUNT(*) FROM t1;
COUNT(*)
13
101
# Wait 9 slave threads to exit 1
SET GLOBAL wsrep_slave_threads = 10;
# Wait 10 slave threads to start 2
SET GLOBAL wsrep_slave_threads = 20;
# Wait 20 slave threads to start 3
SET GLOBAL wsrep_slave_threads = 1;
# Generate 40 replication events
# Generate 100 replication events
SELECT COUNT(*) FROM t1;
COUNT(*)
53
201
# Wait 10 slave threads to exit 3
SET GLOBAL wsrep_slave_threads = 10;
SET GLOBAL wsrep_slave_threads = 0;
Warnings:
Warning 1292 Truncated incorrect wsrep_slave_threads value: '0'
SET GLOBAL wsrep_slave_threads = 1;
# Wait 10 slave threads to start 3
# Generate 12 replication events
# Generate 100 replication events
SELECT COUNT(*) FROM t1;
COUNT(*)
65
301
# Wait 10 slave threads to exit 4
DROP TABLE t1;
28 changes: 9 additions & 19 deletions mysql-test/suite/galera/t/MW-336.test
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ SET GLOBAL wsrep_slave_threads = 1;
--source include/wait_condition.inc

--connection node_2
SET SESSION wsrep_sync_wait=15;
# Wait until inserts are replicated
--let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
--source include/wait_condition.inc
--echo # Generate 12 replication events
--echo # Generate 100 replication events
--disable_query_log
--disable_result_log
--let $count = 12
--let $count = 100
while ($count)
{
INSERT INTO t1 VALUES (1);
Expand All @@ -35,9 +36,7 @@ while ($count)
--enable_query_log

--connection node_1
# Wait until inserts are replicated
--let $wait_condition = SELECT COUNT(*) = 13 FROM t1;
--source include/wait_condition.inc
SET SESSION wsrep_sync_wait=15;

SELECT COUNT(*) FROM t1;

Expand All @@ -61,10 +60,10 @@ SET GLOBAL wsrep_slave_threads = 20;
SET GLOBAL wsrep_slave_threads = 1;

--connection node_2
--echo # Generate 40 replication events
--echo # Generate 100 replication events
--disable_query_log
--disable_result_log
--let $count = 40
--let $count = 100
while ($count)
{
INSERT INTO t1 VALUES (1);
Expand All @@ -74,11 +73,6 @@ while ($count)
--enable_result_log

--connection node_1

# Wait until inserts are replicated
--let $wait_condition = SELECT COUNT(*) = 53 FROM t1;
--source include/wait_condition.inc

SELECT COUNT(*) FROM t1;

--echo # Wait 10 slave threads to exit 3
Expand All @@ -87,18 +81,18 @@ SELECT COUNT(*) FROM t1;
--source include/wait_condition.inc

SET GLOBAL wsrep_slave_threads = 10;
SET GLOBAL wsrep_slave_threads = 0;
SET GLOBAL wsrep_slave_threads = 1;

--echo # Wait 10 slave threads to start 3
--let $wait_timeout=600
--let $wait_condition = SELECT COUNT(*) = 11 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%');
--source include/wait_condition.inc

--connection node_2
--echo # Generate 12 replication events
--echo # Generate 100 replication events
--disable_query_log
--disable_result_log
--let $count = 12
--let $count = 100
while ($count)
{
INSERT INTO t1 VALUES (1);
Expand All @@ -108,10 +102,6 @@ while ($count)
--enable_query_log

--connection node_1
# Wait until inserts are replicated
--let $wait_condition = SELECT COUNT(*) = 65 FROM t1;
--source include/wait_condition.inc

SELECT COUNT(*) FROM t1;

--echo # Wait 10 slave threads to exit 4
Expand Down

0 comments on commit 61469b3

Please sign in to comment.