Skip to content

Commit 64bb59f

Browse files
committed
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: Sachin Setiya <sachinsetia1001@gmail.com>
1 parent 451bf72 commit 64bb59f

8 files changed

+26
-74
lines changed

mysql-test/suite/galera/galera_2nodes.cnf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ default-storage-engine=innodb
88
wsrep-provider=@ENV.WSREP_PROVIDER
99
wsrep_node_address=127.0.0.1
1010
wsrep_cluster_address='gcomm://'
11-
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'
11+
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'
1212

1313
# enforce read-committed characteristics across the cluster
1414
wsrep-causal-reads=ON

mysql-test/suite/galera/r/GAL-401.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ SHOW STATUS LIKE 'wsrep_desync_count';
99
Variable_name Value
1010
wsrep_desync_count 0
1111
SET @@global.wsrep_desync = 0;
12+
SET SESSION wsrep_sync_wait=7;
1213
SHOW CREATE TABLE t1;
1314
Table Create Table
1415
t1 CREATE TABLE `t1` (
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
SELECT COUNT(*) = 1000 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%';
2-
COUNT(*) = 1000
1+
SELECT COUNT(*) = 100 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%';
2+
COUNT(*) = 100
33
1
44
SET AUTOCOMMIT=OFF;
55
START TRANSACTION;
66
COMMIT;
77
CREATE TABLE sum_table (f1 INTEGER);
8-
SELECT SUM(f1) = 1000 FROM sum_table;
9-
SUM(f1) = 1000
8+
SELECT SUM(f1) = 100 FROM sum_table;
9+
SUM(f1) = 100
1010
1
1111
SET AUTOCOMMIT=OFF;
1212
START TRANSACTION;
1313
SET AUTOCOMMIT=OFF;
1414
START TRANSACTION;
15-
UPDATE t1000 SET f1 = 3;
15+
UPDATE t100 SET f1 = 3;
1616
COMMIT;
1717
COMMIT;
1818
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
19+
include/diff_servers.inc [servers=1 2]
1920
DROP SCHEMA test;
2021
CREATE SCHEMA test;

mysql-test/suite/galera/r/galera_var_cluster_address.result

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,6 @@ VARIABLE_VALUE = 'Primary'
2626
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
2727
VARIABLE_VALUE = 2
2828
1
29-
SET GLOBAL wsrep_cluster_address = 'gcomm://192.0.2.1';
30-
SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS;
31-
COUNT(*) > 0
32-
1
33-
SHOW STATUS LIKE 'wsrep_ready';
34-
Variable_name Value
35-
wsrep_ready ON
36-
SHOW STATUS LIKE 'wsrep_cluster_status';
37-
Variable_name Value
38-
wsrep_cluster_status Primary
39-
SHOW STATUS LIKE 'wsrep_local_state';
40-
Variable_name Value
41-
wsrep_local_state 4
42-
SHOW STATUS LIKE 'wsrep_local_state_comment';
43-
Variable_name Value
44-
wsrep_local_state_comment Synced
45-
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
46-
VARIABLE_VALUE = 'Primary'
47-
1
48-
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
49-
VARIABLE_VALUE = 2
50-
1
5129
CALL mtr.add_suppression("Backend not supported: foo");
5230
CALL mtr.add_suppression("Failed to initialize backend using 'foo");
5331
CALL mtr.add_suppression("Failed to open channel 'my_wsrep_cluster' at 'foo");
@@ -58,5 +36,4 @@ CALL mtr.add_suppression("failed to open gcomm backend connection: 110: failed t
5836
CALL mtr.add_suppression("Failed to open backend connection: -110 \\(Connection timed out\\)");
5937
CALL mtr.add_suppression("gcs connect failed: Connection timed out");
6038
CALL mtr.add_suppression("WSREP: wsrep::connect\\(foo://\\) failed: 7");
61-
CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://192.0.2.1\\) failed: 7");
6239
# End of test

mysql-test/suite/galera/t/GAL-401.test

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ SHOW STATUS LIKE 'wsrep_desync_count';
3838

3939
# Resync node_2, should pass:
4040
SET @@global.wsrep_desync = 0;
41+
42+
--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
43+
--source include/wait_condition.inc
44+
45+
SET SESSION wsrep_sync_wait=7;
4146
SHOW CREATE TABLE t1;
4247
DROP TABLE t1;
4348
CALL mtr.add_suppression("WSREP: Protocol violation. JOIN message sender (.*) is not in state transfer \\(SYNCED\\). Message ignored.");

mysql-test/suite/galera/t/galera_gcache_recover_manytrx.cnf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ innodb_log_file_size=110M
55
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.recover=yes;pc.ignore_sb=true;'
66

77
[mysqld.2]
8+
innodb_log_file_size=110M
89
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.recover=yes;pc.ignore_sb=true;'

mysql-test/suite/galera/t/galera_many_tables_pk.test

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
--source include/have_innodb.inc
44

55
#
6-
# This test forces 1K tables with a PK to participate in a single transaction
6+
# This test forces 100 tables with a PK to participate in a single transaction
77
#
88

99
#
10-
# First, create 1K tables and make sure the DDLs are all propagated
10+
# First, create 100 tables and make sure the DDLs are all propagated
1111
#
1212

1313
--connection node_1
1414

15-
--let $count = 1000
15+
--let $count = 100
1616
while ($count)
1717
{
1818
--disable_query_log
@@ -23,7 +23,7 @@ while ($count)
2323
}
2424

2525
--connection node_2
26-
SELECT COUNT(*) = 1000 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%';
26+
SELECT COUNT(*) = 100 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%';
2727

2828
#
2929
# Second, create a transaction that uses all those tables
@@ -33,7 +33,7 @@ SELECT COUNT(*) = 1000 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test
3333
SET AUTOCOMMIT=OFF;
3434
START TRANSACTION;
3535

36-
--let $count = 1000
36+
--let $count = 100
3737
while ($count)
3838
{
3939
--disable_query_log
@@ -52,7 +52,7 @@ COMMIT;
5252
--connection node_2
5353
CREATE TABLE sum_table (f1 INTEGER);
5454

55-
--let $count = 1000
55+
--let $count = 100
5656
while ($count)
5757
{
5858
--disable_query_log
@@ -62,7 +62,7 @@ while ($count)
6262
--dec $count
6363
}
6464

65-
SELECT SUM(f1) = 1000 FROM sum_table;
65+
SELECT SUM(f1) = 100 FROM sum_table;
6666

6767
#
6868
# Fourth, create a deadlock
@@ -72,7 +72,7 @@ SELECT SUM(f1) = 1000 FROM sum_table;
7272
SET AUTOCOMMIT=OFF;
7373
START TRANSACTION;
7474

75-
--let $count = 1000
75+
--let $count = 100
7676
while ($count)
7777
{
7878
--disable_query_log
@@ -85,7 +85,7 @@ while ($count)
8585
--connection node_2
8686
SET AUTOCOMMIT=OFF;
8787
START TRANSACTION;
88-
UPDATE t1000 SET f1 = 3;
88+
UPDATE t100 SET f1 = 3;
8989

9090
--connection node_1
9191
COMMIT;
@@ -94,5 +94,8 @@ COMMIT;
9494
--error ER_LOCK_DEADLOCK
9595
COMMIT;
9696

97+
--let $diff_servers = 1 2
98+
--source include/diff_servers.inc
99+
97100
DROP SCHEMA test;
98101
CREATE SCHEMA test;

mysql-test/suite/galera/t/galera_var_cluster_address.test

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -58,41 +58,6 @@ SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VA
5858
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
5959
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
6060

61-
#
62-
# Set to invalid host
63-
#
64-
65-
--connection node_2
66-
SET GLOBAL wsrep_cluster_address = 'gcomm://192.0.2.1';
67-
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
68-
--source include/wait_condition.inc
69-
70-
--error 0
71-
SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS;
72-
73-
# Must return 'OFF'
74-
SHOW STATUS LIKE 'wsrep_ready';
75-
76-
# Must return 'Non-primary'
77-
SHOW STATUS LIKE 'wsrep_cluster_status';
78-
79-
# Must return 0 = 'Initialized'
80-
SHOW STATUS LIKE 'wsrep_local_state';
81-
SHOW STATUS LIKE 'wsrep_local_state_comment';
82-
83-
#
84-
# Reset everything as it was
85-
#
86-
87-
--connection node_2
88-
--disable_query_log
89-
--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_node2';
90-
--enable_query_log
91-
92-
--connection node_1
93-
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
94-
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
95-
9661
--connection node_2
9762
CALL mtr.add_suppression("Backend not supported: foo");
9863
CALL mtr.add_suppression("Failed to initialize backend using 'foo");
@@ -104,7 +69,6 @@ CALL mtr.add_suppression("failed to open gcomm backend connection: 110: failed t
10469
CALL mtr.add_suppression("Failed to open backend connection: -110 \\(Connection timed out\\)");
10570
CALL mtr.add_suppression("gcs connect failed: Connection timed out");
10671
CALL mtr.add_suppression("WSREP: wsrep::connect\\(foo://\\) failed: 7");
107-
CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://192.0.2.1\\) failed: 7");
10872
# Restore original auto_increment_offset values.
10973
--source include/auto_increment_offset_restore.inc
11074

0 commit comments

Comments
 (0)