List:Commits« Previous MessageNext Message »
From:tomas Date:June 12 2007 5:03am
Subject:bk commit into 5.1 tree (tomas:1.2528)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas 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, 2007-06-12 07:03:35+02:00, tomas@stripped +7 -0
  WL#3920 - ndb_restore reporting
  - add start, completed events

  storage/ndb/include/mgmapi/ndb_logevent.h@stripped, 2007-06-12 07:03:31+02:00, tomas@stripped +17 -5
    WL#3920 - ndb_restore reporting

  storage/ndb/src/common/debugger/EventLogger.cpp@stripped, 2007-06-12 07:03:31+02:00, tomas@stripped +16 -2
    WL#3920 - ndb_restore reporting

  storage/ndb/src/mgmapi/ndb_logevent.cpp@stripped, 2007-06-12 07:03:31+02:00, tomas@stripped +6 -0
    WL#3920 - ndb_restore reporting

  storage/ndb/tools/restore/consumer.hpp@stripped, 2007-06-12 07:03:31+02:00, tomas@stripped +4 -1
    WL#3920 - ndb_restore reporting

  storage/ndb/tools/restore/consumer_restore.cpp@stripped, 2007-06-12 07:03:32+02:00, tomas@stripped +23 -1
    WL#3920 - ndb_restore reporting

  storage/ndb/tools/restore/consumer_restore.hpp@stripped, 2007-06-12 07:03:32+02:00, tomas@stripped +2 -1
    WL#3920 - ndb_restore reporting

  storage/ndb/tools/restore/restore_main.cpp@stripped, 2007-06-12 07:03:32+02:00, tomas@stripped +9 -3
    WL#3920 - ndb_restore reporting

# 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:	tomas
# Host:	whalegate.ndb.mysql.com
# Root:	/home/tomas/mysql-5.1-telco

--- 1.48/storage/ndb/src/common/debugger/EventLogger.cpp	2007-06-11 17:51:37 +02:00
+++ 1.49/storage/ndb/src/common/debugger/EventLogger.cpp	2007-06-12 07:03:31 +02:00
@@ -844,12 +844,18 @@
 		       refToNode(theData[1]), 
 		       theData[3]);
 }
+void getTextRestoreStarted(QQQQ)
+{
+  BaseString::snprintf(m_text, m_text_len,
+                       "Restore started: backup %u from node %u",
+                       theData[1], theData[2]);
+}
 void getTextRestoreMetaData(QQQQ)
 {
   BaseString::snprintf(m_text, m_text_len,
                        "Restore meta data: backup %u from node %u "
                        "#Tables: %u\n"
-                       " #Tablespaces: %u #Logfilegroups %u "
+                       " #Tablespaces: %u #Logfilegroups: %u "
                        "#datafiles: %u #undofiles: %u",
                        theData[1], theData[2], theData[3],
                        theData[4], theData[5], theData[6], theData[7]);
@@ -872,6 +878,12 @@
                        make_uint64(theData[3], theData[4]),
                        make_uint64(theData[5], theData[6]));
 }
+void getTextRestoreCompleted(QQQQ)
+{
+  BaseString::snprintf(m_text, m_text_len,
+                       "Restore completed: backup %u from node %u",
+                       theData[1], theData[2]);
+}
 
 void getTextSingleUser(QQQQ) {
   switch (theData[1])
@@ -1074,9 +1086,11 @@
   ROW(BackupCompleted,         LogLevel::llBackup, 7, Logger::LL_INFO ),
   ROW(BackupFailedToStart,     LogLevel::llBackup, 7, Logger::LL_ALERT),
   ROW(BackupAborted,           LogLevel::llBackup, 7, Logger::LL_ALERT),
+  ROW(RestoreStarted,          LogLevel::llBackup, 7, Logger::LL_INFO ),
   ROW(RestoreMetaData,         LogLevel::llBackup, 7, Logger::LL_INFO ),
   ROW(RestoreData,             LogLevel::llBackup, 7, Logger::LL_INFO ),
-  ROW(RestoreLog,              LogLevel::llBackup, 7, Logger::LL_INFO )
+  ROW(RestoreLog,              LogLevel::llBackup, 7, Logger::LL_INFO ),
+  ROW(RestoreCompleted,        LogLevel::llBackup, 7, Logger::LL_INFO )
 };
 
 const Uint32 EventLoggerBase::matrixSize=

