List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:December 3 2010 11:43am
Subject:bzr push into mysql-5.1-telco-7.1 branch (jonas:4012 to 4013)
View as plain text  
 4013 Jonas Oreland	2010-12-03 [merge]
      ndb - merge 70 to 71

    added:
      mysql-test/suite/ndb/std_data/ndb_backup_bug54613/
      mysql-test/suite/ndb/std_data/ndb_backup_bug54613/BACKUP-2.2.ctl
    modified:
      mysql-test/Makefile.am
      mysql-test/suite/ndb/t/ndb_restore_compat.test
      storage/ndb/src/kernel/blocks/LocalProxy.hpp
      storage/ndb/src/kernel/blocks/suma/Suma.cpp
      storage/ndb/src/kernel/blocks/suma/Suma.hpp
      storage/ndb/src/kernel/blocks/suma/SumaInit.cpp
      storage/ndb/tools/restore/Restore.cpp
      storage/ndb/tools/restore/Restore.hpp
      storage/ndb/tools/restore/consumer_restore.cpp
      storage/ndb/tools/restore/restore_main.cpp
 4012 Jonas Oreland	2010-12-03 [merge]
      ndb - merge 70 to 71

    modified:
      storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
      storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
      storage/ndb/src/ndbapi/NdbImpl.hpp
      storage/ndb/src/ndbapi/Ndbif.cpp
      storage/ndb/src/ndbapi/TransporterFacade.cpp
      storage/ndb/src/ndbapi/TransporterFacade.hpp
      storage/ndb/src/ndbapi/trp_client.hpp
=== modified file 'mysql-test/Makefile.am'
--- a/mysql-test/Makefile.am	2010-10-25 12:42:01 +0000
+++ b/mysql-test/Makefile.am	2010-12-03 11:43:23 +0000
@@ -90,6 +90,7 @@ TEST_DIRS = t r include std_data std_dat
 	suite/ndb/std_data/ndb_backup51_undolog_le \
 	suite/ndb/std_data/ndb_backup_hashmap \
 	suite/ndb/std_data/ndb_backup_before_native_default \
+	suite/ndb/std_data/ndb_backup_bug54613 \
 	std_data/funcs_1 \
 	extra/binlog_tests/ extra/rpl_tests \
 	suite/binlog suite/binlog/t suite/binlog/r suite/binlog/std_data \

=== added directory 'mysql-test/suite/ndb/std_data/ndb_backup_bug54613'
=== added file 'mysql-test/suite/ndb/std_data/ndb_backup_bug54613/BACKUP-2.2.ctl'
Files a/mysql-test/suite/ndb/std_data/ndb_backup_bug54613/BACKUP-2.2.ctl	1970-01-01 00:00:00 +0000 and b/mysql-test/suite/ndb/std_data/ndb_backup_bug54613/BACKUP-2.2.ctl	2010-12-03 09:29:44 +0000 differ

=== modified file 'mysql-test/suite/ndb/t/ndb_restore_compat.test'
--- a/mysql-test/suite/ndb/t/ndb_restore_compat.test	2010-10-25 09:15:03 +0000
+++ b/mysql-test/suite/ndb/t/ndb_restore_compat.test	2010-12-03 09:36:45 +0000
@@ -88,3 +88,11 @@ USE test;
 # hugo generated data...
 select a,b,hex(b0),hex(b1),hex(b2),hex(b3),b4,hex(b5),b6,hex(b7) from t1 order by 1,2;
 drop table t1;
+
+# bug#54613
+
+--error 1
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 2 -n 2 -m --core=0 --include-databases=ham --skip-unknown-objects $backup_data_dir/ndb_backup_bug54613 >> $NDB_TOOLS_OUTPUT
+
+--error 0
+--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 2 -n 2 -m --core=0 --include-databases=ham --skip-unknown-objects --skip-broken-objects $backup_data_dir/ndb_backup_bug54613 >> $NDB_TOOLS_OUTPUT

=== modified file 'storage/ndb/src/kernel/blocks/LocalProxy.hpp'
--- a/storage/ndb/src/kernel/blocks/LocalProxy.hpp	2010-10-20 07:12:58 +0000
+++ b/storage/ndb/src/kernel/blocks/LocalProxy.hpp	2010-12-03 11:40:51 +0000
@@ -552,7 +552,7 @@ protected:
       m_sendREQ = &LocalProxy::sendDROP_TRIG_IMPL_REQ;
       m_sendCONF = &LocalProxy::sendDROP_TRIG_IMPL_CONF;
     }
-    enum { poolSize = 3 };
+    enum { poolSize = 21 };
     static SsPool<Ss_DROP_TRIG_IMPL_REQ>& pool(LocalProxy* proxy) {
       return proxy->c_ss_DROP_TRIG_IMPL_REQ;
     }

