Commit f369942d authored by Sachin Setiya's avatar Sachin Setiya

Galera MTR Tests: stability fixes

 * remove part of galera_var_cluster_address.test that can not be tested reliably
 * reduce running time for galera_gcache_recover_manytrx.test
 * Additional wait_conditions for GAL-401.test
Signed-off-by: default avatarSachin Setiya <sachin.setiya@mariadb.com>
parent c72e1ea9
let $wait_condition = SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready' AND VARIABLE_VALUE = 'ON';
--source include/wait_condition.inc
SELECT COUNT(*) = 900 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%';
COUNT(*) = 900
SELECT COUNT(*) = 100 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%';
COUNT(*) = 100
1
SET AUTOCOMMIT=OFF;
START TRANSACTION;
COMMIT;
CREATE TABLE sum_table (f1 INTEGER);
SELECT SUM(f1) = 900 FROM sum_table;
SUM(f1) = 900
SELECT SUM(f1) = 100 FROM sum_table;
SUM(f1) = 100
1
SET AUTOCOMMIT=OFF;
START TRANSACTION;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t900 SET f1 = 3;
UPDATE t100 SET f1 = 3;
COMMIT;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
include/diff_servers.inc [servers=1 2]
DROP SCHEMA test;
CREATE SCHEMA test;
......@@ -26,28 +26,6 @@ VARIABLE_VALUE = 'Primary'
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
SET GLOBAL wsrep_cluster_address = 'gcomm://192.0.2.1';
SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS;
COUNT(*) > 0
1
SHOW STATUS LIKE 'wsrep_ready';
Variable_name Value
wsrep_ready OFF
SHOW STATUS LIKE 'wsrep_cluster_status';
Variable_name Value
wsrep_cluster_status non-Primary
SHOW STATUS LIKE 'wsrep_local_state';
Variable_name Value
wsrep_local_state 0
SHOW STATUS LIKE 'wsrep_local_state_comment';
Variable_name Value
wsrep_local_state_comment Initialized
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE = 'Primary'
1
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
CALL mtr.add_suppression("Backend not supported: foo");
CALL mtr.add_suppression("Failed to initialize backend using 'foo");
CALL mtr.add_suppression("Failed to open channel 'my_wsrep_cluster' at 'foo");
......
......@@ -38,6 +38,9 @@ SHOW STATUS LIKE 'wsrep_desync_count';
# Resync node_2, should pass:
SET @@global.wsrep_desync = 0;
--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
--source include/wait_condition.inc
SET SESSION wsrep_sync_wait=7;
SHOW CREATE TABLE t1;
DROP TABLE t1;
......
......@@ -5,4 +5,5 @@ innodb_log_file_size=110M
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.recover=yes;pc.ignore_sb=true;'
[mysqld.2]
innodb_log_file_size=110M
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.recover=yes;pc.ignore_sb=true;'
......@@ -7,18 +7,12 @@ if (!`SELECT @@open_files_limit >= 1024`){
}
#
# This test forces 900 tables with a PK to participate in a single
# transaction. The reason for 900 is that some linux system has by default
# a limit of 1024 open files / process
#
#
# First, create 900 tables and make sure the DDLs are all propagated
# First, create 100 tables and make sure the DDLs are all propagated
#
--connection node_1
--let $count = 900
--let $count = 100
while ($count)
{
--disable_query_log
......@@ -29,7 +23,7 @@ while ($count)
}
--connection node_2
SELECT COUNT(*) = 900 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%';
SELECT COUNT(*) = 100 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%';
#
# Second, create a transaction that uses all those tables
......@@ -39,7 +33,7 @@ SELECT COUNT(*) = 900 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test'
SET AUTOCOMMIT=OFF;
START TRANSACTION;
--let $count = 900
--let $count = 100
while ($count)
{
--disable_query_log
......@@ -58,7 +52,7 @@ COMMIT;
--connection node_2
CREATE TABLE sum_table (f1 INTEGER);
--let $count = 900
--let $count = 100
while ($count)
{
--disable_query_log
......@@ -68,7 +62,7 @@ while ($count)
--dec $count
}
SELECT SUM(f1) = 900 FROM sum_table;
SELECT SUM(f1) = 100 FROM sum_table;
#
# Fourth, create a deadlock
......@@ -78,7 +72,7 @@ SELECT SUM(f1) = 900 FROM sum_table;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
--let $count = 900
--let $count = 100
while ($count)
{
--disable_query_log
......@@ -91,7 +85,7 @@ while ($count)
--connection node_2
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t900 SET f1 = 3;
UPDATE t100 SET f1 = 3;
--connection node_1
COMMIT;
......@@ -100,5 +94,8 @@ COMMIT;
--error ER_LOCK_DEADLOCK
COMMIT;
--let $diff_servers = 1 2
--source include/diff_servers.inc
DROP SCHEMA test;
CREATE SCHEMA test;
......@@ -58,39 +58,6 @@ SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VA
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
#
# Set to invalid host
#
--connection node_2
SET GLOBAL wsrep_cluster_address = 'gcomm://192.0.2.1';
--error 0
SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS;
# Must return 'OFF'
SHOW STATUS LIKE 'wsrep_ready';
# Must return 'Non-primary'
SHOW STATUS LIKE 'wsrep_cluster_status';
# Must return 0 = 'Initialized'
SHOW STATUS LIKE 'wsrep_local_state';
SHOW STATUS LIKE 'wsrep_local_state_comment';
#
# Reset everything as it was
#
--connection node_2
--disable_query_log
--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_node2';
--enable_query_log
--connection node_1
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--connection node_2
CALL mtr.add_suppression("Backend not supported: foo");
CALL mtr.add_suppression("Failed to initialize backend using 'foo");
......@@ -109,3 +76,4 @@ CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://192.0.2.1\\) failed: 7
--source include/galera_end.inc
--echo # End of test
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