List:Commits« Previous MessageNext Message »
From:Magnus Svensson Date:January 7 2009 10:55am
Subject:bzr commit into mysql-5.1 branch (msvensson:3197)
View as plain text  
#At file:///home/msvensson/mysql/6.4/ based on
revid:msvensson@stripped

 3197 Magnus Svensson	2009-01-07
      Set the DBUG format string in all threads, by using DBUG_SET_INITIAL
      Improve DBUG printouts
modified:
  storage/ndb/src/common/mgmcommon/ConfigRetriever.cpp
  storage/ndb/src/common/util/ndb_opts.c
  storage/ndb/src/mgmapi/LocalConfig.cpp
  storage/ndb/src/mgmsrv/Services.cpp
  storage/ndb/src/mgmsrv/main.cpp

per-file messages:
  storage/ndb/src/common/mgmcommon/ConfigRetriever.cpp
    Improve DBUG prints in ConfigRetriever::ConfigRetriever
  storage/ndb/src/common/util/ndb_opts.c
    Call DBUG_SET_INITIAL when setting the DBUG format to use, this will make each thread
write to DBUG log and not only the main thread.
  storage/ndb/src/mgmapi/LocalConfig.cpp
    Remove DBUG_PRINT's from LocalConfig::init
  storage/ndb/src/mgmsrv/Services.cpp
    Add DBUG_PRINT that prints the name of new connetion
  storage/ndb/src/mgmsrv/main.cpp
    Change default DBUG_ format of ndb_mgmd to include name of file