=== modified file 'storage/ndb/src/kernel/blocks/suma/Suma.cpp'
--- a/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2010-11-01 14:48:53 +0000
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2010-12-03 11:40:51 +0000
@@ -1018,6 +1018,19 @@ Suma::api_fail_subscriber_list(Signal* s
 {
   jam();
   Ptr<SubOpRecord> subOpPtr;
+
+  if (c_outstanding_drop_trig_req > 9)
+  {
+    jam();
+    /**
+     * Make sure not to overflow DbtupProxy with too many GSN_DROP_TRIG_IMPL_REQ
+     *   9 is arbitrary number...
+     */
+    sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 100,
+                        signal->getLength());
+    return;
+  }
+
   subOpPtr.i = signal->theData[2];
   if (subOpPtr.i == RNIL)
   {
@@ -3409,6 +3422,7 @@ Suma::drop_triggers(Signal* signal, Subs
         req->triggerId = triggerId;
         req->receiverRef = SUMA_REF;
 
+        c_outstanding_drop_trig_req++;
         sendSignal(DBTUP_REF, GSN_DROP_TRIG_IMPL_REQ,
                    signal, DropTrigImplReq::SignalLength, JBB);
       }
@@ -3443,6 +3457,9 @@ Suma::execDROP_TRIG_IMPL_REF(Signal* sig
   ndbrequire(subPtr.p->m_outstanding_trigger);
   subPtr.p->m_outstanding_trigger--;
 
+  ndbrequire(c_outstanding_drop_trig_req);
+  c_outstanding_drop_trig_req--;
+
   if (subPtr.p->m_outstanding_trigger)
   {
     jam();
@@ -3478,6 +3495,9 @@ Suma::execDROP_TRIG_IMPL_CONF(Signal* si
   ndbrequire(subPtr.p->m_outstanding_trigger);
   subPtr.p->m_outstanding_trigger--;
 
+  ndbrequire(c_outstanding_drop_trig_req);
+  c_outstanding_drop_trig_req--;
+
   if (subPtr.p->m_outstanding_trigger)
   {
     jam();

=== modified file 'storage/ndb/src/kernel/blocks/suma/Suma.hpp'
--- a/storage/ndb/src/kernel/blocks/suma/Suma.hpp	2010-11-01 14:16:07 +0000
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.hpp	2010-12-03 11:40:51 +0000
@@ -542,7 +542,8 @@ private:
   } c_restart;
 
   Uint32 c_current_seq; // Sequence no on subscription(s)
-  
+  Uint32 c_outstanding_drop_trig_req;
+
   NodeBitmask c_connected_nodes;  // (NODE/API) START REP / (API/NODE) FAIL REQ
   NodeBitmask c_subscriber_nodes; // 
 
@@ -643,8 +644,7 @@ private:
 
   Uint64 get_current_gci(Signal*);
 
-  void checkMaxBufferedEpochs
-(Signal *signal);
+  void checkMaxBufferedEpochs(Signal *signal);
 
   Uint64 m_max_seen_gci;      // FIRE_TRIG_ORD
   Uint64 m_max_sent_gci;      // FIRE_TRIG_ORD -> send

=== modified file 'storage/ndb/src/kernel/blocks/suma/SumaInit.cpp'
--- a/storage/ndb/src/kernel/blocks/suma/SumaInit.cpp	2010-08-26 12:33:33 +0000
+++ b/storage/ndb/src/kernel/blocks/suma/SumaInit.cpp	2010-12-03 11:40:51 +0000
@@ -135,6 +135,7 @@ Suma::Suma(Block_context& ctx) :
                &Suma::execDROP_NODEGROUP_IMPL_REQ);
 
   c_current_seq = 0;
+  c_outstanding_drop_trig_req = 0;
   c_restart.m_ref = 0;
   c_startup.m_restart_server_node_id = RNIL; // Server for my NR
   c_shutdown.m_wait_handover = false;

=== modified file 'storage/ndb/tools/restore/Restore.cpp'
--- a/storage/ndb/tools/restore/Restore.cpp	2010-11-30 07:47:55 +0000
+++ b/storage/ndb/tools/restore/Restore.cpp	2010-12-03 09:36:45 +0000
@@ -33,6 +33,7 @@
 #include "../../../../sql/ha_ndbcluster_tables.h"
 extern NdbRecordPrintFormat g_ndbrecord_print_format;
 extern bool ga_skip_unknown_objects;
+extern bool ga_skip_broken_objects;
 
 Uint16 Twiddle16(Uint16 in); // Byte shift 16-bit data
 Uint32 Twiddle32(Uint32 in); // Byte shift 32-bit data
@@ -599,13 +600,21 @@ RestoreMetaData::fixBlobs()
       }
       if (blobTable == NULL)
       {
+        table->m_broken = true;
         /* Corrupt backup, has main table, but no blob table */
         err << "Table " << table->m_dictTable->getName()
             << " has blob column " << j << " (" 
             << c->m_name.c_str()
             << ") with missing parts table in backup."
             << endl;
-        return false;
+        if (ga_skip_broken_objects)
+        {
+          continue;
+        }
+        else
+        {
+          return false;
+        }
       }
       assert(blobTable->m_dictTable != NULL);
       NdbTableImpl& bt = NdbTableImpl::getImpl(*blobTable->m_dictTable);
@@ -702,6 +711,7 @@ TableS::TableS(Uint32 version, NdbTableI
   backupVersion = version;
   m_isSysTable = false;
   m_isSYSTAB_0 = false;
+  m_broken = false;
   m_main_table = NULL;
   m_main_column_id = ~(Uint32)0;
   

=== modified file 'storage/ndb/tools/restore/Restore.hpp'
--- a/storage/ndb/tools/restore/Restore.hpp	2010-11-09 20:40:03 +0000
+++ b/storage/ndb/tools/restore/Restore.hpp	2010-12-03 09:36:45 +0000
@@ -176,6 +176,7 @@ class TableS {
 
   bool m_isSysTable;
   bool m_isSYSTAB_0;
+  bool m_broken;
 
   TableS *m_main_table;
   Uint32 m_main_column_id;
@@ -299,6 +300,12 @@ public:
   bool isSYSTAB_0() const {
     return m_isSYSTAB_0;
   } 
+
+  inline
+  bool isBroken() const {
+    return m_broken || (m_main_table && m_main_table->isBroken());
+  }
+  
 }; // TableS;
 
 class RestoreLogIterator;

=== modified file 'storage/ndb/tools/restore/consumer_restore.cpp'
--- a/storage/ndb/tools/restore/consumer_restore.cpp	2010-11-09 20:40:03 +0000
+++ b/storage/ndb/tools/restore/consumer_restore.cpp	2010-12-03 09:36:45 +0000
@@ -38,6 +38,7 @@ static Uint32 get_part_id(const NdbDicti
 
 extern BaseString g_options;
 extern unsigned int opt_no_binlog;
+extern bool ga_skip_broken_objects;
 
 bool BackupRestore::m_preserve_trailing_spaces = false;
 
@@ -1682,6 +1683,10 @@ BackupRestore::endOfTables(){
       err << "Unable to find base table `" << split[2].c_str() 
 	  << "` for index `"
 	  << indtab.getName() << "`" << endl;
+      if (ga_skip_broken_objects)
+      {
+        continue;
+      }
       return false;
     }
     NdbTableImpl& base = NdbTableImpl::getImpl(*prim);

=== modified file 'storage/ndb/tools/restore/restore_main.cpp'
--- a/storage/ndb/tools/restore/restore_main.cpp	2010-11-09 20:40:03 +0000
+++ b/storage/ndb/tools/restore/restore_main.cpp	2010-12-03 09:36:45 +0000
@@ -96,6 +96,7 @@ static bool _preserve_trailing_spaces = 
 static bool ga_disable_indexes = false;
 static bool ga_rebuild_indexes = false;
 bool ga_skip_unknown_objects = false;
+bool ga_skip_broken_objects = false;
 BaseString g_options("ndb_restore");
 
 const char *load_default_groups[]= { "mysql_cluster","ndb_restore",0 };
@@ -273,6 +274,9 @@ static struct my_option my_long_options[
   { "skip-unknown-objects", 256, "Skip unknown object when parsing backup",
     (uchar**) &ga_skip_unknown_objects, (uchar**) &ga_skip_unknown_objects, 0,
     GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
+  { "skip-broken-objects", 256, "Skip broken object when parsing backup",
+    (uchar**) &ga_skip_broken_objects, (uchar**) &ga_skip_broken_objects, 0,
+    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
   { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };
 
@@ -956,6 +960,9 @@ checkDoRestore(const TableS* table)
 static inline bool
 checkDbAndTableName(const TableS* table)
 {
+  if (table->isBroken())
+    return false;
+
   // If new options are given, ignore the old format
   if (opt_include_tables || opt_exclude_tables ||
       opt_include_databases || opt_exclude_databases ) {
@@ -1107,6 +1114,10 @@ main(int argc, char** argv)
   if (ga_rebuild_indexes)
     g_options.append(" --rebuild-indexes");
   g_options.appfmt(" -p %d", ga_nParallelism);
+  if (ga_skip_unknown_objects)
+    g_options.append(" --skip-unknown-objects");
+  if (ga_skip_broken_objects)
+    g_options.append(" --skip-broken-objects");
 
   init_progress();
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.1 branch (jonas:4012 to 4013) Jonas Oreland3 Dec