Skip to content

Commit f8b724d

Browse files
philip-galeraNirbhay Choubey
authored andcommitted
Galera MTR Tests: Enable the use of --parallel for port-intensive Galera tests by additionally specifying --port-group-size=50
1 parent 9f716ae commit f8b724d

13 files changed

+68
-25
lines changed

mysql-test/mysql-test-run.pl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ ($)
363363
my $opt_max_test_fail= env_or_val(MTR_MAX_TEST_FAIL => 10);
364364

365365
my $opt_parallel= $ENV{MTR_PARALLEL} || 1;
366+
my $opt_port_group_size = $ENV{MTR_PORT_GROUP_SIZE} || 10;
366367

367368
# lock file to stop tests
368369
my $opt_stop_file= $ENV{MTR_STOP_FILE};
@@ -1147,6 +1148,7 @@ sub command_line_setup {
11471148
# Specify ports
11481149
'build-thread|mtr-build-thread=i' => \$opt_build_thread,
11491150
'port-base|mtr-port-base=i' => \$opt_port_base,
1151+
'port-group-size=s' => \$opt_port_group_size,
11501152

11511153
# Test case authoring
11521154
'record' => \$opt_record,
@@ -1838,16 +1840,16 @@ ($)
18381840
$ENV{MTR_BUILD_THREAD}= $build_thread;
18391841

18401842
# Calculate baseport
1841-
$baseport= $build_thread * 20 + 10000;
1842-
if ( $baseport < 5001 or $baseport + 19 >= 32767 )
1843+
$baseport= $build_thread * $opt_port_group_size + 10000;
1844+
if ( $baseport < 5001 or $baseport + $opt_port_group_size >= 32767 )
18431845
{
18441846
mtr_error("MTR_BUILD_THREAD number results in a port",
18451847
"outside 5001 - 32767",
1846-
"($baseport - $baseport + 19)");
1848+
"($baseport - $baseport + $opt_port_group_size)");
18471849
}
18481850

18491851
mtr_report("Using MTR_BUILD_THREAD $build_thread,",
1850-
"with reserved ports $baseport..".($baseport+19));
1852+
"with reserved ports $baseport..".($baseport+($opt_port_group_size-1)));
18511853

18521854
}
18531855

