List:Commits« Previous MessageNext Message »
From:magnus.blaudd Date:May 30 2011 2:41pm
Subject:bzr commit into mysql-5.1-mtr branch (magnus.blaudd:3002) Bug#12603874
View as plain text  
#At file:///home/msvensson/mysql/5.1-mtr-bug12603874/ based on revid:magnus.blaudd@stripped

 3002 magnus.blaudd@stripped	2011-05-30
      Bug#12603874 - mtr.pl should dump cluster log files when ndbcluster_wait_started() fails
       - We have seen mystery cluster start failures and would like to improve our
      possibility to diagnose why the cluster processes has failed to start by
      dumping the cluster log files to stdout.
       - This is a huge improvement compared to before when only the
        message 'Start of mysql_cluster.X cluster failed'

    modified:
      mysql-test/mysql-test-run.pl
=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl	2011-05-09 12:53:01 +0000
+++ b/mysql-test/mysql-test-run.pl	2011-05-30 14:41:34 +0000
@@ -2544,6 +2544,41 @@ sub ndbcluster_wait_started($$){
 }
 
 
+sub ndbcluster_collect_logs($) {
+  my ($cluster)= @_;
+
+  my $logs= "== Cluster log files: ==\n\n";
+
+  # ndb_mgmd(s)
+  foreach my $ndb_mgmd ( in_cluster($cluster, ndb_mgmds()) )
+  {
+    my $datadir = $ndb_mgmd->value('DataDir');
+
+    # Should find ndb_<nodeid>_cluster.log and ndb_mgmd.log
+    foreach my $file ( glob("$datadir/ndb_*.log") )
+    {
+      $logs.= "$file:\n";
+      $logs.= mtr_grab_file($file);
+      $logs.= "\n";
+    }
+  }
+
+  # ndbd(s)
+  foreach my $ndbd ( in_cluster($cluster, ndbds()) )
+  {
+    my $datadir = $ndbd->value('DataDir');
+    my $file = "$datadir/ndbd.log";
+    if (-f $file)
+    {
+      $logs.= "$file:\n";
+      $logs.= mtr_grab_file($file);
+      $logs.= "\n";
+    }
+  }
+  return $logs;
+}
+
+
 sub ndb_mgmd_wait_started($) {
   my ($cluster)= @_;
 
@@ -4948,6 +4983,8 @@ sub start_servers($) {
     {
       # failed to start
       $tinfo->{'comment'}= "Start of '".$cluster->name()."' cluster failed";
+      $tinfo->{logfile}= ndbcluster_collect_logs($cluster);
+
       return 1;
     }
   }


Attachment: [text/bzr-bundle] bzr/magnus.blaudd@oracle.com-20110530144134-h8ye797zo3wwvb4k.bundle
Thread
bzr commit into mysql-5.1-mtr branch (magnus.blaudd:3002) Bug#12603874magnus.blaudd31 May