--- 1.61/storage/ndb/tools/restore/restore_main.cpp	2007-06-11 17:51:37 +02:00
+++ 1.62/storage/ndb/tools/restore/restore_main.cpp	2007-06-12 07:03:32 +02:00
@@ -782,6 +782,11 @@
     }
 
   }
+
+  /* report to clusterlog if applicable */
+  for (i = 0; i < g_consumers.size(); i++)
+    g_consumers[i]->report_started(ga_backupId, ga_nodeId);
+
   debug << "Restore objects (tablespaces, ..)" << endl;
   for(i = 0; i<metaData.getNoOfObjects(); i++)
   {
@@ -1033,6 +1038,10 @@
     }               
   }
   
+  /* report to clusterlog if applicable */
+  for (i = 0; i < g_consumers.size(); i++)
+    g_consumers[i]->report_completed(ga_backupId, ga_nodeId);
+
   clearConsumers();
 
   for(i = 0; i < metaData.getNoOfTables(); i++)
@@ -1045,9 +1054,6 @@
       table_output[i] = NULL;
     }
   }
-
-  for (j = 0; j < g_consumers.size(); j++) 
-    g_consumers[j]->report_done();
 
   if (opt_verbose)
     return NDBT_ProgramExit(NDBT_OK);

--- 1.16/storage/ndb/tools/restore/consumer.hpp	2007-06-11 17:51:37 +02:00
+++ 1.17/storage/ndb/tools/restore/consumer.hpp	2007-06-12 07:03:31 +02:00
@@ -38,13 +38,16 @@
   virtual bool finalize_table(const TableS &){return true;}
   virtual bool createSystable(const TableS &){ return true;}
   virtual bool update_apply_status(const RestoreMetaData &metaData){return true;}
+  virtual bool report_started(unsigned backup_id, unsigned node_id)
+    {return true;}
   virtual bool report_meta_data(unsigned backup_id, unsigned node_id)
     {return true;}
   virtual bool report_data(unsigned backup_id, unsigned node_id)
     {return true;}
   virtual bool report_log(unsigned backup_id, unsigned node_id)
     {return true;}
-  virtual bool report_done(){return true;}
+  virtual bool report_completed(unsigned backup_id, unsigned node_id)
+    {return true;}
   NODE_GROUP_MAP *m_nodegroup_map;
   uint            m_nodegroup_map_len;
   virtual bool has_temp_error() {return false;}

--- 1.52/storage/ndb/tools/restore/consumer_restore.cpp	2007-06-11 17:53:45 +02:00
+++ 1.53/storage/ndb/tools/restore/consumer_restore.cpp	2007-06-12 07:03:32 +02:00
@@ -710,6 +710,20 @@
 }
 
 bool
+BackupRestore::report_started(unsigned backup_id, unsigned node_id)
+{
+  if (m_ndb)
+  {
+    Uint32 data[3];
+    data[0]= NDB_LE_RestoreStarted;
+    data[1]= backup_id;
+    data[2]= node_id;
+    Ndb_internal::send_event_report(m_ndb, data, 3);
+  }
+  return true;
+}
+
+bool
 BackupRestore::report_meta_data(unsigned backup_id, unsigned node_id)
 {
   if (m_ndb)
@@ -764,8 +778,16 @@
 }
 
 bool
-BackupRestore::report_done()
+BackupRestore::report_completed(unsigned backup_id, unsigned node_id)
 {
+  if (m_ndb)
+  {
+    Uint32 data[3];
+    data[0]= NDB_LE_RestoreCompleted;
+    data[1]= backup_id;
+    data[2]= node_id;
+    Ndb_internal::send_event_report(m_ndb, data, 3);
+  }
   return true;
 }
 

--- 1.19/storage/ndb/tools/restore/consumer_restore.hpp	2007-06-11 17:51:37 +02:00
+++ 1.20/storage/ndb/tools/restore/consumer_restore.hpp	2007-06-12 07:03:32 +02:00
@@ -83,10 +83,11 @@
   virtual bool createSystable(const TableS & table);
   virtual bool table_equal(const TableS & table);
   virtual bool update_apply_status(const RestoreMetaData &metaData);
