List:Commits« Previous MessageNext Message »
From:tomas Date:January 13 2006 2:14am
Subject:bk commit into 5.1 tree (tomas:1.2052)
View as plain text  
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.2052 06/01/13 03:13:58 tomas@stripped +5 -0
  updated mysql-test-run.pl to adjust to ndb replication testing

  mysql-test/mysql-test-run.pl
    1.51 06/01/13 03:13:46 tomas@stripped +116 -66
    updated mysql-test-run.pl to adjust to ndb replication testing

  mysql-test/lib/mtr_stress.pl
    1.3 06/01/13 03:13:46 tomas@stripped +1 -1
    updated mysql-test-run.pl to adjust to ndb replication testing

  mysql-test/lib/mtr_match.pl
    1.2 06/01/13 03:13:46 tomas@stripped +17 -0
    updated mysql-test-run.pl to adjust to ndb replication testing

  mysql-test/lib/mtr_cases.pl
    1.13 06/01/13 03:13:46 tomas@stripped +10 -0
    updated mysql-test-run.pl to adjust to ndb replication testing

  BitKeeper/etc/ignore
    1.221 06/01/13 03:13:46 tomas@stripped +2 -0
    Added libmysqld/ha_ndbcluster_binlog.cc libmysqld/rpl_injector.cc to the ignore list

# 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/v7

--- 1.12/mysql-test/lib/mtr_cases.pl	2005-10-16 20:31:44 +02:00
+++ 1.13/mysql-test/lib/mtr_cases.pl	2006-01-13 03:13:46 +01:00
@@ -252,6 +252,16 @@
     $tinfo->{'slave_restart'}= 1;
   }
 
+  if ( ( $::opt_with_ndbcluster or $::glob_use_running_ndbcluster ) and
+       defined mtr_match_substring($tname,"ndb") )
+  {
+    $tinfo->{'ndb_test'}= 1;
+  }
+  else
+  {
+    $tinfo->{'ndb_test'}= 0;
+  }
+
   # FIXME what about embedded_server + ndbcluster, skip ?!
 
   my $master_opt_file= "$testdir/$tname-master.opt";

--- 1.1/mysql-test/lib/mtr_match.pl	2004-12-30 16:26:47 +01:00
+++ 1.2/mysql-test/lib/mtr_match.pl	2006-01-13 03:13:46 +01:00
@@ -50,6 +50,23 @@
 }
 
 
+# Match a substring anywere in a string
+
+sub mtr_match_substring ($$) {
+  my $string= shift;
+  my $substring= shift;
+
+  if ( $string =~ /(.*)\Q$substring\E(.*)$/ ) # strncmp
+  {
+    return $1;
+  }
+  else
+  {
+    return undef;		# NULL
+  }
+}
+
+
 sub mtr_match_any_exact ($$) {
   my $string= shift;
   my $mlist=  shift;

--- 1.50/mysql-test/mysql-test-run.pl	2006-01-12 19:50:29 +01:00
+++ 1.51/mysql-test/mysql-test-run.pl	2006-01-13 03:13:46 +01:00
@@ -144,6 +144,9 @@
 our $glob_use_embedded_server=    0;
 our @glob_test_mode;
 
+our $using_ndbcluster_master= 0;
+our $using_ndbcluster_slave= 0;
+
 our $glob_basedir;
 
 # The total result
@@ -331,10 +334,10 @@
 sub check_ndbcluster_support ();
 sub rm_ndbcluster_tables ($);
 sub ndbcluster_install ();
-sub ndbcluster_start ();
+sub ndbcluster_start ($);
 sub ndbcluster_stop ();
 sub ndbcluster_install_slave ();
-sub ndbcluster_start_slave ();
+sub ndbcluster_start_slave ($);
 sub ndbcluster_stop_slave ();
 sub run_benchmarks ($);
 sub run_tests ();
@@ -344,8 +347,8 @@
 sub report_failure_and_restart ($);
 sub do_before_start_master ($$);
 sub do_before_start_slave ($$);
-sub mysqld_start ($$$$);
-sub mysqld_arguments ($$$$$);
+sub mysqld_start ($$$$$);
+sub mysqld_arguments ($$$$$$);
 sub stop_masters_slaves ();
 sub stop_masters ();
 sub stop_slaves ();
@@ -402,11 +405,11 @@
 
   if ( $opt_start_dirty )
   {
-    if ( ndbcluster_start() )
+    if ( ndbcluster_start($opt_with_ndbcluster) )
     {
       mtr_error("Can't start ndbcluster");
     }
-    if ( mysqld_start('master',0,[],[]) )
+    if ( mysqld_start('master',0,[],[],$using_ndbcluster_master) )
     {
       mtr_report("Servers started, exiting");
     }
@@ -767,37 +770,6 @@
     }
   }
 
