#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 07:58:30 +0000
@@ -2544,6 +2544,41 @@ sub ndbcluster_wait_started($$){
}
+sub ndbcluster_dump($) {
+ my ($cluster)= @_;
+
+ print "\n== Dumping 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") )
+ {
+ print "$file:\n";
+ mtr_printfile("$file");
+ print "\n";
+ }
+ }
+
+ # ndb(s)
+ foreach my $ndbd ( in_cluster($cluster, ndbds()) )
+ {
+ my $datadir = $ndbd->value('DataDir');
+
+ # Should find ndbd.log
+ foreach my $file ( glob("$datadir/ndbd.log") )
+ {
+ print "$file:\n";
+ mtr_printfile("$file");
+ print "\n";
+ }
+ }
+}
+
+
sub ndb_mgmd_wait_started($) {
my ($cluster)= @_;
@@ -4948,6 +4983,13 @@ sub start_servers($) {
{
# failed to start
$tinfo->{'comment'}= "Start of '".$cluster->name()."' cluster failed";
+
+ #
+ # Dump cluster log files to log file to help analyze the
+ # cause of the failed start
+ #
+ ndbcluster_dump($cluster);
+
return 1;
}
}
Attachment: [text/bzr-bundle] bzr/magnus.blaudd@oracle.com-20110530075830-uhtji1v3z5si0ozs.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-mtr branch (magnus.blaudd:3002) Bug#12603874 | magnus.blaudd | 31 May |