+  virtual bool report_started(unsigned node_id, unsigned backup_id);
   virtual bool report_meta_data(unsigned node_id, unsigned backup_id);
   virtual bool report_data(unsigned node_id, unsigned backup_id);
   virtual bool report_log(unsigned node_id, unsigned backup_id);
-  virtual bool report_done();
+  virtual bool report_completed(unsigned node_id, unsigned backup_id);
   void connectToMysql();
   bool map_in_frm(char *new_data, const char *data,
                   uint data_len, uint *new_data_len);

--- 1.11/storage/ndb/include/mgmapi/ndb_logevent.h	2007-06-11 17:51:37 +02:00
+++ 1.12/storage/ndb/include/mgmapi/ndb_logevent.h	2007-06-12 07:03:31 +02:00
@@ -174,6 +174,10 @@
     NDB_LE_RestoreData = 64,
     /** NDB_MGM_EVENT_CATEGORY_BACKUP */
     NDB_LE_RestoreLog = 65,
+    /** NDB_MGM_EVENT_CATEGORY_BACKUP */
+    NDB_LE_RestoreStarted = 66,
+    /** NDB_MGM_EVENT_CATEGORY_BACKUP */
+    NDB_LE_RestoreCompleted = 67,
 
     /** NDB_MGM_EVENT_CATEGORY_INFO */
     NDB_LE_EventBufferStatus = 58,
@@ -183,11 +187,9 @@
     /** NDB_MGM_EVENT_CATEGORY_STARTUP */
     NDB_LE_StartReport = 60
 
-    /* 61 unused */
-    /* 62 used */
-    /* 63 used */
-    /* 64 used */
-    /* 65 unused */
+    /* 61 (used in upcoming patch) */
+    /* 62-67 used */
+    /* 68 unused */
 
   };
 
@@ -662,6 +664,11 @@
 	unsigned backup_id;
 	unsigned error;
       } BackupAborted;
+      /** Log event data @ref NDB_LE_RestoreStarted */
+      struct {
+	unsigned backup_id;
+	unsigned node_id;
+      } RestoreStarted;
       /** Log event data @ref NDB_LE_RestoreMetaData */
       struct {
 	unsigned backup_id;
@@ -690,6 +697,11 @@
 	unsigned n_bytes_lo;
 	unsigned n_bytes_hi;
       } RestoreLog;
+      /** Log event data @ref NDB_LE_RestoreCompleted */
+      struct {
+	unsigned backup_id;
+	unsigned node_id;
+      } RestoreCompleted;
       /** Log event data @ref NDB_LE_SingleUser */
       struct {
         unsigned type;

--- 1.14/storage/ndb/src/mgmapi/ndb_logevent.cpp	2007-06-11 17:51:37 +02:00
+++ 1.15/storage/ndb/src/mgmapi/ndb_logevent.cpp	2007-06-12 07:03:31 +02:00
@@ -328,6 +328,9 @@
   ROW( BackupAborted,       "backup_id",     2, backup_id),
   ROW( BackupAborted,       "error",         3, error),
 
+  ROW( RestoreStarted,      "backup_id",     1, backup_id),
+  ROW( RestoreStarted,      "node_id",       2, node_id),
+
   ROW( RestoreMetaData,     "backup_id",     1, backup_id),
   ROW( RestoreMetaData,     "node_id",       2, node_id),
   ROW( RestoreMetaData,     "n_tables",      3, n_tables),
@@ -349,6 +352,9 @@
   ROW( RestoreLog,          "n_records_hi",  4, n_records_hi),
   ROW( RestoreLog,          "n_bytes_lo",    5, n_bytes_lo),
   ROW( RestoreLog,          "n_bytes_hi",    6, n_bytes_hi),
+
+  ROW( RestoreCompleted,    "backup_id",     1, backup_id),
+  ROW( RestoreCompleted,    "node_id",       2, node_id),
 
   ROW( SingleUser,          "type",	     1, type),
   ROW( SingleUser,          "node_id",	     2, node_id),
Thread
bk commit into 5.1 tree (tomas:1.2528)tomas12 Jun