List:Commits« Previous MessageNext Message »
From:Bjorn Munch Date:November 12 2010 1:45pm
Subject:bzr commit into mysql-5.5-mtr branch (bjorn.munch:3111) Bug#58115
View as plain text  
#At file:///home/bm136801/my/srvrest-51/ based on revid:bjorn.munch@stripped

 3111 Bjorn Munch	2010-11-12
      Bug #58115 MTR should restart slaves between tests if master needs restart
      As we check for servers to restart, tag the tinfo if the master is restarted,
      then check (after all other checks) for slave restarts.

    modified:
      mysql-test/mysql-test-run.pl
=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl	2010-11-05 14:36:00 +0000
+++ b/mysql-test/mysql-test-run.pl	2010-11-12 13:44:32 +0000
@@ -4651,6 +4651,10 @@ sub stop_all_servers () {
 sub server_need_restart {
   my ($tinfo, $server)= @_;
 
+  # Mark the tinfo so slaves will restart if server restarts
+  # This assumes master will be considered first.
+  my $is_master= $server->option("#!run-master-sh");
+
   if ( using_extern() )
   {
     mtr_verbose_restart($server, "no restart for --extern server");
@@ -4659,29 +4663,34 @@ sub server_need_restart {
 
   if ( $tinfo->{'force_restart'} ) {
     mtr_verbose_restart($server, "forced in .opt file");
+    $tinfo->{master_restart}= 1 if $is_master;
     return 1;
   }
 
   if ( $opt_force_restart ) {
     mtr_verbose_restart($server, "forced restart turned on");
+    $tinfo->{master_restart}= 1 if $is_master;
     return 1;
   }
 
   if ( $tinfo->{template_path} ne $current_config_name)
   {
     mtr_verbose_restart($server, "using different config file");
+    $tinfo->{master_restart}= 1 if $is_master;
     return 1;
   }
 
   if ( $tinfo->{'master_sh'}  || $tinfo->{'slave_sh'} )
   {
     mtr_verbose_restart($server, "sh script to run");
+    $tinfo->{master_restart}= 1 if $is_master;
     return 1;
   }
 
   if ( ! started($server) )
   {
     mtr_verbose_restart($server, "not started");
+    $tinfo->{master_restart}= 1 if $is_master;
     return 1;
   }
 
@@ -4694,6 +4703,7 @@ sub server_need_restart {
     if ( timezone($started_tinfo) ne timezone($tinfo) )
     {
       mtr_verbose_restart($server, "different timezone");
+      $tinfo->{master_restart}= 1 if $is_master;
       return 1;
     }
   }
@@ -4718,6 +4728,7 @@ sub server_need_restart {
 	mtr_verbose_restart($server, "running with different options '" .
 			    join(" ", @{$extra_opts}) . "' != '" .
 			    join(" ", @{$started_opts}) . "'" );
+	$tinfo->{master_restart}= 1 if $is_master;
 	return 1;
       }
 
@@ -4734,6 +4745,7 @@ sub server_need_restart {
 	mtr_verbose("Restart: running with different options '" .
 		    join(" ", @{$extra_opts}) . "' != '" .
 		    join(" ", @{$started_opts}) . "'" );
+	$tinfo->{master_restart}= 1 if $is_master;
 	return 1;
       }
 
@@ -4742,6 +4754,11 @@ sub server_need_restart {
     }
   }
 
+  if ($server->option("#!use-slave-opt") && $tinfo->{master_restart}) {
+    mtr_verbose_restart($server, "master will be restarted");
+    return 1;
+  }
+
   # Default, no restart
   return 0;
 }


Attachment: [text/bzr-bundle] bzr/bjorn.munch@oracle.com-20101112134432-m1d3ti2ui4a0mh5d.bundle
Thread
bzr commit into mysql-5.5-mtr branch (bjorn.munch:3111) Bug#58115Bjorn Munch12 Nov