-  if ( $opt_ndbconnectstring )
-  {
-    $glob_use_running_ndbcluster= 1;
-    $opt_with_ndbcluster= 1;
-  }
-  else
-  {
-    $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;
-  }
-
   # The ":s" in the argument spec, means we have three different cases
   #
   #   undefined    option not set
@@ -1323,13 +1295,9 @@
   if ($opt_skip_ndbcluster)
   {
     mtr_report("Skipping ndbcluster");
+    $opt_skip_ndbcluster_slave= 1;
     $opt_with_ndbcluster= 0;
-    return;
-  }
-
-  if ($opt_with_ndbcluster)
-  {
-    mtr_report("Using ndbcluster");
+    $opt_with_ndbcluster_slave= 0;
     return;
   }
 
@@ -1342,11 +1310,41 @@
 	       "", "/dev/null", "/dev/null", "") != 0 )
   {
     mtr_report("Skipping ndbcluster, mysqld not compiled with ndbcluster");
+    $opt_skip_ndbcluster= 1;
+    $opt_skip_ndbcluster_slave= 1;
     $opt_with_ndbcluster= 0;
+    $opt_with_ndbcluster_slave= 0;
     return;
   }
+
   mtr_report("Using ndbcluster, mysqld supports it");
   $opt_with_ndbcluster= 1;
+  if ( $opt_ndbconnectstring )
+  {
+    $glob_use_running_ndbcluster= 1;
+  }
+  else
+  {
+    $opt_ndbconnectstring= "host=localhost:$opt_ndbcluster_port";
+  }
+
+  if ( $opt_skip_ndbcluster_slave )
+  {
+    $opt_with_ndbcluster_slave= 0;
+  }
+  else
+  {
+    $opt_with_ndbcluster_slave= 1;
+    if ( $opt_ndbconnectstring_slave )
+    {
+      $glob_use_running_ndbcluster_slave= 1;
+    }
+    else
+    {
+      $opt_ndbconnectstring_slave= "host=localhost:$opt_ndbcluster_port_slave";
+    }
+  }
+
   return;
 }
 
@@ -1358,11 +1356,12 @@
   {
     return 0;
   }
-  mtr_report("Install ndbcluster");
+  mtr_report("Installing ndbcluster master");
   my $ndbcluster_opts=  $opt_bench ? "" : "--small";
   if (  mtr_run("$glob_mysql_test_dir/ndb/ndbcluster",
 		["--port=$opt_ndbcluster_port",
 		 "--data-dir=$opt_vardir",
+		 "--verbose=2",
 		 $ndbcluster_opts,
 		 "--initial"],
 		"", "", "", "") )
@@ -1371,28 +1370,44 @@
     return 1;
   }
 
+  $using_ndbcluster_master= 1;
   ndbcluster_stop();
   $master->[0]->{'ndbcluster'}= 1;
 
   return 0;
 }
 
