List:Internals« Previous MessageNext Message »
From:jonas.oreland Date:July 22 2005 12:18pm
Subject:bk commit into 5.0 tree (joreland:1.1875) BUG#11675
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 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
  1.1875 05/07/22 12:17:53 joreland@stripped +6 -0
  bug#11675 - ndb backup 
    Fix invalid backup log when using #nodes != 2^x
    Fix ndb_restore --printXXX options
      (among other init counters)

  ndb/tools/restore/restore_main.cpp
    1.30 05/07/22 12:17:49 joreland@stripped +8 -1
    Fix if-statements
      for correct handling of ndb_restore flags

  ndb/tools/restore/consumer_printer.hpp
    1.3 05/07/22 12:17:49 joreland@stripped +2 -0
    Init log/data count in printer

  ndb/tools/restore/Restore.cpp
    1.25 05/07/22 12:17:49 joreland@stripped +1 -1
    Changed prinout (since it's wrong if you only print stuff)

  ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp
    1.8 05/07/22 12:17:49 joreland@stripped +1 -1
    send "real" frag id to backup

  ndb/src/kernel/blocks/backup/Backup.hpp
    1.9 05/07/22 12:17:49 joreland@stripped +0 -3
    remove frag_mask since in 5.0 extra frag bit in in bit 0

  ndb/src/kernel/blocks/backup/Backup.cpp
    1.21 05/07/22 12:17:49 joreland@stripped +0 -20
    remove frag_mask since in 5.0 extra frag bit in in bit 0

# 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:	joreland
# Host:	eel.(none)
# Root:	/home/jonas/src/mysql-5.0

--- 1.20/ndb/src/kernel/blocks/backup/Backup.cpp	2005-07-20 13:22:37 +02:00
+++ 1.21/ndb/src/kernel/blocks/backup/Backup.cpp	2005-07-22 12:17:49 +02:00
@@ -2858,8 +2858,6 @@
   /**
    * Initialize table object
    */
-  tabPtr.p->frag_mask = RNIL;
-
   tabPtr.p->schemaVersion = tmpTab.TableVersion;
   tabPtr.p->noOfAttributes = tmpTab.NoOfAttributes;
   tabPtr.p->noOfNull = 0;
@@ -2952,7 +2950,6 @@
   ndbrequire(findTable(ptr, tabPtr, tableId));
   
   ndbrequire(tabPtr.p->fragments.seize(fragCount) != false);
-  tabPtr.p->frag_mask = calculate_frag_mask(fragCount);
   for(Uint32 i = 0; i<fragCount; i++) {
     jam();
     FragmentPtr fragPtr;
@@ -3769,15 +3766,6 @@
  * Slave functionallity: Perform logging
  *
  ****************************************************************************/
-Uint32
-Backup::calculate_frag_mask(Uint32 count)
-{
-  Uint32 mask = 1;
-  while (mask < count) mask <<= 1;
-  mask -= 1;
-  return mask;
-}
-
 void
 Backup::execBACKUP_TRIG_REQ(Signal* signal)
 {
@@ -3794,14 +3782,6 @@
   jamEntry();
   c_triggerPool.getPtr(trigPtr, trigger_id);
   c_tablePool.getPtr(tabPtr, trigPtr.p->tab_ptr_i);
-  frag_id = frag_id & tabPtr.p->frag_mask;
-  /*
-  At the moment the fragment identity known by TUP is the
-  actual fragment id but with possibly an extra bit set.
-  This is due to that ACC splits the fragment. Thus fragment id 5 can
-  here be either 5 or 13. Thus masking with 2 ** n - 1 where number of
-  fragments <= 2 ** n will always provide a correct fragment id.
-  */
   tabPtr.p->fragments.getPtr(fragPtr, frag_id);
   if (fragPtr.p->node != getOwnNodeId()) {
     jam();

--- 1.8/ndb/src/kernel/blocks/backup/Backup.hpp	2005-04-22 09:09:15 +02:00
+++ 1.9/ndb/src/kernel/blocks/backup/Backup.hpp	2005-07-22 12:17:49 +02:00
@@ -195,7 +195,6 @@
     
     Uint32 tableId;
     Uint32 schemaVersion;
-    Uint32 frag_mask;
     Uint32 tableType;
     Uint32 noOfNull;
     Uint32 noOfAttributes;
@@ -525,8 +524,6 @@
   ArrayPool<Fragment> c_fragmentPool;
   ArrayPool<Node> c_nodePool;
   ArrayPool<TriggerRecord> c_triggerPool;
-
-  Uint32 calculate_frag_mask(Uint32);
 
   void checkFile(Signal*, BackupFilePtr);
   void checkScan(Signal*, BackupFilePtr);

--- 1.24/ndb/tools/restore/Restore.cpp	2005-06-08 16:55:05 +02:00
+++ 1.25/ndb/tools/restore/Restore.cpp	2005-07-22 12:17:49 +02:00
@@ -646,7 +646,7 @@
   }
 
   info << "_____________________________________________________" << endl
-       << "Restoring data in table: " << m_currentTable->getTableName() 
+       << "Processing data in table: " << m_currentTable->getTableName() 
        << "(" << Header.TableId << ") fragment " 
        << Header.FragmentNo << endl;
   

--- 1.29/ndb/tools/restore/restore_main.cpp	2005-02-21 23:15:24 +01:00
+++ 1.30/ndb/tools/restore/restore_main.cpp	2005-07-22 12:17:49 +02:00
@@ -317,7 +317,7 @@
   
   if (ga_restore || ga_print) 
   {
-    if (ga_restore) 
+    if(_restore_data || _print_data)
     {
       RestoreDataIterator dataIter(metaData, &free_data_callback);
       
@@ -364,7 +364,10 @@
       
       for (i= 0; i < g_consumers.size(); i++)
 	g_consumers[i]->endOfTuples();
+    }
 
+    if(_restore_data || _print_log)
+    {
       RestoreLogIterator logIter(metaData);
       if (!logIter.readHeader())
       {
@@ -388,6 +391,10 @@
       logIter.validateFooter(); //not implemented
       for (i= 0; i < g_consumers.size(); i++)
 	g_consumers[i]->endOfLogEntrys();
+    }
+    
+    if(_restore_data)
+    {
       for(i = 0; i<metaData.getNoOfTables(); i++)
       {
 	if (checkSysTable(metaData[i]->getTableName()))

--- 1.7/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp	2005-04-23 17:35:43 +02:00
+++ 1.8/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp	2005-07-22 12:17:49 +02:00
@@ -603,7 +603,7 @@
     for everybody else.
     */
     signal->theData[0] = trigPtr->triggerId;
-    signal->theData[1] = regOperPtr->fragId;
+    signal->theData[1] = regOperPtr->fragId >> 1; // send "real" frag id
     EXECUTE_DIRECT(BACKUP, GSN_BACKUP_TRIG_REQ, signal, 2);
     ljamEntry();
     if (signal->theData[0] == 0) {

--- 1.2/ndb/tools/restore/consumer_printer.hpp	2004-11-14 11:11:05 +01:00
+++ 1.3/ndb/tools/restore/consumer_printer.hpp	2005-07-22 12:17:49 +02:00
@@ -29,6 +29,8 @@
     m_print_log = false;
     m_print_data = false;
     m_print_meta = false;
+    m_logCount = 0;
+    m_dataCount = 0;  
   }
   
   virtual bool table(const TableS &);
Thread
bk commit into 5.0 tree (joreland:1.1875) BUG#11675jonas.oreland22 Jul