Skip to content

Commit 887628a

Browse files
author
Nirbhay Choubey
committed
Test changes (backported from 10.1).
1 parent abf400e commit 887628a

File tree

13 files changed

+116
-103
lines changed

13 files changed

+116
-103
lines changed

mysql-test/lib/My/ConfigFactory.pm

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,6 @@ my @mysqld_rules=
238238
{ 'pid-file' => \&fix_pidfile },
239239
{ '#host' => \&fix_host },
240240
{ 'port' => \&fix_port },
241-
# galera base_port and port used during SST
242-
{ '#galera_port' => \&fix_port },
243-
{ '#sst_port' => \&fix_port },
244241
{ 'socket' => \&fix_socket },
245242
{ '#log-error' => \&fix_log_error },
246243
{ 'general-log' => 1 },

mysql-test/lib/mtr_cases.pm

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -862,8 +862,6 @@ sub collect_one_test_case {
862862
# Suite has no config, autodetect which one to use
863863
if ($tinfo->{rpl_test}) {
864864
$config= "suite/rpl/my.cnf";
865-
} elsif ($tinfo->{galera_test}) {
866-
$config= "suite/galera/my.cnf";
867865
} else {
868866
$config= "include/default_my.cnf";
869867
}
@@ -984,7 +982,6 @@ my $tags_map= {'big_test' => ['big_test', 1],
984982
'master-slave' => ['rpl_test', 1],
985983
'ndb_master-slave' => ['rpl_test', 1, 'ndb_test', 1],
986984
'long_test' => ['long_test', 1],
987-
'galera_init' => ['galera_test', 1],
988985
};
989986
my $tags_regex_string= join('|', keys %$tags_map);
990987
my $tags_regex= qr:include/($tags_regex_string)\.inc:o;

mysql-test/mysql-test-run.pl

Lines changed: 5 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ BEGIN
136136
my $opt_start_exit;
137137
my $start_only;
138138

139+
our @global_suppressions;
140+
139141
END {
140142
if ( defined $opt_tmpdir_pid and $opt_tmpdir_pid == $$ )
141143
{
@@ -187,6 +189,8 @@ END
187189
sys_vars-
188190
unit-
189191
vcol-
192+
wsrep-
193+
galera-
190194
);
191195
my $opt_suites;
192196

@@ -412,7 +416,6 @@ sub main {
412416
check_ndbcluster_support();
413417
check_ssl_support();
414418
check_debug_support();
415-
check_wsrep_support();
416419

417420
if (!$opt_suites) {
418421
$opt_suites= join ',', collect_default_suites(@DEFAULT_SUITES);
@@ -3175,50 +3178,6 @@ ($)
31753178
return 0;
31763179
}
31773180

3178-
sub have_wsrep() {
3179-
my $wsrep_on= $mysqld_variables{'wsrep-on'};
3180-
return defined $wsrep_on
3181-
}
3182-
3183-
sub check_wsrep_support() {
3184-
if (have_wsrep())
3185-
{
3186-
mtr_report(" - binaries built with wsrep patch");
3187-
3188-
# Add galera test suites
3189-
mtr_report(" - adding wsrep, galera to default test suites");
3190-
push @DEFAULT_SUITES, qw(wsrep galera);
3191-
3192-
# ADD scripts to $PATH to that wsrep_sst_* can be found
3193-
$ENV{'PATH'} = $ENV{'PATH'}.':'.$basedir.'/scripts';
3194-
3195-
# Check whether WSREP_PROVIDER environment variable is set.
3196-
if (defined $ENV{'WSREP_PROVIDER'}) {
3197-
if ((mtr_file_exists($ENV{'WSREP_PROVIDER'}) eq "") &&
3198-
($ENV{'WSREP_PROVIDER'} ne "none")) {
3199-
mtr_error("WSREP_PROVIDER env set to an invalid path");
3200-
}
3201-
# WSREP_PROVIDER is valid; set to a valid path or "none").
3202-
mtr_verbose("WSREP_PROVIDER env set to $ENV{'WSREP_PROVIDER'}");
3203-
} else {
3204-
# WSREP_PROVIDER env not defined. Lets try to locate the wsrep provider
3205-
# library.
3206-
my $file_wsrep_provider=
3207-
mtr_file_exists("/usr/lib/galera/libgalera_smm.so",
3208-
"/usr/lib64/galera/libgalera_smm.so");
3209-
3210-
if ($file_wsrep_provider ne "") {
3211-
# wsrep provider library found !
3212-
mtr_verbose("wsrep provider library found : $file_wsrep_provider");
3213-
$ENV{'WSREP_PROVIDER'}= $file_wsrep_provider;
3214-
} else {
3215-
mtr_verbose("Could not find wsrep provider library, setting it to 'none'");
3216-
$ENV{'WSREP_PROVIDER'}= "none";
3217-
}
3218-
}
3219-
}
3220-
}
3221-
32223181
sub mysql_server_start($) {
32233182
my ($mysqld, $tinfo) = @_;
32243183

@@ -4827,6 +4786,7 @@ ($$)
48274786
# Perl code.
48284787
my @antipatterns =
48294788
(
4789+
@global_suppressions,
48304790
qr/error .*connecting to master/,
48314791
qr/Plugin 'ndbcluster' will be forced to shutdown/,
48324792
qr/InnoDB: Error: in ALTER TABLE `test`.`t[12]`/,
@@ -4883,10 +4843,6 @@ ($$)
48834843
qr|InnoDB: Setting thread \d+ nice to \d+ failed, current nice \d+, errno 13|, # setpriority() fails under valgrind
48844844
qr|Failed to setup SSL|,
48854845
qr|SSL error: Failed to set ciphers to use|,
4886-
# Galera-related warnings.
4887-
qr|WSREP:.*down context.*|,
4888-
qr|WSREP: Failed to send state UUID:.*|,
4889-
qr|WSREP: wsrep_sst_receive_address.*|,
48904846
);
48914847

48924848
my $matched_lines= [];

mysql-test/suite/galera/galera_2nodes.cnf

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,32 @@
11
# Use default setting for mysqld processes
22
!include include/default_mysqld.cnf
33

4-
[mysqld.1]
5-
innodb_file_per_table
4+
[mysqld]
65
binlog-format=row
7-
innodb_file_format=Barracuda
8-
performance_schema=OFF
6+
innodb-autoinc-lock-mode=2
7+
default-storage-engine=innodb
8+
9+
wsrep-cluster-address=gcomm://
10+
wsrep-provider=@ENV.WSREP_PROVIDER
11+
# enforce read-committed characteristics across the cluster
12+
wsrep-causal-reads=ON
13+
wsrep-sync-wait=7
914

10-
wsrep_provider=@ENV.WSREP_PROVIDER
11-
wsrep_cluster_address='gcomm://'
15+
[mysqld.1]
16+
#galera_port=@OPT.port
17+
#ist_port=@OPT.port
18+
#sst_port=@OPT.port
1219
wsrep_provider_options='base_port=@mysqld.1.#galera_port'
1320
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
14-
# enforce read-committed characteristics across the cluster
15-
wsrep_causal_reads=ON
16-
wsrep_sync_wait = 7
17-
wsrep_node_address=127.0.0.1
1821
wsrep_node_incoming_address=127.0.0.1
1922

2023
[mysqld.2]
21-
innodb_file_per_table
22-
binlog-format=row
23-
innodb_file_format=Barracuda
24-
performance_schema=OFF
25-
26-
wsrep_provider=@ENV.WSREP_PROVIDER
24+
#galera_port=@OPT.port
25+
#ist_port=@OPT.port
26+
#sst_port=@OPT.port
2727
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
2828
wsrep_provider_options='base_port=@mysqld.2.#galera_port'
2929
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
30-
# enforce read-committed characteristics across the cluster
31-
wsrep_causal_reads=ON
32-
wsrep_sync_wait = 7
33-
wsrep_node_address=127.0.0.1
34-
wsrep_node_incoming_address=127.0.0.1
3530

3631
[ENV]
3732
NODE_MYPORT_1= @mysqld.1.port

mysql-test/suite/galera/suite.pm

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package My::Suite::GALERA;
2+
use File::Basename;
3+
use My::Find;
4+
5+
@ISA = qw(My::Suite);
6+
7+
return "Not run for embedded server" if $::opt_embedded_server;
8+
9+
return "WSREP is not compiled in" unless defined $::mysqld_variables{'wsrep-on'};
10+
11+
my ($provider) = grep { -f $_ } $ENV{WSREP_PROVIDER},
12+
"/usr/lib/galera/libgalera_smm.so",
13+
"/usr/lib64/galera/libgalera_smm.so";
14+
15+
return "No wsrep provider library" unless -f $provider;
16+
17+
$ENV{WSREP_PROVIDER} = $provider;
18+
19+
my ($spath) = grep { -f "$_/wsrep_sst_rsync"; } "$::bindir/scripts", $::path_client_bindir;
20+
return "No SST scripts" unless $spath;
21+
22+
my ($epath) = grep { -f "$_/my_print_defaults"; } "$::bindir/extra", $::path_client_bindir;
23+
return "No my_print_defaults" unless $epath;
24+
25+
push @::global_suppressions,
26+
(
27+
qr(WSREP:.*down context.*),
28+
qr(WSREP: Failed to send state UUID:.*),
29+
qr(WSREP: wsrep_sst_receive_address.*),
30+
qr(WSREP: Could not open saved state file for reading: .*),
31+
qr(WSREP: last inactive check more than .* skipping check),
32+
qr(WSREP: Gap in state sequence. Need state transfer.),
33+
qr(WSREP: Failed to prepare for incremental state transfer: .*),
34+
);
35+
36+
37+
$ENV{PATH}="$epath:$ENV{PATH}";
38+
$ENV{PATH}="$spath:$ENV{PATH}" unless $epath eq $spath;
39+
40+
bless { };
41+

mysql-test/suite/wsrep/my.cnf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
!include include/default_mysqld.cnf
33

44
[mysqld.1]
5-
6-
[ENV]
7-
GALERA_BASE_PORT=@mysqld.1.#galera_port
5+
#galera_port=@OPT.port
6+
#ist_port=@OPT.port
7+
#sst_port=@OPT.port
8+
wsrep_provider_options='base_port=@mysqld.1.#galera_port'
89

mysql-test/suite/wsrep/r/variables.result

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
SET @wsrep_provider_options_saved= @@global.wsrep_provider_options;
12

23
# MDEV#5534: mysql_tzinfo_to_sql generates wrong query
34
#
@@ -194,10 +195,9 @@ SET GLOBAL wsrep_slave_threads= 10;
194195
SHOW STATUS LIKE 'threads_connected';
195196
Variable_name Value
196197
Threads_connected 1
197-
SET GLOBAL wsrep_slave_threads= @wsrep_slave_threads_saved;
198-
SET GLOBAL wsrep_provider= none;
199-
SET GLOBAL wsrep_cluster_address= '';
200-
SET GLOBAL wsrep_provider_options= '';
198+
SHOW STATUS LIKE 'wsrep_thread_count';
199+
Variable_name Value
200+
wsrep_thread_count 11
201201
#
202202
# MDEV#6411: Setting set @@global.wsrep_sst_auth=NULL causes crash
203203
#
@@ -215,4 +215,8 @@ SELECT @@global.wsrep_sst_auth;
215215
@@global.wsrep_sst_auth
216216
NULL
217217
SET @@global.wsrep_sst_auth= @wsrep_sst_auth_saved;
218+
SET GLOBAL wsrep_slave_threads= @wsrep_slave_threads_saved;
219+
SET GLOBAL wsrep_provider= none;
220+
SET GLOBAL wsrep_cluster_address= '';
221+
SET GLOBAL wsrep_provider_options= @wsrep_provider_options_saved;
218222
# End of test.

mysql-test/suite/wsrep/suite.pm

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package My::Suite::WSREP;
2+
use File::Basename;
3+
use My::Find;
4+
5+
@ISA = qw(My::Suite);
6+
7+
return "Not run for embedded server" if $::opt_embedded_server;
8+
9+
return "WSREP is not compiled in" unless defined $::mysqld_variables{'wsrep-on'};
10+
11+
my ($provider) = grep { -f $_ } $ENV{WSREP_PROVIDER},
12+
"/usr/lib/galera/libgalera_smm.so",
13+
"/usr/lib64/galera/libgalera_smm.so";
14+
15+
return "No wsrep provider library" unless -f $provider;
16+
17+
$ENV{WSREP_PROVIDER} = $provider;
18+
19+
my ($spath) = grep { -f "$_/wsrep_sst_rsync"; } "$::bindir/scripts", $::path_client_bindir;
20+
return "No SST scripts" unless $spath;
21+
22+
my ($epath) = grep { -f "$_/my_print_defaults"; } "$::bindir/extra", $::path_client_bindir;
23+
return "No my_print_defaults" unless $epath;
24+
25+
$ENV{PATH}="$epath:$ENV{PATH}";
26+
$ENV{PATH}="$spath:$ENV{PATH}" unless $epath eq $spath;
27+
28+
bless { };
29+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep_provider_options='base_port=$GALERA_BASE_PORT' --wsrep-on=1 --log-bin
1+
--innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm://
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep_provider_options='base_port=$GALERA_BASE_PORT'
1+
--innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm://

0 commit comments

Comments
 (0)