-sub ndbcluster_start () {
+sub ndbcluster_start ($) {
+  my $use_ndbcluster= shift;
 
-  if ( ! $opt_with_ndbcluster or $glob_use_running_ndbcluster )
+  if ( ! $use_ndbcluster )
+  {
+    $using_ndbcluster_master= 0;
+    return 0;
+  }
+  if ( $glob_use_running_ndbcluster )
+  {
+    $using_ndbcluster_master= 1;
+    return 0;
+  }
+  if ( $using_ndbcluster_master )
   {
     return 0;
   }
   # FIXME, we want to _append_ output to file $file_ndb_testrun_log instead of /dev/null
+  #mtr_report("Starting ndbcluster master");
   if ( mtr_run("$glob_mysql_test_dir/ndb/ndbcluster",
 	       ["--port=$opt_ndbcluster_port",
-		"--data-dir=$opt_vardir"],
+		"--data-dir=$opt_vardir",
+		"--verbose=2"],
 	       "", "/dev/null", "", "") )
   {
     mtr_error("Error ndbcluster_start");
+    $using_ndbcluster_master= 0;
     return 1;
   }
 
+  $using_ndbcluster_master= 1;
   return 0;
 }
 
@@ -1407,19 +1422,23 @@
 
 sub ndbcluster_stop () {
 
-  if ( ! $opt_with_ndbcluster or $glob_use_running_ndbcluster )
+  if ( ! $using_ndbcluster_master or $glob_use_running_ndbcluster )
   {
+    $using_ndbcluster_master= 0;
     return;
   }
   # FIXME, we want to _append_ output to file $file_ndb_testrun_log instead of /dev/null
+  #mtr_report("Stopping ndbcluster master");
   mtr_run("$glob_mysql_test_dir/ndb/ndbcluster",
           ["--port=$opt_ndbcluster_port",
            "--data-dir=$opt_vardir",
+	   "--verbose=2",
            "--stop"],
           "", "/dev/null", "", "");
 
   rm_ndbcluster_tables ($master->[0]->{'path_myddir'});
   rm_ndbcluster_tables ($master->[1]->{'path_myddir'});
+  $using_ndbcluster_master= 0;
   return;
 }
 
@@ -1429,10 +1448,11 @@
   {
     return 0;
   }
-  mtr_report("Install ndbcluster slave");
+  mtr_report("Installing ndbcluster slave");
   if (  mtr_run("$glob_mysql_test_dir/ndb/ndbcluster",
 		["--port=$opt_ndbcluster_port_slave",
 		 "--data-dir=$opt_vardir",
+		 "--verbose=2",
 		 "--small",
 		 "--ndbd-nodes=1",
 		 "--initial"],
@@ -1442,47 +1462,64 @@
     return 1;
   }
 
+  $using_ndbcluster_slave= 1;
   ndbcluster_stop_slave();
   $slave->[0]->{'ndbcluster'}= 1;
 
   return 0;
 }
 
