Below is the list of changes that have just been committed into a local
4.1 repository of tomas. When tomas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html
ChangeSet
1.2179 05/02/08 06:11:05 tomas@stripped +1 -0
ndbcluster now runs clean in 4.1, 5.0 may still need some work
mysql-test/mysql-test-run.pl
1.7 05/02/08 06:11:02 tomas@stripped +112 -40
ndbcluster now runs clean in 4.1, 5.0 may still need some work
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: tomas
# Host: poseidon.ndb.mysql.com
# Root: /home/tomas/mysql-4.1
--- 1.6/mysql-test/mysql-test-run.pl 2005-02-03 20:47:11 +01:00
+++ 1.7/mysql-test/mysql-test-run.pl 2005-02-08 06:11:02 +01:00
@@ -284,6 +284,11 @@
our $opt_with_ndbcluster;
our $opt_with_openssl;
+our $exe_ndb_mgm;
+our $path_ndb_tools_dir;
+our $path_ndb_backup_dir;
+our $file_ndb_testrun_log;
+our $flag_ndb_status_ok= 1;
######################################################################
#
@@ -297,6 +302,7 @@
sub executable_setup ();
sub environment_setup ();
sub kill_and_cleanup ();
+sub ndbcluster_install ();
sub ndbcluster_start ();
sub ndbcluster_stop ();
sub run_benchmarks ($);
@@ -346,18 +352,12 @@
kill_and_cleanup();
mysql_install_db();
- if ( $opt_with_ndbcluster and ! $glob_use_running_ndbcluster )
- {
- ndbcluster_start(); # We start the cluster storage engine
- }
-
# mysql_loadstd(); FIXME copying from "std_data" .frm and
# .MGR but there are none?!
}
if ( $opt_start_and_exit )
{
- # FIXME what about ndb?
if ( mysqld_start('master',0,[],[]) )
{
mtr_report("Servers started, exiting");
@@ -551,6 +551,8 @@
$master->[0]->{'path_myport'}= $opt_master_myport;
$master->[0]->{'start_timeout'}= 400; # enough time create innodb tables
+ $master->[0]->{'ndbcluster'}= 1; # ndbcluster not started
+
$master->[1]->{'path_myddir'}= "$glob_mysql_test_dir/var/master1-data";
$master->[1]->{'path_myerr'}= "$glob_mysql_test_dir/var/log/master1.err";
$master->[1]->{'path_mylog'}= "$glob_mysql_test_dir/var/log/master1.log";
@@ -681,6 +683,10 @@
$glob_use_running_ndbcluster= 1;
$opt_with_ndbcluster= 1;
}
+ else
+ {
+ $opt_ndbconnectstring= "host=localhost:$opt_ndbcluster_port";
+ }
# FIXME
@@ -786,6 +792,9 @@
$exe_mysql_fix_system_tables= "$glob_basedir/scripts/mysql_fix_privilege_tables";
$path_language= "$glob_basedir/sql/share/english/";
$path_charsetsdir= "$glob_basedir/sql/share/charsets";
+
+ $path_ndb_tools_dir= "$glob_basedir/ndb/tools";
+ $exe_ndb_mgm= "$glob_basedir/ndb/src/mgmclient/ndb_mgm";
}
else
{
@@ -846,6 +855,9 @@
$exe_mysqltest="$path_client_bindir/mysqltest";
$exe_mysql_client_test="$path_client_bindir/mysql_client_test";
}
+
+ $path_ndb_tools_dir= "$glob_basedir/bin";
+ $exe_ndb_mgm= "$glob_basedir/bin/ndb_mgm";
}
# FIXME special $exe_master_mysqld and $exe_slave_mysqld
@@ -860,6 +872,10 @@
{
$exe_slave_mysqld= $exe_mysqld;
}
+
+ $path_ndb_backup_dir=
+ "$glob_mysql_test_dir/var/ndbcluster-$opt_ndbcluster_port";
+ $file_ndb_testrun_log= "$glob_mysql_test_dir/var/log/ndb_testrun.log";
}
@@ -949,22 +965,19 @@
mtr_report("Killing Possible Leftover Processes");
mkpath("$glob_mysql_test_dir/var/log"); # Needed for mysqladmin log
mtr_kill_leftovers();
- }
- if ( $opt_with_ndbcluster and ! $glob_use_running_ndbcluster )
- {
ndbcluster_stop();
+ $master->[0]->{'ndbcluster'}= 1;
}
mtr_report("Removing Stale Files");
rmtree("$glob_mysql_test_dir/var/log");
- rmtree("$glob_mysql_test_dir/var/ndbcluster");
+ rmtree("$glob_mysql_test_dir/var/ndbcluster-$opt_ndbcluster_port");
rmtree("$glob_mysql_test_dir/var/run");
rmtree("$glob_mysql_test_dir/var/tmp");
mkpath("$glob_mysql_test_dir/var/log");
- mkpath("$glob_mysql_test_dir/var/ndbcluster");
mkpath("$glob_mysql_test_dir/var/run");
mkpath("$glob_mysql_test_dir/var/tmp");
mkpath($opt_tmpdir);
@@ -1002,26 +1015,67 @@
# FIXME why is there a different start below?!
-sub ndbcluster_start () {
+sub ndbcluster_install () {
- mtr_report("Starting ndbcluster");
+ if ( ! $opt_with_ndbcluster or $glob_use_running_ndbcluster )
+ {
+ return 0;
+ }
+ mtr_report("Install ndbcluster");
my $ndbcluster_opts= $opt_bench ? "" : "--small";
- # FIXME check result code?!
- mtr_run("$glob_mysql_test_dir/ndb/ndbcluster",
- ["--port-base=$opt_ndbcluster_port",
- $ndbcluster_opts,
- "--diskless",
- "--initial",
- "--data-dir=$glob_mysql_test_dir/var"],
- "", "", "", "");
+ my $ndbcluster_port_base= $opt_ndbcluster_port + 2;
+ if ( mtr_run("$glob_mysql_test_dir/ndb/ndbcluster",
+ ["--port=$opt_ndbcluster_port",
+ "--port-base=$ndbcluster_port_base",
+ "--data-dir=$glob_mysql_test_dir/var",
+ $ndbcluster_opts,
+ "--initial"],
+ "", "", "", "") )
+ {
+ mtr_error("Error ndbcluster_install");
+ return 1;
+ }
+
+ ndbcluster_stop();
+ $master->[0]->{'ndbcluster'}= 1;
+
+ return 0;
+}
+
+sub ndbcluster_start () {
+
+ if ( ! $opt_with_ndbcluster or $glob_use_running_ndbcluster )
+ {
+ return 0;
+ }
+ # FIXME, we want to _append_ output to file $file_ndb_testrun_log instead of /dev/null
+ if ( mtr_run("$glob_mysql_test_dir/ndb/ndbcluster",
+ ["--port=$opt_ndbcluster_port",
+ "--data-dir=$glob_mysql_test_dir/var"],
+ "", "/dev/null", "", "") )
+ {
+ mtr_error("Error ndbcluster_install");
+ return 1;
+ }
+
+ return 0;
}
sub ndbcluster_stop () {
+
+ if ( ! $opt_with_ndbcluster or $glob_use_running_ndbcluster )
+ {
+ return;
+ }
+ my $ndbcluster_port_base= $opt_ndbcluster_port + 2;
+ # FIXME, we want to _append_ output to file $file_ndb_testrun_log instead of /dev/null
mtr_run("$glob_mysql_test_dir/ndb/ndbcluster",
- ["--data-dir=$glob_mysql_test_dir/var",
- "--port-base=$opt_ndbcluster_port",
+ ["--port=$opt_ndbcluster_port",
+ "--data-dir=$glob_mysql_test_dir/var",
"--stop"],
- "", "", "", "");
+ "", "/dev/null", "", "");
+
+ return;
}
@@ -1129,11 +1183,6 @@
stop_masters_slaves();
}
- if ( $opt_with_ndbcluster and ! $glob_use_running_ndbcluster )
- {
- ndbcluster_stop();
- }
-
if ( $opt_gcov )
{
gcov_collect(); # collect coverage information
@@ -1162,6 +1211,13 @@
install_db('slave', $slave->[1]->{'path_myddir'});
install_db('slave', $slave->[2]->{'path_myddir'});
+ if ( ndbcluster_install() )
+ {
+ # failed to install, disable usage but flag that its no ok
+ $opt_with_ndbcluster= 0;
+ $flag_ndb_status_ok= 0;
+ }
+
return 0;
}
@@ -1224,6 +1280,9 @@
mtr_tonewfile($opt_current_test,"$tname\n"); # Always tell where we are
+ # output current test to ndbcluster log file to enable diagnostics
+ mtr_tofile($file_ndb_testrun_log,"CURRENT TEST $tname\n");
+
# ----------------------------------------------------------------------
# If marked to skip, just print out and return.
# Note that a test case not marked as 'skip' can still be
@@ -1297,6 +1356,15 @@
if ( ! $opt_local_master )
{
+ if ( $master->[0]->{'ndbcluster'} )
+ {
+ $master->[0]->{'ndbcluster'}= ndbcluster_start();
+ if ( $master->[0]->{'ndbcluster'} )
+ {
+ report_failure_and_restart($tinfo);
+ return;
+ }
+ }
if ( ! $master->[0]->{'pid'} )
{
$master->[0]->{'pid'}=
@@ -1614,17 +1682,8 @@
if ( $opt_with_ndbcluster )
{
mtr_add_arg($args, "%s--ndbcluster", $prefix);
-
- if ( $glob_use_running_ndbcluster )
- {
- mtr_add_arg($args,"--ndb-connectstring=%s", $prefix,
- $opt_ndbconnectstring);
- }
- else
- {
- mtr_add_arg($args,"--ndb-connectstring=host=localhost:%d",
- $prefix, $opt_ndbcluster_port);
- }
+ mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix,
+ $opt_ndbconnectstring);
}
# FIXME always set nowdays??? SMALL_SERVER
@@ -1828,6 +1887,12 @@
}
}
+ if ( ! $master->[0]->{'ndbcluster'} )
+ {
+ ndbcluster_stop();
+ $master->[0]->{'ndbcluster'}= 1;
+ }
+
mtr_stop_mysqld_servers(\@args);
}
@@ -1902,6 +1967,13 @@
$ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables;
$ENV{'MYSQL_CLIENT_TEST'}= $cmdline_mysql_client_test;
$ENV{'CHARSETSDIR'}= $path_charsetsdir;
+
+ $ENV{'NDB_STATUS_OK'}= $flag_ndb_status_ok;
+ $ENV{'NDB_MGM'}= $exe_ndb_mgm;
+ $ENV{'NDB_BACKUP_DIR'}= $path_ndb_backup_dir;
+ $ENV{'NDB_TOOLS_DIR'}= $path_ndb_tools_dir;
+ $ENV{'NDB_TOOLS_OUTPUT'}= $file_ndb_testrun_log;
+ $ENV{'NDB_CONNECTSTRING'}= $opt_ndbconnectstring;
my $exe= $exe_mysqltest;
my $args;
| Thread |
|---|
| • bk commit into 4.1 tree (tomas:1.2179) | tomas | 8 Feb |