Below is the list of changes that have just been committed into a local
5.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://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1993 05/07/13 13:16:12 tomas@stripped +2 -0
perl test version update for ndb replication support
mysql-test/mysql-test-run.pl
1.37 05/07/13 13:16:04 tomas@stripped +146 -7
perl test version update for ndb replication support
mysql-test/lib/init_db.sql
1.9 05/07/13 13:16:04 tomas@stripped +3 -0
perl test version update for ndb replication support
# 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-5.1-wl2325
--- 1.8/mysql-test/lib/init_db.sql 2005-05-26 02:06:25 +02:00
+++ 1.9/mysql-test/lib/init_db.sql 2005-07-13 13:16:04 +02:00
@@ -557,3 +557,6 @@
comment char(64) binary DEFAULT '' NOT NULL,
PRIMARY KEY (db,name,type)
) comment='Stored Procedures';
+
+CREATE DATABASE IF NOT EXISTS cluster_replication;
+CREATE TABLE IF NOT EXISTS cluster_replication.binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM;
--- 1.36/mysql-test/mysql-test-run.pl 2005-07-12 13:51:18 +02:00
+++ 1.37/mysql-test/mysql-test-run.pl 2005-07-13 13:16:04 +02:00
@@ -139,6 +139,7 @@
our $glob_scriptname= undef;
our $glob_use_running_server= 0;
our $glob_use_running_ndbcluster= 0;
+our $glob_use_running_ndbcluster_slave= 0;
our $glob_use_embedded_server= 0;
our $glob_basedir;
@@ -215,6 +216,8 @@
our $opt_ndbcluster_port;
our $opt_ndbconnectstring;
+our $opt_ndbcluster_port_slave;
+our $opt_ndbconnectstring_slave;
our $opt_no_manager; # Does nothing now, we never use manager
our $opt_manager_port; # Does nothing now, we never use manager
@@ -266,6 +269,9 @@
our $opt_skip_ndbcluster;
our $opt_with_ndbcluster;
+our $opt_skip_ndbcluster_slave;
+our $opt_with_ndbcluster_slave;
+our $opt_ndb_extra_test;
our $opt_with_openssl;
our $exe_ndb_mgm;
@@ -273,6 +279,7 @@
our $path_ndb_backup_dir;
our $file_ndb_testrun_log;
our $flag_ndb_status_ok= 1;
+our $flag_ndb_slave_status_ok= 1;
######################################################################
#
@@ -290,6 +297,9 @@
sub ndbcluster_install ();
sub ndbcluster_start ();
sub ndbcluster_stop ();
+sub ndbcluster_install_slave ();
+sub ndbcluster_start_slave ();
+sub ndbcluster_stop_slave ();
sub run_benchmarks ($);
sub run_tests ();
sub mysql_install_db ();
@@ -449,6 +459,7 @@
my $opt_master_myport= 9306;
my $opt_slave_myport= 9308;
$opt_ndbcluster_port= 9350;
+ $opt_ndbcluster_port_slave= 9358;
# Read the command line
# Note: Keep list, and the order, in sync with usage at end of this file
@@ -465,6 +476,10 @@
'force' => \$opt_force,
'with-ndbcluster' => \$opt_with_ndbcluster,
'skip-ndbcluster|skip-ndb' => \$opt_skip_ndbcluster,
+ 'with-ndbcluster-slave' => \$opt_with_ndbcluster_slave,
+ 'skip-ndbcluster-slave|skip-ndb-slave'
+ => \$opt_skip_ndbcluster_slave,
+ 'ndb-extra-test' => \$opt_ndb_extra_test,
'do-test=s' => \$opt_do_test,
'suite=s' => \$opt_suite,
'skip-rpl' => \$opt_skip_rpl,
@@ -474,6 +489,7 @@
'master_port=i' => \$opt_master_myport,
'slave_port=i' => \$opt_slave_myport,
'ndbcluster_port=i' => \$opt_ndbcluster_port,
+ 'ndbcluster_port_slave=i' => \$opt_ndbcluster_port_slave,
'manager-port=i' => \$opt_manager_port, # Currently not used
# Test case authoring
@@ -485,6 +501,7 @@
# Run test on running server
'extern' => \$opt_extern,
'ndbconnectstring=s' => \$opt_ndbconnectstring,
+ 'ndbconnectstring-slave=s' => \$opt_ndbconnectstring_slave,
# Debugging
'gdb' => \$opt_gdb,
@@ -664,9 +681,25 @@
$opt_ndbconnectstring= "host=localhost:$opt_ndbcluster_port";
}
+ if ( $opt_ndbconnectstring_slave )
+ {
+ $glob_use_running_ndbcluster_slave= 1;
+ $opt_with_ndbcluster_slave= 1;
+ }
+ else
+ {
+ $opt_ndbconnectstring_slave= "host=localhost:$opt_ndbcluster_port_slave";
+ }
+
if ( $opt_skip_ndbcluster )
{
$opt_with_ndbcluster= 0;
+ $opt_skip_ndbcluster_slave= 1;
+ }
+
+ if ( $opt_skip_ndbcluster_slave )
+ {
+ $opt_with_ndbcluster_slave= 0;
}
# FIXME
@@ -733,6 +766,8 @@
$slave->[0]->{'path_myport'}= $opt_slave_myport;
$slave->[0]->{'start_timeout'}= 400;
+ $slave->[0]->{'ndbcluster'}= 1; # ndbcluster not started
+
$slave->[1]->{'path_myddir'}= "$opt_vardir/slave1-data";
$slave->[1]->{'path_myerr'}= "$opt_vardir/log/slave1.err";
$slave->[1]->{'path_mylog'}= "$opt_vardir/log/slave1.log";
@@ -960,6 +995,8 @@
ndbcluster_stop();
$master->[0]->{'ndbcluster'}= 1;
+ ndbcluster_stop_slave();
+ $slave->[0]->{'ndbcluster'}= 1;
}
}
@@ -1082,6 +1119,68 @@
return;
}
+sub ndbcluster_install_slave () {
+
+ if ( ! $opt_with_ndbcluster_slave or $glob_use_running_ndbcluster_slave )
+ {
+ return 0;
+ }
+ mtr_report("Install ndbcluster slave");
+ if ( mtr_run("$glob_mysql_test_dir/ndb/ndbcluster",
+ ["--port=$opt_ndbcluster_port_slave",
+ "--data-dir=$opt_vardir",
+ "--small",
+ "--diskless",
+ "--ndbd-nodes=1",
+ "--initial"],
+ "", "", "", "") )
+ {
+ mtr_error("Error ndbcluster_install_slave");
+ return 1;
+ }
+
+ ndbcluster_stop_slave();
+ $slave->[0]->{'ndbcluster'}= 1;
+
+ return 0;
+}
+
+sub ndbcluster_start_slave () {
+
+ if ( ! $opt_with_ndbcluster_slave or $glob_use_running_ndbcluster_slave )
+ {
+ 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_slave",
+ "--data-dir=$opt_vardir",
+ "--ndbd-nodes=1"],
+ "", "/dev/null", "", "") )
+ {
+ mtr_error("Error ndbcluster_start_slave");
+ return 1;
+ }
+
+ return 0;
+}
+
+sub ndbcluster_stop_slave () {
+
+ if ( ! $opt_with_ndbcluster_slave or $glob_use_running_ndbcluster_slave )
+ {
+ return;
+ }
+ # FIXME, we want to _append_ output to file $file_ndb_testrun_log instead of /dev/null
+ mtr_run("$glob_mysql_test_dir/ndb/ndbcluster",
+ ["--port=$opt_ndbcluster_port_slave",
+ "--data-dir=$opt_vardir",
+ "--stop"],
+ "", "/dev/null", "", "");
+
+ return;
+}
+
##############################################################################
#
@@ -1222,6 +1321,13 @@
$flag_ndb_status_ok= 0;
}
+ if ( ndbcluster_install_slave() )
+ {
+ # failed to install, disable usage but flag that its no ok
+ $opt_with_ndbcluster_slave= 0;
+ $flag_ndb_slave_status_ok= 0;
+ }
+
return 0;
}
@@ -1443,6 +1549,18 @@
{
if ( ! $slave->[$idx]->{'pid'} )
{
+ if ( $idx == 0)
+ {
+ if ( $slave->[0]->{'ndbcluster'} )
+ {
+ $slave->[0]->{'ndbcluster'}= ndbcluster_start_slave();
+ if ( $slave->[0]->{'ndbcluster'} )
+ {
+ report_failure_and_restart($tinfo);
+ return;
+ }
+ }
+ }
$slave->[$idx]->{'pid'}=
mysqld_start('slave',$idx,
$tinfo->{'slave_opt'}, $tinfo->{'slave_mi'});
@@ -1668,6 +1786,12 @@
{
mtr_add_arg($args, "%s--skip-ndbcluster", $prefix);
}
+ if ( $opt_with_ndbcluster )
+ {
+ mtr_add_arg($args, "%s--ndbcluster", $prefix);
+ mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix,
+ $opt_ndbconnectstring);
+ }
}
if ( $type eq 'slave' )
@@ -1724,6 +1848,17 @@
mtr_add_arg($args, "%s--server-id=%d", $prefix, $slave_server_id);
mtr_add_arg($args, "%s--rpl-recovery-rank=%d", $prefix, $slave_rpl_rank);
}
+
+ if ( $opt_skip_ndbcluster_slave )
+ {
+ mtr_add_arg($args, "%s--skip-ndbcluster", $prefix);
+ }
+ if ( $idx == 0 and $opt_with_ndbcluster_slave )
+ {
+ mtr_add_arg($args, "%s--ndbcluster", $prefix);
+ mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix,
+ $opt_ndbconnectstring_slave);
+ }
} # end slave
if ( $opt_debug )
@@ -1740,13 +1875,6 @@
}
}
- if ( $opt_with_ndbcluster )
- {
- mtr_add_arg($args, "%s--ndbcluster", $prefix);
- mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix,
- $opt_ndbconnectstring);
- }
-
# FIXME always set nowdays??? SMALL_SERVER
mtr_add_arg($args, "%s--key_buffer_size=1M", $prefix);
mtr_add_arg($args, "%s--sort_buffer=256K", $prefix);
@@ -1969,6 +2097,12 @@
}
}
+ if ( ! $slave->[0]->{'ndbcluster'} )
+ {
+ ndbcluster_stop_slave();
+ $slave->[0]->{'ndbcluster'}= 1;
+ }
+
mtr_stop_mysqld_servers(\@args);
}
@@ -1979,6 +2113,8 @@
my $cmdline_mysqldump= "$exe_mysqldump --no-defaults -uroot " .
"--socket=$master->[0]->{'path_mysock'} --password=";
+ my $cmdline_mysqldump_slave= "$exe_mysqldump --no-defaults -uroot " .
+ "--socket=$slave->[0]->{'path_mysock'} --password=";
if ( $opt_debug )
{
$cmdline_mysqldump .=
@@ -2033,6 +2169,7 @@
$ENV{'MYSQL'}= $cmdline_mysql;
$ENV{'MYSQL_DUMP'}= $cmdline_mysqldump;
+ $ENV{'MYSQL_DUMP_SLAVE'}= $cmdline_mysqldump_slave;
$ENV{'MYSQL_SHOW'}= $cmdline_mysqlshow;
$ENV{'MYSQL_BINLOG'}= $cmdline_mysqlbinlog;
$ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables;
@@ -2040,6 +2177,8 @@
$ENV{'CHARSETSDIR'}= $path_charsetsdir;
$ENV{'NDB_STATUS_OK'}= $flag_ndb_status_ok;
+ $ENV{'NDB_SLAVE_STATUS_OK'}= $flag_ndb_slave_status_ok;
+ $ENV{'NDB_EXTRA_TEST'}= $opt_ndb_extra_test;
$ENV{'NDB_MGM'}= $exe_ndb_mgm;
$ENV{'NDB_BACKUP_DIR'}= $path_ndb_backup_dir;
$ENV{'NDB_TOOLS_DIR'}= $path_ndb_tools_dir;
| Thread |
|---|
| • bk commit into 5.1 tree (tomas:1.1993) | tomas | 13 Jul |