-sub ndbcluster_start_slave () {
+sub ndbcluster_start_slave ($) {
+  my $use_ndbcluster= shift;
 
-  if ( ! $opt_with_ndbcluster_slave or $glob_use_running_ndbcluster_slave )
+  if ( ! $use_ndbcluster )
   {
+    $using_ndbcluster_slave= 0;
     return 0;
   }
+  if ( $glob_use_running_ndbcluster_slave )
+  {
+    $using_ndbcluster_slave= 1;
+    return 0;
+  }
+
   # FIXME, we want to _append_ output to file $file_ndb_testrun_log instead of /dev/null
+  #mtr_report("Starting ndbcluster slave");
   if ( mtr_run("$glob_mysql_test_dir/ndb/ndbcluster",
 	       ["--port=$opt_ndbcluster_port_slave",
 		"--data-dir=$opt_vardir",
+		"--verbose=2",
 		"--ndbd-nodes=1"],
 	       "", "/dev/null", "", "") )
   {
     mtr_error("Error ndbcluster_start_slave");
+    $using_ndbcluster_slave= 0;
     return 1;
   }
 
+  $using_ndbcluster_slave= 1;
   return 0;
 }
 
 sub ndbcluster_stop_slave () {
 
-  if ( ! $opt_with_ndbcluster_slave or $glob_use_running_ndbcluster_slave )
+  if ( ! $using_ndbcluster_slave or $glob_use_running_ndbcluster_slave )
   {
+    $using_ndbcluster_slave= 0;
     return;
   }
   # FIXME, we want to _append_ output to file $file_ndb_testrun_log instead of /dev/null
+  #mtr_report("Stopping ndbcluster slave");
   mtr_run("$glob_mysql_test_dir/ndb/ndbcluster",
           ["--port=$opt_ndbcluster_port_slave",
            "--data-dir=$opt_vardir",
+	   "--verbose=2",
            "--stop"],
           "", "/dev/null", "", "");
 
   rm_ndbcluster_tables ($slave->[0]->{'path_myddir'});
 
+  $using_ndbcluster_slave= 0;
   return;
 }
 
@@ -1500,7 +1537,8 @@
 
   if ( ! $glob_use_embedded_server and ! $opt_local_master )
   {
-    $master->[0]->{'pid'}= mysqld_start('master',0,[],[]);
+    $master->[0]->{'pid'}= mysqld_start('master',0,[],[],
+					$using_ndbcluster_master);
     if ( ! $master->[0]->{'pid'} )
     {
       mtr_error("Can't start the mysqld server");
@@ -1822,6 +1860,8 @@
 
   my $tname= $tinfo->{'name'};
 
+  my $ndbcluster_opt;
+
   mtr_tonewfile($opt_current_test,"$tname\n"); # Always tell where we are
 
   # output current test to ndbcluster log file to enable diagnostics
@@ -1855,7 +1895,8 @@
   if ( ! $glob_use_running_server and ! $glob_use_embedded_server )
   {
     if ( $tinfo->{'master_restart'} or
-         $master->[0]->{'running_master_is_special'} )
+         $master->[0]->{'running_master_is_special'} or
+         ( $tinfo->{'ndb_test'} != $using_ndbcluster_master ) )
     {
       stop_masters();
       $master->[0]->{'running_master_is_special'}= 0; # Forget why we stopped
@@ -1906,7 +1947,7 @@
     {
       if ( $master->[0]->{'ndbcluster'} )
       {
-	$master->[0]->{'ndbcluster'}= ndbcluster_start();
+	$master->[0]->{'ndbcluster'}= ndbcluster_start($tinfo->{'ndb_test'});
         if ( $master->[0]->{'ndbcluster'} )
         {
           report_failure_and_restart($tinfo);
@@ -1918,17 +1959,19 @@
         # FIXME not correct location for do_before_start_master()
         do_before_start_master($tname,$tinfo->{'master_sh'});
         $master->[0]->{'pid'}=
-          mysqld_start('master',0,$tinfo->{'master_opt'},[]);
+          mysqld_start('master',0,$tinfo->{'master_opt'},[],
+		       $using_ndbcluster_master);
         if ( ! $master->[0]->{'pid'} )
         {
           report_failure_and_restart($tinfo);
           return;
         }
       }
-      if ( $opt_with_ndbcluster and ! $master->[1]->{'pid'} )
+      if ( $using_ndbcluster_master and ! $master->[1]->{'pid'} )
       {
         $master->[1]->{'pid'}=
-          mysqld_start('master',1,$tinfo->{'master_opt'},[]);
+          mysqld_start('master',1,$tinfo->{'master_opt'},[],
+		       $using_ndbcluster_master);
         if ( ! $master->[1]->{'pid'} )
         {
           report_failure_and_restart($tinfo);
@@ -1967,21 +2010,25 @@
       {
         if ( ! $slave->[$idx]->{'pid'} )
         {
+	  $ndbcluster_opt= 0;
           if ( $idx == 0)
 	  {
 	    if ( $slave->[0]->{'ndbcluster'} )
 	    {
-	      $slave->[0]->{'ndbcluster'}= ndbcluster_start_slave();
+	      $slave->[0]->{'ndbcluster'}=
+		ndbcluster_start_slave($tinfo->{'ndb_test'});
 	      if ( $slave->[0]->{'ndbcluster'} )
 	      {
 		report_failure_and_restart($tinfo);
 		return;
 	      }
 	    }
+	    $ndbcluster_opt= $using_ndbcluster_slave;
 	  }
           $slave->[$idx]->{'pid'}=
             mysqld_start('slave',$idx,
-                         $tinfo->{'slave_opt'}, $tinfo->{'slave_mi'});
+                         $tinfo->{'slave_opt'}, $tinfo->{'slave_mi'},
+			 $ndbcluster_opt);
           if ( ! $slave->[$idx]->{'pid'} )
           {
             report_failure_and_restart($tinfo);
@@ -2178,12 +2225,13 @@
   }
 }
 
-sub mysqld_arguments ($$$$$) {
+sub mysqld_arguments ($$$$$$) {
   my $args=              shift;
   my $type=              shift;        # master/slave/bootstrap
   my $idx=               shift;
   my $extra_opt=         shift;
   my $slave_master_info= shift;
+  my $using_ndbcluster=  shift;
 
   my $sidx= "";                 # Index as string, 0 is empty string
   if ( $idx > 0 )
@@ -2246,7 +2294,7 @@
     {
       mtr_add_arg($args, "%s--skip-ndbcluster", $prefix);
     }
-    if ( $opt_with_ndbcluster )
+    if ( $using_ndbcluster )
     {
       mtr_add_arg($args, "%s--ndbcluster", $prefix);
       mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix,
@@ -2313,7 +2361,7 @@
     {
       mtr_add_arg($args, "%s--skip-ndbcluster", $prefix);
     }
-    if ( $idx == 0 and $opt_with_ndbcluster_slave )
+    if ( $idx == 0 and $using_ndbcluster_slave )
     {
       mtr_add_arg($args, "%s--ndbcluster", $prefix);
       mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix,
@@ -2423,11 +2471,12 @@
 #
 ##############################################################################
 
-sub mysqld_start ($$$$) {
+sub mysqld_start ($$$$$) {
   my $type=              shift;        # master/slave/bootstrap
   my $idx=               shift;
   my $extra_opt=         shift;
   my $slave_master_info= shift;
+  my $using_ndbcluster=  shift;
 
   my $args;                             # Arg vector
   my $exe;
@@ -2453,7 +2502,8 @@
     valgrind_arguments($args, \$exe);
   }
 
-  mysqld_arguments($args,$type,$idx,$extra_opt,$slave_master_info);
+  mysqld_arguments($args,$type,$idx,$extra_opt,$slave_master_info,
+		   $using_ndbcluster);
 
   if ( $type eq 'master' )
   {
@@ -2885,7 +2935,7 @@
 
   if ( $glob_use_embedded_server )
   {
-    mysqld_arguments($args,'master',0,$tinfo->{'master_opt'},[]);
+    mysqld_arguments($args,'master',0,$tinfo->{'master_opt'},[],0);
   }
 
   # ----------------------------------------------------------------------

--- 1.2/mysql-test/lib/mtr_stress.pl	2005-12-15 23:23:48 +01:00
+++ 1.3/mysql-test/lib/mtr_stress.pl	2006-01-13 03:13:46 +01:00
@@ -28,7 +28,7 @@
 
   if ( ! $::glob_use_embedded_server and ! $::opt_local_master )
   {
-    $::master->[0]->{'pid'}= mysqld_start('master',0,[],[]);
+    $::master->[0]->{'pid'}= mysqld_start('master',0,[],[],0);
     if ( ! $::master->[0]->{'pid'} )
     {
       mtr_error("Can't start the mysqld server");

--- 1.220/BitKeeper/etc/ignore	2006-01-11 19:49:27 +01:00
+++ 1.221/BitKeeper/etc/ignore	2006-01-13 03:13:46 +01:00
@@ -1670,3 +1670,5 @@
 storage/ndb/test/ndbapi/testReadPerf
 storage/ndb/test/ndbapi/test_event_merge
 storage/ndb/test/tools/listen_event
+libmysqld/ha_ndbcluster_binlog.cc
+libmysqld/rpl_injector.cc
Thread
bk commit into 5.1 tree (tomas:1.2052)tomas13 Jan