@@ -3392,8 +3394,8 @@ ($)
33923394
sub check_ports_free ($)
33933395
{
33943396
my $bthread= shift;
3395-
my $portbase = $bthread * 10 + 10000;
3396-
for ($portbase..$portbase+9){
3397+
my $portbase = $bthread * $opt_port_group_size + 10000;
3398+
for ($portbase..$portbase+($opt_port_group_size-1)){
33973399
if (mtr_ping_port($_)){
33983400
mtr_report(" - 'localhost:$_' was not free");
33993401
return 0; # One port was not free
@@ -6493,6 +6495,8 @@ ($)
64936495
build-thread=# Can be set in environment variable MTR_BUILD_THREAD.
64946496
Set MTR_BUILD_THREAD="auto" to automatically aquire
64956497
a build thread id that is unique to current host
6498+
port-group-size=N Reserve groups of TCP ports of size N for each MTR thread
6499+
64966500
64976501
Options for test case authoring
64986502

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ CREATE TABLE t1 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 VARCHAR(100), FULLTEXT (f
44
SELECT COUNT(*) = 13 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name LIKE 'test/%';
55
COUNT(*) = 13
66
1
7-
INSERT INTO t1 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
8-
SELECT COUNT(f2) = 10000 FROM t1 WHERE MATCH(f2) AGAINST ('foobarbaz');
9-
COUNT(f2) = 10000
7+
INSERT INTO t1 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3;
8+
SELECT COUNT(f2) = 1000 FROM t1 WHERE MATCH(f2) AGAINST ('foobarbaz');
9+
COUNT(f2) = 1000
1010
1
1111
UPDATE t1 SET f2 = 'abcdefjhk';
12-
SELECT COUNT(f2) = 10000 FROM t1 WHERE MATCH(f2) AGAINST ('abcdefjhk');
13-
COUNT(f2) = 10000
12+
SELECT COUNT(f2) = 1000 FROM t1 WHERE MATCH(f2) AGAINST ('abcdefjhk');
13+
COUNT(f2) = 1000
1414
1
1515
DROP TABLE t1;
1616
CREATE TABLE t1 (f1 VARCHAR(100), FULLTEXT (f1)) ENGINE=InnoDB;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
SET SESSION innodb_lock_wait_timeout=300;
2+
SET SESSION lock_wait_timeout=300;
13
CREATE TABLE ten (f1 INTEGER);
24
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
35
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ UPDATE t1 SET f2 = 'b' WHERE f1 = 1;
77
SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE;
88
f1 f2
99
2 a
10-
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_enter_sync';
10+
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
1111
COMMIT;;
1212
SET SESSION wsrep_sync_wait = 0;
1313
UPDATE t1 SET f2 = 'c' WHERE f1 = 2;
1414
SET GLOBAL wsrep_provider_options = 'dbug=';
15-
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_enter_sync';
15+
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync';
1616
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'b';
1717
COUNT(*) = 1
1818
1

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ SELECT COUNT(*) = 13 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name LIKE '
2424
#
2525

2626
--connection node_1
27-
# Insert 10K rows
28-
INSERT INTO t1 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
27+
# Insert 1K rows
28+
INSERT INTO t1 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3;
2929

3030
--connection node_2
31-
SELECT COUNT(f2) = 10000 FROM t1 WHERE MATCH(f2) AGAINST ('foobarbaz');
31+
SELECT COUNT(f2) = 1000 FROM t1 WHERE MATCH(f2) AGAINST ('foobarbaz');
3232

3333
UPDATE t1 SET f2 = 'abcdefjhk';
3434

3535
--connection node_1
36-
SELECT COUNT(f2) = 10000 FROM t1 WHERE MATCH(f2) AGAINST ('abcdefjhk');
36+
SELECT COUNT(f2) = 1000 FROM t1 WHERE MATCH(f2) AGAINST ('abcdefjhk');
3737

3838
--connection node_2
3939

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
--source include/galera_cluster.inc
44
--source include/have_innodb.inc
55

6+
--connection node_1
7+
SET SESSION innodb_lock_wait_timeout=300;
8+
SET SESSION lock_wait_timeout=300;
9+
610
CREATE TABLE ten (f1 INTEGER);
711
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
812

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ INSERT INTO t1 VALUES (1);
2222
--let $galera_server_number = 2
2323
--source include/galera_connect.inc
2424
--connection node_2a
25+
--source include/galera_wait_ready.inc
2526

2627
SELECT COUNT(*) = 1 FROM t1;
2728
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE;
2323

2424
# Block the commit
2525
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
26-
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_enter_sync';
26+
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
2727

2828
--connection node_1
2929
--send COMMIT;
3030

3131
# Wait until commit is blocked
3232
--connection node_1a
3333
SET SESSION wsrep_sync_wait = 0;
34-
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters' AND VARIABLE_VALUE = 'apply_monitor_enter_sync'
34+
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters' AND VARIABLE_VALUE = 'commit_monitor_enter_sync'
3535
--source include/wait_condition.inc
3636

3737
# Issue a conflicting update on node #2
@@ -41,7 +41,7 @@ UPDATE t1 SET f2 = 'c' WHERE f1 = 2;
4141
# Unblock the commit
4242
--connection node_1a
4343
SET GLOBAL wsrep_provider_options = 'dbug=';
44-
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_enter_sync';
44+
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync';
4545

4646
# Commit succeeds
4747
--connection node_1

mysql-test/suite/galera_3nodes/r/galera_certification_ccc.result

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ SELECT COUNT(*) = 2 FROM t1;
1515
COUNT(*) = 2
1616
1
1717
DROP TABLE t1;
18+
CALL mtr.add_suppression("SYNC message from member 1 in non-primary configuration");
19+
CALL mtr.add_suppression("SYNC message from member 1 in non-primary configuration");
20+
CALL mtr.add_suppression("SYNC message from member 1 in non-primary configuration");

mysql-test/suite/galera_3nodes/r/galera_garbd.result

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ COUNT(*) = 2
1212
1
1313
DROP TABLE t1;
1414
Restarting node #3 to satisfy MTR's end-of-test checks
15+
CALL mtr.add_suppression("WSREP: Protocol violation\. JOIN message sender 1\.0 \(.*\) is not in state transfer \(SYNCED\)");
16+
CALL mtr.add_suppression("WSREP: Protocol violation\. JOIN message sender 1\.0 \(.*\) is not in state transfer \(SYNCED\)");
17+
CALL mtr.add_suppression("WSREP: Protocol violation\. JOIN message sender 1\.0 \(.*\) is not in state transfer \(SYNCED\)");

0 commit comments

Comments
 (0)