MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:jonas Date:November 28 2006 2:11pm
Subject:bk commit into 5.1 tree (jonas:1.2331) BUG#24544
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of jonas. When jonas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-11-28 15:11:13+01:00, jonas@stripped +4 -0
  ndb - bug#24544
    fix so backup message is printed even in case of "ndb_mgm -e"

  storage/ndb/src/common/debugger/signaldata/BackupSignalData.cpp@stripped, 2006-11-28 15:11:11+01:00, jonas@stripped +3 -2
    fix backup printer

  storage/ndb/src/mgmclient/CommandInterpreter.cpp@stripped, 2006-11-28 15:11:11+01:00, jonas@stripped +57 -50
    Fix so that backup message is printed even if "ndb_mgm -e"

  storage/ndb/src/ndbapi/SignalSender.cpp@stripped, 2006-11-28 15:11:11+01:00, jonas@stripped +0 -9
    move method into TransporterFacade to enable API_TRACE

  storage/ndb/src/ndbapi/TransporterFacade.cpp@stripped, 2006-11-28 15:11:11+01:00, jonas@stripped +25 -0
    move method into TransporterFacade to enable API_TRACE

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	jonas
# Host:	perch.ndb.mysql.com
# Root:	/home/jonas/src/51-work

--- 1.3/storage/ndb/src/common/debugger/signaldata/BackupSignalData.cpp	2006-11-28 15:11:18 +01:00
+++ 1.4/storage/ndb/src/common/debugger/signaldata/BackupSignalData.cpp	2006-11-28 15:11:18 +01:00
@@ -20,9 +20,10 @@
 bool 
 printBACKUP_REQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 bno){
   BackupReq* sig = (BackupReq*)theData;
-  fprintf(output, " senderData: %d DataLength: %d\n", 
+  fprintf(output, " senderData: %d DataLength: %d flags: %d\n", 
 	  sig->senderData,
-	  sig->backupDataLen);
+	  sig->backupDataLen,
+	  sig->flags);
   return true;
 }
 

--- 1.75/storage/ndb/src/mgmclient/CommandInterpreter.cpp	2006-11-28 15:11:18 +01:00
+++ 1.76/storage/ndb/src/mgmclient/CommandInterpreter.cpp	2006-11-28 15:11:18 +01:00
@@ -119,7 +119,7 @@
   int  executeStatus(int processId, const char* parameters, bool all);
   int  executeEventReporting(int processId, const char* parameters, bool all);
   int  executeDumpState(int processId, const char* parameters, bool all);
-  int  executeStartBackup(char * parameters);
+  int  executeStartBackup(char * parameters, bool interactive);
   int  executeAbortBackup(char * parameters);
   int  executeStop(Vector<BaseString> &command_list, unsigned command_pos,
                    int *node_ids, int no_of_nodes);
@@ -991,7 +991,7 @@
   else if(strcasecmp(firstToken, "START") == 0 &&
 	  allAfterFirstToken != NULL &&
 	  strncasecmp(allAfterFirstToken, "BACKUP", sizeof("BACKUP") - 1) == 0){
-    m_error= executeStartBackup(allAfterFirstToken);
+    m_error= executeStartBackup(allAfterFirstToken, interactive);
     DBUG_RETURN(true);
   }
   else if(strcasecmp(firstToken, "ABORT") == 0 &&
@@ -2442,24 +2442,17 @@
   return retval;
 }
 
+
 /*****************************************************************************
  * Backup
  *****************************************************************************/
 int
-CommandInterpreter::executeStartBackup(char* parameters)
+CommandInterpreter::executeStartBackup(char* parameters, bool interactive)
 {
   struct ndb_mgm_reply reply;
   unsigned int backupId;
-#if 0
-  int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP, 0 };
-  int fd = ndb_mgm_listen_event(m_mgmsrv, filter);
-  if (fd < 0)
-  {
-    ndbout << "Initializing start of backup failed" << endl;
-    printError();
-    return fd;
-  }
-#endif
+  int fd = -1;
+  
   Vector<BaseString> args;
   {
     BaseString(parameters).split(args);
@@ -2472,25 +2465,21 @@
   int sz= args.size();
 
   int result;
-  if (sz == 2 &&
-      args[1] == "NOWAIT")
+  int flags = 2;
+  if (sz == 2 && args[1] == "NOWAIT")
   {
+    flags = 0;
     result = ndb_mgm_start_backup(m_mgmsrv, 0, &backupId, &reply);
   }
-  else if (sz == 1 ||
-	   (sz == 3 &&
-	    args[1] == "WAIT" &&
-	    args[2] == "COMPLETED"))
+  else if (sz == 1 || (sz == 3 && args[1] == "WAIT" && args[2] == "COMPLETED"))
   {
+    flags = 2;
     ndbout_c("Waiting for completed, this may take several minutes");
-    result = ndb_mgm_start_backup(m_mgmsrv, 2, &backupId, &reply);
   }
-  else if (sz == 3 &&
-	   args[1] == "WAIT" &&
-	   args[2] == "STARTED")
+  else if (sz == 3 && args[1] == "WAIT" && args[2] == "STARTED")
   {
     ndbout_c("Waiting for started, this may take several minutes");
-    result = ndb_mgm_start_backup(m_mgmsrv, 1, &backupId, &reply);
+    flags = 1;
   }
   else
   {
@@ -2498,45 +2487,63 @@
     return -1;
   }
 
+  /**
+   * If interactive...event listner is already running
+   */
+  if (flags == 2 && !interactive)
+  {
+    int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP, 0, 0 };
+    fd = ndb_mgm_listen_event(m_mgmsrv, filter);
+    if (fd < 0)
+    {
+      ndbout << "Initializing start of backup failed" << endl;
+      printError();
+      return fd;
+    }
+  }
+  result = ndb_mgm_start_backup(m_mgmsrv, flags, &backupId, &reply);
+
   if (result != 0) {
     ndbout << "Backup failed" << endl;
     printError();
-#if 0
-    close(fd);
-#endif
+
+    if (fd >= 0) 
+      close(fd);
     return result;
   }
