List:Commits« Previous MessageNext Message »
From:David Li Date:September 26 2006 5:03am
Subject:bk commit into 4.1 tree (dli:1.2534) BUG#19651
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of dli. When dli 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-09-26 11:03:11+08:00, dli@stripped +4 -0
  fix for bug#19651, if temporary error occured while retoring, report it in the restore
result.

  ndb/tools/restore/consumer.hpp@stripped, 2006-09-26 11:03:10+08:00, dli@stripped
+1 -0
    added a function to judge whether there is temporary error.

  ndb/tools/restore/consumer_restore.cpp@stripped, 2006-09-26 11:03:10+08:00,
dli@stripped +6 -0
    record when temporary error occured in restore.

  ndb/tools/restore/consumer_restore.hpp@stripped, 2006-09-26 11:03:10+08:00,
dli@stripped +3 -0
    added a member to record temporary error in restore.

  ndb/tools/restore/restore_main.cpp@stripped, 2006-09-26 11:03:10+08:00,
dli@stripped +11 -0
    report temporary error in restore.

# 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:	dli
# Host:	dev3-76.dev.cn.tlan
# Root:	/home/dli/mysql/mysql-4.1/mysql-4.1-bug-19651

--- 1.28/ndb/tools/restore/restore_main.cpp	2006-09-26 11:03:16 +08:00
+++ 1.29/ndb/tools/restore/restore_main.cpp	2006-09-26 11:03:16 +08:00
@@ -411,6 +411,17 @@
       }
     }
   }
+  for(Uint32 i= 0; i < g_consumers.size(); i++) 
+  {
+    if (g_consumers[i]->has_temp_error())
+    {
+      clearConsumers();
+      ndbout_c("\nRestore successful, but encountered temporary error, "
+               "please look at configuration.");
+      return NDBT_ProgramExit(NDBT_TEMPORARY);
+    }
+  }
+
   clearConsumers();
   return NDBT_ProgramExit(NDBT_OK);
 } // main

--- 1.5/ndb/tools/restore/consumer.hpp	2006-09-26 11:03:16 +08:00
+++ 1.6/ndb/tools/restore/consumer.hpp	2006-09-26 11:03:16 +08:00
@@ -31,6 +31,7 @@
   virtual void logEntry(const LogEntry &){}
   virtual void endOfLogEntrys(){}
   virtual bool finalize_table(const TableS &){return true;}
+  virtual bool has_temp_error() {return false;}
 };
 
 #endif

--- 1.13/ndb/tools/restore/consumer_restore.cpp	2006-09-26 11:03:16 +08:00
+++ 1.14/ndb/tools/restore/consumer_restore.cpp	2006-09-26 11:03:16 +08:00
@@ -140,6 +140,11 @@
 }
 
 bool
+BackupRestore::has_temp_error(){
+  return m_temp_error;
+}
+
+bool
 BackupRestore::table(const TableS & table){
   if (!m_restore && !m_restore_meta)
     return true;
@@ -437,6 +442,7 @@
     
   case NdbError::TemporaryError:
     err << "Temporary error: " << error << endl;
+    m_temp_error = true;
     NdbSleep_MilliSleep(sleepTime);
     return true;
     // RETRY

--- 1.7/ndb/tools/restore/consumer_restore.hpp	2006-09-26 11:03:16 +08:00
+++ 1.8/ndb/tools/restore/consumer_restore.hpp	2006-09-26 11:03:16 +08:00
@@ -41,6 +41,7 @@
     m_parallelism = parallelism;
     m_callback = 0;
     m_free_callback = 0;
+    m_temp_error = false;
     m_transactions = 0;
     m_cache.m_old_table = 0;
   }
@@ -60,6 +61,7 @@
   virtual void logEntry(const LogEntry &);
   virtual void endOfLogEntrys();
   virtual bool finalize_table(const TableS &);
+  virtual bool has_temp_error();
   void connectToMysql();
   Ndb * m_ndb;
   bool m_restore;
@@ -72,6 +74,7 @@
 
   restore_callback_t *m_callback;
   restore_callback_t *m_free_callback;
+  bool m_temp_error;
 
   /**
    * m_new_table_ids[X] = Y;
Thread
bk commit into 4.1 tree (dli:1.2534) BUG#19651David Li26 Sep