List:Commits« Previous MessageNext Message »
From:Stewart Smith Date:August 15 2006 5:09am
Subject:bk commit into 5.0 tree (stewart:1.2246) BUG#20823
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of stewart. When stewart 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-08-15 11:09:38+08:00, stewart@willster.(none) +1 -0
  BUG#20823 testBackup FailMaster failing
    
  few cases not handled properly (NF occurs).

  ndb/src/kernel/blocks/backup/Backup.cpp@stripped, 2006-08-15 11:09:35+08:00,
stewart@willster.(none) +41 -23
    Don't write fragment info if we haven't retreived any fragment info yet
    (FailMaster test 2)
        
    Go directly onto closing files if the tabPtr is RNIL (as we're in recovery)

# 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:	stewart
# Host:	willster.(none)
# Root:	/home/stewart/Documents/MySQL/5.0/ndb

--- 1.34/ndb/src/kernel/blocks/backup/Backup.cpp	2006-08-15 11:09:43 +08:00
+++ 1.35/ndb/src/kernel/blocks/backup/Backup.cpp	2006-08-15 11:09:43 +08:00
@@ -274,36 +274,48 @@
 
     BackupRecordPtr ptr;
     c_backupPool.getPtr(ptr, ptr_I);
-    TablePtr tabPtr;
-    ptr.p->tables.getPtr(tabPtr, tabPtr_I);
-    FragmentPtr fragPtr;
-    tabPtr.p->fragments.getPtr(fragPtr, fragPtr_I);
 
-    BackupFilePtr filePtr;
-    ptr.p->files.getPtr(filePtr, ptr.p->ctlFilePtr);
-
-    const Uint32 sz = sizeof(BackupFormat::CtlFile::FragmentInfo) >> 2;
-    Uint32 * dst;
-    if (!filePtr.p->operation.dataBuffer.getWritePtr(&dst, sz))
+    if (tabPtr_I == RNIL)
     {
-      sendSignalWithDelay(BACKUP_REF, GSN_CONTINUEB, signal, 100, 4);
+      closeFiles(signal, ptr);
       return;
     }
+    jam();
+    TablePtr tabPtr;
+    ptr.p->tables.getPtr(tabPtr, tabPtr_I);
+    jam();
+    if(tabPtr.p->fragments.getSize())
+    {
+      FragmentPtr fragPtr;
+      tabPtr.p->fragments.getPtr(fragPtr, fragPtr_I);
 
-    BackupFormat::CtlFile::FragmentInfo * fragInfo = 
-      (BackupFormat::CtlFile::FragmentInfo*)dst;
-    fragInfo->SectionType = htonl(BackupFormat::FRAGMENT_INFO);
-    fragInfo->SectionLength = htonl(sz);
-    fragInfo->TableId = htonl(fragPtr.p->tableId);
-    fragInfo->FragmentNo = htonl(fragPtr_I);
-    fragInfo->NoOfRecordsLow = htonl(fragPtr.p->noOfRecords & 0xFFFFFFFF);
-    fragInfo->NoOfRecordsHigh = htonl(fragPtr.p->noOfRecords >> 32);
-    fragInfo->FilePosLow = htonl(0 & 0xFFFFFFFF);
-    fragInfo->FilePosHigh = htonl(0 >> 32);
+      BackupFilePtr filePtr;
+      ptr.p->files.getPtr(filePtr, ptr.p->ctlFilePtr);
 
-    filePtr.p->operation.dataBuffer.updateWritePtr(sz);
+      const Uint32 sz = sizeof(BackupFormat::CtlFile::FragmentInfo) >> 2;
+      Uint32 * dst;
+      if (!filePtr.p->operation.dataBuffer.getWritePtr(&dst, sz))
+      {
+        sendSignalWithDelay(BACKUP_REF, GSN_CONTINUEB, signal, 100, 4);
+        return;
+      }
+
+      BackupFormat::CtlFile::FragmentInfo * fragInfo = 
+        (BackupFormat::CtlFile::FragmentInfo*)dst;
+      fragInfo->SectionType = htonl(BackupFormat::FRAGMENT_INFO);
+      fragInfo->SectionLength = htonl(sz);
+      fragInfo->TableId = htonl(fragPtr.p->tableId);
+      fragInfo->FragmentNo = htonl(fragPtr_I);
+      fragInfo->NoOfRecordsLow = htonl(fragPtr.p->noOfRecords & 0xFFFFFFFF);
+      fragInfo->NoOfRecordsHigh = htonl(fragPtr.p->noOfRecords >> 32);
+      fragInfo->FilePosLow = htonl(0 & 0xFFFFFFFF);
+      fragInfo->FilePosHigh = htonl(0 >> 32);
+
+      filePtr.p->operation.dataBuffer.updateWritePtr(sz);
+
+      fragPtr_I++;
+    }
 
-    fragPtr_I++;
     if (fragPtr_I == tabPtr.p->fragments.getSize())
     {
       signal->theData[0] = tabPtr.p->tableId;
@@ -4242,6 +4254,12 @@
     {
       TablePtr tabPtr;
       ptr.p->tables.first(tabPtr);
+
+      if (tabPtr.i == RNIL)
+      {
+        closeFiles(signal, ptr);
+        return;
+      }
 
       signal->theData[0] = BackupContinueB::BACKUP_FRAGMENT_INFO;
       signal->theData[1] = ptr.i;
Thread
bk commit into 5.0 tree (stewart:1.2246) BUG#20823Stewart Smith15 Aug