Skip to content

Commit

Permalink
Galera MTR Tests: stability fixes
Browse files Browse the repository at this point in the history
 * 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: Sachin Setiya <sachinsetia1001@gmail.com>
  • Loading branch information
SachinSetiya committed Mar 14, 2017
1 parent 451bf72 commit 64bb59f
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 74 deletions.
2 changes: 1 addition & 1 deletion mysql-test/suite/galera/galera_2nodes.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ default-storage-engine=innodb
wsrep-provider=@ENV.WSREP_PROVIDER
wsrep_node_address=127.0.0.1
wsrep_cluster_address='gcomm://'
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M'

# enforce read-committed characteristics across the cluster
wsrep-causal-reads=ON
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/galera/r/GAL-401.result
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ SHOW STATUS LIKE 'wsrep_desync_count';
Variable_name Value
wsrep_desync_count 0
SET @@global.wsrep_desync = 0;
SET SESSION wsrep_sync_wait=7;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
Expand Down
11 changes: 6 additions & 5 deletions mysql-test/suite/galera/r/galera_many_tables_pk.result
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
SELECT COUNT(*) = 1000 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%';
COUNT(*) = 1000
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) = 1000 FROM sum_table;
SUM(f1) = 1000
SELECT SUM(f1) = 100 FROM sum_table;
SUM(f1) = 100
1
SET AUTOCOMMIT=OFF;
START TRANSACTION;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t1000 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;
23 changes: 0 additions & 23 deletions mysql-test/suite/galera/r/galera_var_cluster_address.result
Original file line number Diff line number Diff line change
Expand Up @@ -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 ON
SHOW STATUS LIKE 'wsrep_cluster_status';
Variable_name Value
wsrep_cluster_status Primary
SHOW STATUS LIKE 'wsrep_local_state';
Variable_name Value
wsrep_local_state 4
SHOW STATUS LIKE 'wsrep_local_state_comment';
Variable_name Value
wsrep_local_state_comment Synced
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");
Expand All @@ -58,5 +36,4 @@ CALL mtr.add_suppression("failed to open gcomm backend connection: 110: failed t
CALL mtr.add_suppression("Failed to open backend connection: -110 \\(Connection timed out\\)");
CALL mtr.add_suppression("gcs connect failed: Connection timed out");
CALL mtr.add_suppression("WSREP: wsrep::connect\\(foo://\\) failed: 7");
CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://192.0.2.1\\) failed: 7");
# End of test
5 changes: 5 additions & 0 deletions mysql-test/suite/galera/t/GAL-401.test
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ 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;
CALL mtr.add_suppression("WSREP: Protocol violation. JOIN message sender (.*) is not in state transfer \\(SYNCED\\). Message ignored.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;'
21 changes: 12 additions & 9 deletions mysql-test/suite/galera/t/galera_many_tables_pk.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
--source include/have_innodb.inc

#
# This test forces 1K tables with a PK to participate in a single transaction
# This test forces 100 tables with a PK to participate in a single transaction
#

#
# First, create 1K 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 = 1000
--let $count = 100
while ($count)
{
--disable_query_log
Expand All @@ -23,7 +23,7 @@ while ($count)
}

--connection node_2
SELECT COUNT(*) = 1000 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
Expand All @@ -33,7 +33,7 @@ SELECT COUNT(*) = 1000 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test
SET AUTOCOMMIT=OFF;
START TRANSACTION;

--let $count = 1000
--let $count = 100
while ($count)
{
--disable_query_log
Expand All @@ -52,7 +52,7 @@ COMMIT;
--connection node_2
CREATE TABLE sum_table (f1 INTEGER);

--let $count = 1000
--let $count = 100
while ($count)
{
--disable_query_log
Expand All @@ -62,7 +62,7 @@ while ($count)
--dec $count
}

SELECT SUM(f1) = 1000 FROM sum_table;
SELECT SUM(f1) = 100 FROM sum_table;

#
# Fourth, create a deadlock
Expand All @@ -72,7 +72,7 @@ SELECT SUM(f1) = 1000 FROM sum_table;
SET AUTOCOMMIT=OFF;
START TRANSACTION;

--let $count = 1000
--let $count = 100
while ($count)
{
--disable_query_log
Expand All @@ -85,7 +85,7 @@ while ($count)
--connection node_2
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t1000 SET f1 = 3;
UPDATE t100 SET f1 = 3;

--connection node_1
COMMIT;
Expand All @@ -94,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;
36 changes: 0 additions & 36 deletions mysql-test/suite/galera/t/galera_var_cluster_address.test
Original file line number Diff line number Diff line change
Expand Up @@ -58,41 +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';
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc

--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");
Expand All @@ -104,7 +69,6 @@ CALL mtr.add_suppression("failed to open gcomm backend connection: 110: failed t
CALL mtr.add_suppression("Failed to open backend connection: -110 \\(Connection timed out\\)");
CALL mtr.add_suppression("gcs connect failed: Connection timed out");
CALL mtr.add_suppression("WSREP: wsrep::connect\\(foo://\\) failed: 7");
CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://192.0.2.1\\) failed: 7");
# Restore original auto_increment_offset values.
--source include/auto_increment_offset_restore.inc

Expand Down

0 comments on commit 64bb59f

Please sign in to comment.