List:Commits« Previous MessageNext Message »
From:Bjorn Munch Date:November 18 2010 3:59pm
Subject:bzr commit into mysql-trunk-mtr branch (bjorn.munch:2988) Bug#58115
View as plain text  
#At file:///home/bm136801/my/mtr-tr/ based on revid:bjorn.munch@stripped

 2988 Bjorn Munch	2010-11-18
      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.
      Removed suppression of UUID warning which is now avoided

    modified:
      mysql-test/include/mtr_warnings.sql
      mysql-test/mysql-test-run.pl
=== modified file 'mysql-test/include/mtr_warnings.sql'
--- a/mysql-test/include/mtr_warnings.sql	2010-11-09 20:10:44 +0000
+++ b/mysql-test/include/mtr_warnings.sql	2010-11-18 15:57:46 +0000
@@ -241,9 +241,6 @@ INSERT INTO global_suppressions VALUES
   */
  ("Found lock of type 6 that is write and read locked"),
 
- /* After BUG#57840, we may restart master w/o restarting slave */
- ("The master.s UUID has changed, although this should not happen"),
-
  ("THE_LAST_SUPPRESSION")||
 
 

=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl	2010-11-17 10:23:22 +0000
+++ b/mysql-test/mysql-test-run.pl	2010-11-18 15:57:46 +0000
@@ -4721,6 +4721,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");
@@ -4729,29 +4733,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;
   }
 
@@ -4764,6 +4773,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;
     }
   }
@@ -4788,6 +4798,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;
       }
 
@@ -4804,6 +4815,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;
       }
 
@@ -4812,6 +4824,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-20101118155746-ytvj820xcf3or6oi.bundle
Thread
bzr commit into mysql-trunk-mtr branch (bjorn.munch:2988) Bug#58115Bjorn Munch18 Nov