revision-id: 73ec7917e9d5afb5fdc0fae5ba01796e73a59236 (mariadb-10.1.38-41-g73ec7917e9d) parent(s): ea52ecbc103b1424cf0b6f8faf990676b2b57a63 author: Jan Lindström committer: Jan Lindström timestamp: 2019-03-12 11:45:59 +0200 message: Test cleanups. --- .../suite/galera/r/galera_kill_nochanges.result | 10 +++--- .../suite/galera/r/galera_kill_smallchanges.result | 5 ++- .../suite/galera/r/galera_var_slave_threads.result | 38 +++++++++++++--------- mysql-test/suite/galera/suite.pm | 1 + .../suite/galera/t/galera_kill_nochanges.test | 5 +-- .../suite/galera/t/galera_kill_smallchanges.test | 11 +++++-- .../suite/galera/t/galera_var_slave_threads.test | 29 +++++++++++------ 7 files changed, 60 insertions(+), 39 deletions(-) diff --git a/mysql-test/suite/galera/r/galera_kill_nochanges.result b/mysql-test/suite/galera/r/galera_kill_nochanges.result index cdcebdb4eee..4b37a3e64e2 100644 --- a/mysql-test/suite/galera/r/galera_kill_nochanges.result +++ b/mysql-test/suite/galera/r/galera_kill_nochanges.result @@ -3,10 +3,10 @@ INSERT INTO t1 VALUES (1); Killing server ... SET SESSION wsrep_sync_wait = 0; SET SESSION wsrep_sync_wait = DEFAULT; -SELECT COUNT(*) = 1 FROM t1; -COUNT(*) = 1 -1 -SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -VARIABLE_VALUE = 2 +SELECT COUNT(*) FROM t1; +COUNT(*) 1 +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +VARIABLE_VALUE +2 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_kill_smallchanges.result b/mysql-test/suite/galera/r/galera_kill_smallchanges.result index 863b49dd51b..199a530241e 100644 --- a/mysql-test/suite/galera/r/galera_kill_smallchanges.result +++ b/mysql-test/suite/galera/r/galera_kill_smallchanges.result @@ -1,10 +1,9 @@ -call mtr.add_suppression("WSREP: Last Applied Action message in non-primary configuration from member .*"); SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true'; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; Killing server ... INSERT INTO t1 VALUES (1); -SELECT COUNT(*) = 1 FROM t1; -COUNT(*) = 1 +SELECT COUNT(*) FROM t1; +COUNT(*) 1 SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 2 diff --git a/mysql-test/suite/galera/r/galera_var_slave_threads.result b/mysql-test/suite/galera/r/galera_var_slave_threads.result index c7c6af2098f..5a78d84c24e 100644 --- a/mysql-test/suite/galera/r/galera_var_slave_threads.result +++ b/mysql-test/suite/galera/r/galera_var_slave_threads.result @@ -10,27 +10,30 @@ Warning 1292 Truncated incorrect wsrep_slave_threads value: '0' SELECT @@wsrep_slave_threads = 1; @@wsrep_slave_threads = 1 1 +# wsrep_slave_threads = 1 SET GLOBAL wsrep_slave_threads = 1; -SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user'; -COUNT(*) = 2 -1 -SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; -COUNT(*) = 1 +SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user'; +COUNT(*) +2 +SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; +COUNT(*) 1 SET GLOBAL wsrep_slave_threads = 64; INSERT INTO t1 VALUES (1); -SELECT COUNT(*) = 1 FROM t1; -COUNT(*) = 1 +SELECT COUNT(*) FROM t1; +COUNT(*) 1 -SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; -COUNT(*) = 1 +# wsrep_slave_threads = 64 +SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; +COUNT(*) 1 SET GLOBAL wsrep_slave_threads = 1; -SELECT COUNT(*) = 64 FROM t2; -COUNT(*) = 64 -1 -SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; -COUNT(*) = 1 +SELECT COUNT(*) FROM t2; +COUNT(*) +66 +# wsrep_slave_threads = 1 +SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; +COUNT(*) 1 SET GLOBAL wsrep_slave_threads = 1; DROP TABLE t1; @@ -44,10 +47,13 @@ SET GLOBAL wsrep_slave_threads = 1; INSERT INTO t1 VALUES (DEFAULT); INSERT INTO t1 VALUES (DEFAULT); INSERT INTO t1 VALUES (DEFAULT); +INSERT INTO t1 VALUES (DEFAULT); +INSERT INTO t1 VALUES (DEFAULT); +INSERT INTO t1 VALUES (DEFAULT); DROP TABLE t1; SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%'; NAME -SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; -COUNT(*) = 1 +SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; +COUNT(*) 1 # End of tests diff --git a/mysql-test/suite/galera/suite.pm b/mysql-test/suite/galera/suite.pm index 8b7b7034fac..6e53e6e2e31 100644 --- a/mysql-test/suite/galera/suite.pm +++ b/mysql-test/suite/galera/suite.pm @@ -75,6 +75,7 @@ push @::global_suppressions, qr|WSREP: Protocol violation. JOIN message sender .* is not in state transfer \(JOINED\). Message ignored.|, qr|WSREP: Unsupported protocol downgrade: incremental data collection disabled. Expect abort.|, qr(WSREP: Action message in non-primary configuration from member [0-9]*), + qr(WSREP: Last Applied Action message in non-primary configuration from member [0-9]*), qr(WSREP: discarding established .*), qr|WSREP: .*core_handle_uuid_msg.*|, qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0. WSREP_SYNC_WAIT_BEFORE_READ is on), diff --git a/mysql-test/suite/galera/t/galera_kill_nochanges.test b/mysql-test/suite/galera/t/galera_kill_nochanges.test index 9360ad542f6..aa1648ca3ae 100644 --- a/mysql-test/suite/galera/t/galera_kill_nochanges.test +++ b/mysql-test/suite/galera/t/galera_kill_nochanges.test @@ -20,6 +20,7 @@ INSERT INTO t1 VALUES (1); SET SESSION wsrep_sync_wait = 0; --let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status' --source include/wait_condition.inc + SET SESSION wsrep_sync_wait = DEFAULT; --connection node_2 @@ -30,8 +31,8 @@ SET SESSION wsrep_sync_wait = DEFAULT; --source include/galera_connect.inc --connection node_2a -SELECT COUNT(*) = 1 FROM t1; -SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +SELECT COUNT(*) FROM t1; +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; --let $node_2=node_2a --source include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera/t/galera_kill_smallchanges.test b/mysql-test/suite/galera/t/galera_kill_smallchanges.test index 148c3dbc132..15e1727de03 100644 --- a/mysql-test/suite/galera/t/galera_kill_smallchanges.test +++ b/mysql-test/suite/galera/t/galera_kill_smallchanges.test @@ -3,9 +3,11 @@ # --source include/galera_cluster.inc ---source include/have_innodb.inc -call mtr.add_suppression("WSREP: Last Applied Action message in non-primary configuration from member .*"); +# Save original auto_increment_offset values. +--let $node_1=node_1 +--let $node_2=node_2 +--source include/auto_increment_offset_save.inc --connection node_1 @@ -30,7 +32,7 @@ INSERT INTO t1 VALUES (1); --source include/galera_connect.inc --connection node_2a -SELECT COUNT(*) = 1 FROM t1; +SELECT COUNT(*) FROM t1; SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; --connection node_1 @@ -38,4 +40,7 @@ SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_N --eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig'; --enable_query_log +--let $node_2=node_2a +--source include/auto_increment_offset_restore.inc + DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/galera_var_slave_threads.test b/mysql-test/suite/galera/t/galera_var_slave_threads.test index 1cee845b6ab..95cd2aac163 100644 --- a/mysql-test/suite/galera/t/galera_var_slave_threads.test +++ b/mysql-test/suite/galera/t/galera_var_slave_threads.test @@ -19,10 +19,12 @@ SET GLOBAL wsrep_slave_threads = 0; SHOW WARNINGS; SELECT @@wsrep_slave_threads = 1; +--echo # wsrep_slave_threads = 1 SET GLOBAL wsrep_slave_threads = 1; + # There is a separate wsrep_aborter thread at all times -SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user'; -SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; +SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user'; +SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; # # Increase the number of slave threads. The change takes effect immediately @@ -38,11 +40,13 @@ INSERT INTO t1 VALUES (1); --let $wait_condition = SELECT COUNT(*) = 1 FROM t1; --source include/wait_condition.inc -SELECT COUNT(*) = 1 FROM t1; +SELECT COUNT(*) FROM t1; +--echo # wsrep_slave_threads = 64 --let $wait_condition = SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user'; --source include/wait_condition.inc -SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; + +SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; # # Reduce the number of slave threads. The change is not immediate -- a thread will only exit after a replication event @@ -54,8 +58,8 @@ SET GLOBAL wsrep_slave_threads = 1; --disable_result_log --disable_query_log -# Generate 64 replication events ---let $count = 64 +# Generate 66 replication events +--let $count = 66 while ($count) { INSERT INTO t2 VALUES (DEFAULT); @@ -65,15 +69,16 @@ while ($count) --enable_result_log --connection node_2 ---let $wait_condition = SELECT COUNT(*) = 64 FROM t2; +--let $wait_condition = SELECT COUNT(*) = 66 FROM t2; --source include/wait_condition.inc -SELECT COUNT(*) = 64 FROM t2; +SELECT COUNT(*) FROM t2; +--echo # wsrep_slave_threads = 1 --let $wait_condition = SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user'; --source include/wait_condition.inc -SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; +SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; --eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig @@ -98,6 +103,9 @@ SET GLOBAL wsrep_slave_threads = 1; INSERT INTO t1 VALUES (DEFAULT); INSERT INTO t1 VALUES (DEFAULT); INSERT INTO t1 VALUES (DEFAULT); +INSERT INTO t1 VALUES (DEFAULT); +INSERT INTO t1 VALUES (DEFAULT); +INSERT INTO t1 VALUES (DEFAULT); DROP TABLE t1; --connection node_2 @@ -113,6 +121,7 @@ SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%'; # --let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' --source include/wait_condition.inc -SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; + +SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; --echo # End of tests