Galera MTR Tests: Enable the use of --parallel for port-intensive Galera tests by additionally specifying --port-group-size=50
This commit is contained in:
parent
9f716ae9d3
commit
f8b724db28
@ -363,6 +363,7 @@ my $opt_max_save_datadir= env_or_val(MTR_MAX_SAVE_DATADIR => 20);
|
||||
my $opt_max_test_fail= env_or_val(MTR_MAX_TEST_FAIL => 10);
|
||||
|
||||
my $opt_parallel= $ENV{MTR_PARALLEL} || 1;
|
||||
my $opt_port_group_size = $ENV{MTR_PORT_GROUP_SIZE} || 10;
|
||||
|
||||
# lock file to stop tests
|
||||
my $opt_stop_file= $ENV{MTR_STOP_FILE};
|
||||
@ -1147,6 +1148,7 @@ sub command_line_setup {
|
||||
# Specify ports
|
||||
'build-thread|mtr-build-thread=i' => \$opt_build_thread,
|
||||
'port-base|mtr-port-base=i' => \$opt_port_base,
|
||||
'port-group-size=s' => \$opt_port_group_size,
|
||||
|
||||
# Test case authoring
|
||||
'record' => \$opt_record,
|
||||
@ -1838,16 +1840,16 @@ sub set_build_thread_ports($) {
|
||||
$ENV{MTR_BUILD_THREAD}= $build_thread;
|
||||
|
||||
# Calculate baseport
|
||||
$baseport= $build_thread * 20 + 10000;
|
||||
if ( $baseport < 5001 or $baseport + 19 >= 32767 )
|
||||
$baseport= $build_thread * $opt_port_group_size + 10000;
|
||||
if ( $baseport < 5001 or $baseport + $opt_port_group_size >= 32767 )
|
||||
{
|
||||
mtr_error("MTR_BUILD_THREAD number results in a port",
|
||||
"outside 5001 - 32767",
|
||||
"($baseport - $baseport + 19)");
|
||||
"($baseport - $baseport + $opt_port_group_size)");
|
||||
}
|
||||
|
||||
mtr_report("Using MTR_BUILD_THREAD $build_thread,",
|
||||
"with reserved ports $baseport..".($baseport+19));
|
||||
"with reserved ports $baseport..".($baseport+($opt_port_group_size-1)));
|
||||
|
||||
}
|
||||
|
||||
@ -3392,8 +3394,8 @@ sub kill_leftovers ($) {
|
||||
sub check_ports_free ($)
|
||||
{
|
||||
my $bthread= shift;
|
||||
my $portbase = $bthread * 10 + 10000;
|
||||
for ($portbase..$portbase+9){
|
||||
my $portbase = $bthread * $opt_port_group_size + 10000;
|
||||
for ($portbase..$portbase+($opt_port_group_size-1)){
|
||||
if (mtr_ping_port($_)){
|
||||
mtr_report(" - 'localhost:$_' was not free");
|
||||
return 0; # One port was not free
|
||||
@ -6493,6 +6495,8 @@ Options that specify ports
|
||||
build-thread=# Can be set in environment variable MTR_BUILD_THREAD.
|
||||
Set MTR_BUILD_THREAD="auto" to automatically aquire
|
||||
a build thread id that is unique to current host
|
||||
port-group-size=N Reserve groups of TCP ports of size N for each MTR thread
|
||||
|
||||
|
||||
Options for test case authoring
|
||||
|
||||
|
@ -4,13 +4,13 @@ CREATE TABLE t1 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 VARCHAR(100), FULLTEXT (f
|
||||
SELECT COUNT(*) = 13 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name LIKE 'test/%';
|
||||
COUNT(*) = 13
|
||||
1
|
||||
INSERT INTO t1 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
|
||||
SELECT COUNT(f2) = 10000 FROM t1 WHERE MATCH(f2) AGAINST ('foobarbaz');
|
||||
COUNT(f2) = 10000
|
||||
INSERT INTO t1 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3;
|
||||
SELECT COUNT(f2) = 1000 FROM t1 WHERE MATCH(f2) AGAINST ('foobarbaz');
|
||||
COUNT(f2) = 1000
|
||||
1
|
||||
UPDATE t1 SET f2 = 'abcdefjhk';
|
||||
SELECT COUNT(f2) = 10000 FROM t1 WHERE MATCH(f2) AGAINST ('abcdefjhk');
|
||||
COUNT(f2) = 10000
|
||||
SELECT COUNT(f2) = 1000 FROM t1 WHERE MATCH(f2) AGAINST ('abcdefjhk');
|
||||
COUNT(f2) = 1000
|
||||
1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (f1 VARCHAR(100), FULLTEXT (f1)) ENGINE=InnoDB;
|
||||
|
@ -1,3 +1,5 @@
|
||||
SET SESSION innodb_lock_wait_timeout=300;
|
||||
SET SESSION lock_wait_timeout=300;
|
||||
CREATE TABLE ten (f1 INTEGER);
|
||||
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
|
||||
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB;
|
||||
|
@ -7,12 +7,12 @@ UPDATE t1 SET f2 = 'b' WHERE f1 = 1;
|
||||
SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE;
|
||||
f1 f2
|
||||
2 a
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_enter_sync';
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
|
||||
COMMIT;;
|
||||
SET SESSION wsrep_sync_wait = 0;
|
||||
UPDATE t1 SET f2 = 'c' WHERE f1 = 2;
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=';
|
||||
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_enter_sync';
|
||||
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync';
|
||||
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'b';
|
||||
COUNT(*) = 1
|
||||
1
|
||||
|
@ -24,16 +24,16 @@ SELECT COUNT(*) = 13 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name LIKE '
|
||||
#
|
||||
|
||||
--connection node_1
|
||||
# Insert 10K rows
|
||||
INSERT INTO t1 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
|
||||
# Insert 1K rows
|
||||
INSERT INTO t1 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3;
|
||||
|
||||
--connection node_2
|
||||
SELECT COUNT(f2) = 10000 FROM t1 WHERE MATCH(f2) AGAINST ('foobarbaz');
|
||||
SELECT COUNT(f2) = 1000 FROM t1 WHERE MATCH(f2) AGAINST ('foobarbaz');
|
||||
|
||||
UPDATE t1 SET f2 = 'abcdefjhk';
|
||||
|
||||
--connection node_1
|
||||
SELECT COUNT(f2) = 10000 FROM t1 WHERE MATCH(f2) AGAINST ('abcdefjhk');
|
||||
SELECT COUNT(f2) = 1000 FROM t1 WHERE MATCH(f2) AGAINST ('abcdefjhk');
|
||||
|
||||
--connection node_2
|
||||
|
||||
|
@ -3,6 +3,10 @@
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--connection node_1
|
||||
SET SESSION innodb_lock_wait_timeout=300;
|
||||
SET SESSION lock_wait_timeout=300;
|
||||
|
||||
CREATE TABLE ten (f1 INTEGER);
|
||||
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
|
||||
|
||||
|
@ -22,6 +22,7 @@ INSERT INTO t1 VALUES (1);
|
||||
--let $galera_server_number = 2
|
||||
--source include/galera_connect.inc
|
||||
--connection node_2a
|
||||
--source include/galera_wait_ready.inc
|
||||
|
||||
SELECT COUNT(*) = 1 FROM t1;
|
||||
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
|
@ -23,7 +23,7 @@ SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE;
|
||||
|
||||
# Block the commit
|
||||
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_enter_sync';
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
|
||||
|
||||
--connection node_1
|
||||
--send COMMIT;
|
||||
@ -31,7 +31,7 @@ SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_enter_sync';
|
||||
# Wait until commit is blocked
|
||||
--connection node_1a
|
||||
SET SESSION wsrep_sync_wait = 0;
|
||||
--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'
|
||||
--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'
|
||||
--source include/wait_condition.inc
|
||||
|
||||
# Issue a conflicting update on node #2
|
||||
@ -41,7 +41,7 @@ UPDATE t1 SET f2 = 'c' WHERE f1 = 2;
|
||||
# Unblock the commit
|
||||
--connection node_1a
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=';
|
||||
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_enter_sync';
|
||||
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync';
|
||||
|
||||
# Commit succeeds
|
||||
--connection node_1
|
||||
|
@ -15,3 +15,6 @@ SELECT COUNT(*) = 2 FROM t1;
|
||||
COUNT(*) = 2
|
||||
1
|
||||
DROP TABLE t1;
|
||||
CALL mtr.add_suppression("SYNC message from member 1 in non-primary configuration");
|
||||
CALL mtr.add_suppression("SYNC message from member 1 in non-primary configuration");
|
||||
CALL mtr.add_suppression("SYNC message from member 1 in non-primary configuration");
|
||||
|
@ -12,3 +12,6 @@ COUNT(*) = 2
|
||||
1
|
||||
DROP TABLE t1;
|
||||
Restarting node #3 to satisfy MTR's end-of-test checks
|
||||
CALL mtr.add_suppression("WSREP: Protocol violation\. JOIN message sender 1\.0 \(.*\) is not in state transfer \(SYNCED\)");
|
||||
CALL mtr.add_suppression("WSREP: Protocol violation\. JOIN message sender 1\.0 \(.*\) is not in state transfer \(SYNCED\)");
|
||||
CALL mtr.add_suppression("WSREP: Protocol violation\. JOIN message sender 1\.0 \(.*\) is not in state transfer \(SYNCED\)");
|
||||
|
@ -39,9 +39,6 @@ SHOW STATUS LIKE 'wsrep_local_state_comment';
|
||||
Variable_name Value
|
||||
wsrep_local_state_comment Initialized
|
||||
Resuming node ...
|
||||
SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
VARIABLE_VALUE = 1
|
||||
1
|
||||
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
|
||||
VARIABLE_VALUE = 'Primary'
|
||||
1
|
||||
@ -57,6 +54,7 @@ VARIABLE_VALUE = 4
|
||||
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
|
||||
VARIABLE_VALUE = 'Synced'
|
||||
1
|
||||
SET GLOBAL wsrep_provider_options = 'pc.weight=1';
|
||||
SET SESSION wsrep_sync_wait=0;
|
||||
SET SESSION wsrep_sync_wait=0;
|
||||
SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
@ -113,6 +111,9 @@ VARIABLE_VALUE = 4
|
||||
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
|
||||
VARIABLE_VALUE = 'Synced'
|
||||
1
|
||||
SET GLOBAL wsrep_provider_options = 'pc.weight=1';
|
||||
CALL mtr.add_suppression('WSREP: gcs_caused\\(\\) returned -1');
|
||||
CALL mtr.add_suppression('overriding reported weight for');
|
||||
CALL mtr.add_suppression('WSREP: user message in state LEAVING');
|
||||
CALL mtr.add_suppression('sending install message failed: Transport endpoint is not connected');
|
||||
CALL mtr.add_suppression('overriding reported weight for');
|
||||
|
@ -48,3 +48,15 @@ DROP TABLE t1;
|
||||
--echo Restarting node #3 to satisfy MTR's end-of-test checks
|
||||
--connection node_3
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
|
||||
# Workaround for galera#101
|
||||
|
||||
--connection node_1
|
||||
CALL mtr.add_suppression("WSREP: Protocol violation\. JOIN message sender 1\.0 \(.*\) is not in state transfer \(SYNCED\)");
|
||||
|
||||
--connection node_2
|
||||
CALL mtr.add_suppression("WSREP: Protocol violation\. JOIN message sender 1\.0 \(.*\) is not in state transfer \(SYNCED\)");
|
||||
|
||||
--connection node_3
|
||||
CALL mtr.add_suppression("WSREP: Protocol violation\. JOIN message sender 1\.0 \(.*\) is not in state transfer \(SYNCED\)");
|
||||
|
@ -7,7 +7,7 @@
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--let $wsrep_provider_options_node1 = `SELECT @@wsrep_provider_options`
|
||||
--connection node_1
|
||||
SET GLOBAL wsrep_provider_options = 'pc.weight=3';
|
||||
|
||||
--source include/wait_until_connected_again.inc
|
||||
@ -50,13 +50,17 @@ SHOW STATUS LIKE 'wsrep_local_state_comment';
|
||||
|
||||
# For Node #1, we expect a primary component of size 1
|
||||
|
||||
SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
|
||||
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected';
|
||||
SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
|
||||
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
|
||||
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
|
||||
|
||||
SET GLOBAL wsrep_provider_options = 'pc.weight=1';
|
||||
|
||||
# Restore the cluster by resetting wsrep_cluster_address on nodes #1 and #2
|
||||
|
||||
--connection node_2
|
||||
@ -103,8 +107,17 @@ SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_N
|
||||
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
|
||||
|
||||
--connection node_1
|
||||
|
||||
SET GLOBAL wsrep_provider_options = 'pc.weight=1';
|
||||
--let $wait_condition = SELECT @@wsrep_provider_options LIKE '%pc.weight = 1%'
|
||||
--source include/wait_condition.inc
|
||||
|
||||
CALL mtr.add_suppression('WSREP: gcs_caused\\(\\) returned -1');
|
||||
|
||||
--connection node_2
|
||||
CALL mtr.add_suppression('overriding reported weight for');
|
||||
|
||||
--connection node_3
|
||||
CALL mtr.add_suppression('WSREP: user message in state LEAVING');
|
||||
CALL mtr.add_suppression('sending install message failed: Transport endpoint is not connected');
|
||||
CALL mtr.add_suppression('overriding reported weight for');
|
||||
|
Loading…
x
Reference in New Issue
Block a user