=== modified file 'storage/ndb/src/common/mgmcommon/ConfigRetriever.cpp'
--- a/storage/ndb/src/common/mgmcommon/ConfigRetriever.cpp	2008-11-26 12:59:58 +0000
+++ b/storage/ndb/src/common/mgmcommon/ConfigRetriever.cpp	2009-01-07 09:55:03 +0000
@@ -45,9 +45,9 @@ ConfigRetriever::ConfigRetriever(const c
                                  int timeout_ms)
 {
   DBUG_ENTER("ConfigRetriever::ConfigRetriever");
-  DBUG_PRINT("enter", ("%s, version: %d, node_type: %d, bind: %s, timeout: %d",
-                       _connect_string, version, node_type,
-                       _bindaddress, timeout_ms));
+  DBUG_PRINT("enter", ("connect_string: '%s'", _connect_string));
+  DBUG_PRINT("enter", ("version: %d, node_type: %d, bind: %s, timeout: %d",
+                       version, node_type,_bindaddress, timeout_ms));
 
   m_version = version;
   m_node_type = node_type;

=== modified file 'storage/ndb/src/common/util/ndb_opts.c'
--- a/storage/ndb/src/common/util/ndb_opts.c	2008-11-25 20:45:22 +0000
+++ b/storage/ndb/src/common/util/ndb_opts.c	2009-01-07 09:55:03 +0000
@@ -62,14 +62,9 @@ ndb_std_get_one_option(int optid,
   switch (optid) {
 #ifndef DBUG_OFF
   case '#':
-    if (opt_debug)
-    {
-      DBUG_PUSH(opt_debug);
-    }
-    else
-    {
-      DBUG_PUSH("d:t");
-    }
+    if (!opt_debug)
+      opt_debug= "d:t";
+    DBUG_SET_INITIAL(argument ? argument : opt_debug);
     opt_ndb_endinfo= 1;
     break;
 #endif

=== modified file 'storage/ndb/src/mgmapi/LocalConfig.cpp'
--- a/storage/ndb/src/mgmapi/LocalConfig.cpp	2008-12-02 14:25:58 +0000
+++ b/storage/ndb/src/mgmapi/LocalConfig.cpp	2009-01-07 09:55:03 +0000
@@ -29,7 +29,6 @@ bool
 LocalConfig::init(const char *connectString,
 		  const char *fileName)
 {
-  DBUG_ENTER("LocalConfig::init");
   /** 
    * Escalation:
    *  1. Check connectString
@@ -46,19 +45,19 @@ LocalConfig::init(const char *connectStr
   if(connectString != 0 && connectString[0] != 0){
     if(readConnectString(connectString, "connect string")){
       if (ids.size())
-	DBUG_RETURN(true);
+	return true;
       // only nodeid given, continue to find hosts
     } else
-      DBUG_RETURN(false);
+      return false;
   }
 
   //2. Check given filename
   if (fileName && strlen(fileName) > 0) {
     bool fopenError;
     if(readFile(fileName, fopenError)){
-      DBUG_RETURN(true);
+      return true;
     }
-    DBUG_RETURN(false);
+    return false;
   }
 
   //3. Check environment variable
@@ -66,9 +65,9 @@ LocalConfig::init(const char *connectStr
   if(NdbEnv_GetEnv("NDB_CONNECTSTRING", buf, sizeof(buf)) &&
      strlen(buf) != 0){
     if(readConnectString(buf, "NDB_CONNECTSTRING")){
-      DBUG_RETURN(true);
+      return true;
     }
-    DBUG_RETURN(false);
+    return false;
   }
   
   //4. Check Ndb.cfg in NDB_HOME
@@ -77,9 +76,9 @@ LocalConfig::init(const char *connectStr
     char *buf2= NdbConfig_NdbCfgName(1 /*true*/);
     NdbAutoPtr<char> tmp_aptr(buf2);
     if(readFile(buf2, fopenError))
-      DBUG_RETURN(true);
+      return true;
     if (!fopenError)
-      DBUG_RETURN(false);
+      return false;
   }
 
   //5. Check Ndb.cfg in cwd
@@ -88,9 +87,9 @@ LocalConfig::init(const char *connectStr
     char *buf2= NdbConfig_NdbCfgName(0 /*false*/);
     NdbAutoPtr<char> tmp_aptr(buf2);
     if(readFile(buf2, fopenError))
-      DBUG_RETURN(true);
+      return true;
     if (!fopenError)
-      DBUG_RETURN(false);
+      return false;
   }
 
   //7. Check
@@ -98,12 +97,12 @@ LocalConfig::init(const char *connectStr
     char buf2[256];
     BaseString::snprintf(buf2, sizeof(buf2), "host=localhost:%s", NDB_PORT);
     if(readConnectString(buf2, "default connect string"))
-      DBUG_RETURN(true);
+      return true;
   }
 
   setError(0, "");
 
-  DBUG_RETURN(false);
+  return false;
 }
 
 LocalConfig::~LocalConfig(){

=== modified file 'storage/ndb/src/mgmsrv/Services.cpp'
--- a/storage/ndb/src/mgmsrv/Services.cpp	2008-12-19 22:23:14 +0000
+++ b/storage/ndb/src/mgmsrv/Services.cpp	2009-01-07 09:55:03 +0000
@@ -338,7 +338,7 @@ MgmApiSession::MgmApiSession(class MgmtS
   SOCKET_SIZE_TYPE addrlen= sizeof(addr);
   my_getpeername(sock, (struct sockaddr*)&addr, &addrlen);
   m_name.assfmt("%s:%d", inet_ntoa(addr.sin_addr), ntohs(addr.sin_port));
-
+  DBUG_PRINT("info", ("new connection from: %s", m_name.c_str()));
   DBUG_VOID_RETURN;
 }
 

=== modified file 'storage/ndb/src/mgmsrv/main.cpp'
--- a/storage/ndb/src/mgmsrv/main.cpp	2008-12-16 14:31:45 +0000
+++ b/storage/ndb/src/mgmsrv/main.cpp	2009-01-07 09:55:03 +0000
@@ -172,7 +172,7 @@ int main(int argc, char** argv)
 
   int ho_error;
 #ifndef DBUG_OFF
-  opt_debug= "d:t:O,/tmp/ndb_mgmd.trace";
+  opt_debug= "d:t:i:F:o,/tmp/ndb_mgmd.trace";
 #endif
   if ((ho_error=handle_options(&argc, &argv, my_long_options, 
 			       ndb_std_get_one_option)))

Thread
bzr commit into mysql-5.1 branch (msvensson:3197) Magnus Svensson7 Jan 2009