-#if 0
-  ndbout_c("Waiting for completed, this may take several minutes");
-  char *tmp;
-  char buf[1024];
+
+  if (fd >= 0)
   {
-    SocketInputStream in(fd);
-    int count = 0;
+    char *tmp;
+    char buf[1024];
+    {
+      SocketInputStream in(fd);
+      int count = 0;
+      do {
+	tmp = in.gets(buf, 1024);
+	if(tmp)
+	{
+	  ndbout << tmp;
+	  unsigned int id;
+	  if(sscanf(tmp, "%*[^:]: Backup %d ", &id) == 1 && id == backupId){
+	    count++;
+	  }
+	}
+      } while(count < 2);
+    }
+    
+    SocketInputStream in(fd, 10);
     do {
       tmp = in.gets(buf, 1024);
-      if(tmp)
+      if(tmp && tmp[0] != 0)
       {
 	ndbout << tmp;
-	unsigned int id;
-	if(sscanf(tmp, "%*[^:]: Backup %d ", &id) == 1 && id == backupId){
-	  count++;
-	}
       }
-    } while(count < 2);
+    } while(tmp && tmp[0] != 0);
+    
+    close(fd);
   }
 
-  SocketInputStream in(fd, 10);
-  do {
-    tmp = in.gets(buf, 1024);
-    if(tmp && tmp[0] != 0)
-    {
-      ndbout << tmp;
-    }
-  } while(tmp && tmp[0] != 0);
-
-  close(fd);
-#endif  
   return 0;
 }
 

--- 1.52/storage/ndb/src/ndbapi/TransporterFacade.cpp	2006-11-28 15:11:18 +01:00
+++ 1.53/storage/ndb/src/ndbapi/TransporterFacade.cpp	2006-11-28 15:11:18 +01:00
@@ -1512,3 +1512,28 @@
 
 template class Vector<NodeStatusFunction>;
 template class Vector<TransporterFacade::ThreadData::Object_Execute>;
+
+#include "SignalSender.hpp"
+
+SendStatus
+SignalSender::sendSignal(Uint16 nodeId, const SimpleSignal * s){
+#ifdef API_TRACE
+  if(setSignalLog() && TRACE_GSN(s->header.theVerId_signalNumber)){
+    SignalHeader tmp = s->header;
+    tmp.theSendersBlockRef = getOwnRef();
+
+    LinearSectionPtr ptr[3];
+    signalLogger.sendSignal(tmp,
+			    1,
+			    s->theData,
+			    nodeId, ptr, 0);
+    signalLogger.flushSignalLog();
+  }
+#endif
+  
+  return theFacade->theTransporterRegistry->prepareSend(&s->header,
+							1, // JBB
+							&s->theData[0],
+							nodeId, 
+							&s->ptr[0]);
+}

--- 1.7/storage/ndb/src/ndbapi/SignalSender.cpp	2006-11-28 15:11:18 +01:00
+++ 1.8/storage/ndb/src/ndbapi/SignalSender.cpp	2006-11-28 15:11:18 +01:00
@@ -131,15 +131,6 @@
   return theFacade->theClusterMgr->getNoOfConnectedNodes();
 }
 
-SendStatus
-SignalSender::sendSignal(Uint16 nodeId, const SimpleSignal * s){
-  return theFacade->theTransporterRegistry->prepareSend(&s->header,
-							1, // JBB
-							&s->theData[0],
-							nodeId, 
-							&s->ptr[0]);
-}
-
 template<class T>
 SimpleSignal *
 SignalSender::waitFor(Uint32 timeOutMillis, T & t)
Thread
bk commit into 5.1 tree (jonas:1.2331) BUG#24544jonas28 Nov