mirror of
https://github.com/MariaDB/server.git
synced 2025-01-23 15:24:16 +01:00
merge from 5.5-mtr
This commit is contained in:
commit
7a2050c505
28 changed files with 159 additions and 61 deletions
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -11,7 +11,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/*
|
||||
mysqltest
|
||||
|
|
|
@ -45,15 +45,7 @@ if ($rpl_server_parameters)
|
|||
--source include/rpl_connection.inc
|
||||
|
||||
# Write file to make mysql-test-run.pl start up the server again
|
||||
--let WRITE_TO_FILE= $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
|
||||
--let WRITE_TO_VAR= $_rpl_start_server_command
|
||||
perl;
|
||||
my $file= $ENV{'WRITE_TO_FILE'};
|
||||
my $var= $ENV{'WRITE_TO_VAR'};
|
||||
open WRITE_FILE, ">> $file" or die "Error opening $file: $!";
|
||||
print WRITE_FILE $var, "\n" or die "Error appending to $file: $!";
|
||||
close WRITE_FILE or die "Error closing $file: $!";
|
||||
EOF
|
||||
--exec echo "$_rpl_start_server_command" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
|
||||
|
||||
--source include/rpl_reconnect.inc
|
||||
|
||||
|
|
|
@ -44,9 +44,7 @@ if ($rpl_debug)
|
|||
|
||||
# Write file to make mysql-test-run.pl expect the "crash", but don't start
|
||||
# it until it's told to
|
||||
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
|
||||
wait
|
||||
EOF
|
||||
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
|
||||
|
||||
# Send shutdown to the connected server and give
|
||||
# it 10 seconds to die before zapping it
|
||||
|
|
|
@ -1,4 +1,20 @@
|
|||
# -*- cperl -*-
|
||||
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Library General Public
|
||||
# License as published by the Free Software Foundation; version 2
|
||||
# of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
package My::ConfigFactory;
|
||||
|
||||
use strict;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- cperl -*-
|
||||
# Copyright (C) 2004-2006 MySQL AB
|
||||
# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,4 +1,19 @@
|
|||
# -*- cperl -*-
|
||||
# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
package My::File::Path;
|
||||
use strict;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- cperl -*-
|
||||
# Copyright (C) 2004-2006 MySQL AB
|
||||
# Copyright (C) 2008 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- cperl -*-
|
||||
# Copyright (C) 2004-2006 MySQL AB
|
||||
# Copyright (C) 2008 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- cperl -*-
|
||||
# Copyright (C) 2004-2006 MySQL AB
|
||||
# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
# -*- cperl -*-
|
||||
# Copyright (C) 2004-2006 MySQL AB
|
||||
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Library General Public
|
||||
# License as published by the Free Software Foundation; version 2
|
||||
# of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- cperl -*-
|
||||
# Copyright (C) 2004-2006 MySQL AB
|
||||
# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2004 MySQL AB
|
||||
/* Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2008 MySQL AB
|
||||
/* Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2004 MySQL AB
|
||||
/* Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- cperl -*-
|
||||
# Copyright (C) 2004-2006 MySQL AB
|
||||
# Copyright (C) 2008 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,4 +1,18 @@
|
|||
# -*- cperl -*-
|
||||
# Copyright (C) 2008 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
#
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- cperl -*-
|
||||
# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- cperl -*-
|
||||
# Copyright (C) 2004, 2006 MySQL AB
|
||||
# Copyright (C) 2004, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- cperl -*-
|
||||
# Copyright (C) 2004 MySQL AB
|
||||
# Copyright (C) 2004 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- cperl -*-
|
||||
# Copyright (C) 2004-2006 MySQL AB
|
||||
# Copyright (C) 2004-2007 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- cperl -*-
|
||||
# Copyright (C) 2004-2006 MySQL AB
|
||||
# Copyright (C) 2004-2008 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
# -*- cperl -*-
|
||||
# Copyright (C) 2004-2006 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Library General Public
|
||||
# License as published by the Free Software Foundation; version 2
|
||||
# of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- cperl -*-
|
||||
# Copyright 2004-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- cperl -*-
|
||||
# Copyright (C) 2006 MySQL AB
|
||||
# Copyright (C) 2004-2007 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- cperl -*-
|
||||
# Copyright (C) 2006 MySQL AB
|
||||
# Copyright (C) 2006-2008 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
# Copyright (C) 2005, 2006 MySQL AB
|
||||
# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Library General Public
|
||||
|
@ -12,10 +12,9 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with this library; if not, write to the Free
|
||||
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
# MA 02111-1307, USA
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
# ======================================================================
|
||||
# MySQL server stress test system
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/perl
|
||||
# -*- cperl -*-
|
||||
|
||||
# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -14,7 +14,7 @@
|
|||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#
|
||||
##############################################################################
|
||||
|
@ -291,8 +291,10 @@ our $opt_include_ndbcluster= 0;
|
|||
our $opt_skip_ndbcluster= 1;
|
||||
|
||||
my $exe_ndbd;
|
||||
my $exe_ndbmtd;
|
||||
my $exe_ndb_mgmd;
|
||||
my $exe_ndb_waiter;
|
||||
my $exe_ndb_mgm;
|
||||
|
||||
our $debug_compiled_binaries;
|
||||
|
||||
|
@ -505,8 +507,8 @@ sub run_test_server ($$$) {
|
|||
my $num_failed_test= 0; # Number of tests failed so far
|
||||
|
||||
# Scheduler variables
|
||||
my $max_ndb= $childs / 2;
|
||||
$max_ndb = 4 if $max_ndb > 4;
|
||||
my $max_ndb= $ENV{MTR_MAX_NDB} || $childs / 2;
|
||||
$max_ndb = $childs if $max_ndb > $childs;
|
||||
$max_ndb = 1 if $max_ndb < 1;
|
||||
my $num_ndb_tests= 0;
|
||||
|
||||
|
@ -1807,16 +1809,42 @@ sub executable_setup () {
|
|||
|
||||
if ( ! $opt_skip_ndbcluster )
|
||||
{
|
||||
# Look for single threaded NDB
|
||||
$exe_ndbd=
|
||||
my_find_bin($bindir,
|
||||
["storage/ndb/src/kernel", "libexec", "sbin", "bin"],
|
||||
"ndbd");
|
||||
|
||||
# Look for multi threaded NDB
|
||||
$exe_ndbmtd=
|
||||
my_find_bin($bindir,
|
||||
["storage/ndb/src/kernel", "libexec", "sbin", "bin"],
|
||||
"ndbmtd", NOT_REQUIRED);
|
||||
if ($exe_ndbmtd)
|
||||
{
|
||||
my $mtr_ndbmtd = $ENV{MTR_NDBMTD};
|
||||
if ($mtr_ndbmtd)
|
||||
{
|
||||
mtr_report(" - multi threaded ndbd found, will be used always");
|
||||
$exe_ndbd = $exe_ndbmtd;
|
||||
}
|
||||
else
|
||||
{
|
||||
mtr_report(" - multi threaded ndbd found, will be ".
|
||||
"used \"round robin\"");
|
||||
}
|
||||
}
|
||||
|
||||
$exe_ndb_mgmd=
|
||||
my_find_bin($bindir,
|
||||
["storage/ndb/src/mgmsrv", "libexec", "sbin", "bin"],
|
||||
"ndb_mgmd");
|
||||
|
||||
$exe_ndb_mgm=
|
||||
my_find_bin($bindir,
|
||||
["storage/ndb/src/mgmclient", "bin"],
|
||||
"ndb_mgm");
|
||||
|
||||
$exe_ndb_waiter=
|
||||
my_find_bin($bindir,
|
||||
["storage/ndb/tools/", "bin"],
|
||||
|
@ -2622,6 +2650,27 @@ sub ndb_mgmd_wait_started($) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
sub ndb_mgmd_stop{
|
||||
my $ndb_mgmd= shift or die "usage: ndb_mgmd_stop(<ndb_mgmd>)";
|
||||
|
||||
my $host=$ndb_mgmd->value('HostName');
|
||||
my $port=$ndb_mgmd->value('PortNumber');
|
||||
mtr_verbose("Stopping cluster '$host:$port'");
|
||||
|
||||
my $args;
|
||||
mtr_init_args(\$args);
|
||||
mtr_add_arg($args, "--ndb-connectstring=%s:%s", $host,$port);
|
||||
mtr_add_arg($args, "-e");
|
||||
mtr_add_arg($args, "shutdown");
|
||||
|
||||
My::SafeProcess->run
|
||||
(
|
||||
name => "ndb_mgm shutdown $host:$port",
|
||||
path => $exe_ndb_mgm,
|
||||
args => \$args,
|
||||
output => "/dev/null",
|
||||
);
|
||||
}
|
||||
|
||||
sub ndb_mgmd_start ($$) {
|
||||
my ($cluster, $ndb_mgmd)= @_;
|
||||
|
@ -2649,6 +2698,7 @@ sub ndb_mgmd_start ($$) {
|
|||
error => $path_ndb_mgmd_log,
|
||||
append => 1,
|
||||
verbose => $opt_verbose,
|
||||
shutdown => sub { ndb_mgmd_stop($ndb_mgmd) },
|
||||
);
|
||||
mtr_verbose("Started $ndb_mgmd->{proc}");
|
||||
|
||||
|
@ -2664,6 +2714,12 @@ sub ndb_mgmd_start ($$) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
sub ndbd_stop {
|
||||
# Intentionally left empty, ndbd nodes will be shutdown
|
||||
# by sending "shutdown" to ndb_mgmd
|
||||
}
|
||||
|
||||
my $exe_ndbmtd_counter= 0;
|
||||
|
||||
sub ndbd_start {
|
||||
my ($cluster, $ndbd)= @_;
|
||||
|
@ -2681,17 +2737,24 @@ sub ndbd_start {
|
|||
|
||||
# > 5.0 { 'character-sets-dir' => \&fix_charset_dir },
|
||||
|
||||
my $exe= $exe_ndbd;
|
||||
if ($exe_ndbmtd and ($exe_ndbmtd_counter++ % 2) == 0)
|
||||
{
|
||||
# Use ndbmtd every other time
|
||||
$exe= $exe_ndbmtd;
|
||||
}
|
||||
|
||||
my $path_ndbd_log= "$dir/ndbd.log";
|
||||
my $proc= My::SafeProcess->new
|
||||
(
|
||||
name => $ndbd->after('cluster_config.'),
|
||||
path => $exe_ndbd,
|
||||
path => $exe,
|
||||
args => \$args,
|
||||
output => $path_ndbd_log,
|
||||
error => $path_ndbd_log,
|
||||
append => 1,
|
||||
verbose => $opt_verbose,
|
||||
shutdown => sub { ndbd_stop($ndbd) },
|
||||
);
|
||||
mtr_verbose("Started $proc");
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2005, 2008 MySQL AB
|
||||
# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Library General Public
|
||||
|
@ -10,10 +10,9 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with this library; if not, write to the Free
|
||||
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
# MA 02111-1307, USA
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#
|
||||
# Suppress some common (not fatal) errors in system libraries found by valgrind
|
||||
|
|
Loading…
Add table
Reference in a new issue