List:Commits« Previous MessageNext Message »
From:lzhou Date:August 15 2007 7:15pm
Subject:bk commit into 5.0 tree (lzhou:1.2477) BUG#28647
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of zhl. When zhl 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-08-15 17:14:53+00:00, lzhou@dev3-63.(none) +2 -0
  BUG#28647 Return backup failure message if disk full

  ndb/src/kernel/blocks/backup/Backup.cpp@stripped, 2007-08-15 17:14:46+00:00,
lzhou@dev3-63.(none) +61 -15
    Close files when disk full

  ndb/src/ndbapi/ndberror.c@stripped, 2007-08-15 17:14:46+00:00, lzhou@dev3-63.(none) +4 -1
    Add new error message for backup failure.

# 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:	lzhou
# Host:	dev3-63.(none)
# Root:	/home/zhl/mysql/mysql-5.0/bug28647

--- 1.38/ndb/src/kernel/blocks/backup/Backup.cpp	2007-08-15 17:15:08 +00:00
+++ 1.39/ndb/src/kernel/blocks/backup/Backup.cpp	2007-08-15 17:15:08 +00:00
@@ -2261,7 +2261,7 @@ Backup::execSTOP_BACKUP_REF(Signal* sign
   StopBackupRef* ref = (StopBackupRef*)signal->getDataPtr();
   const Uint32 ptrI = ref->backupPtr;
   //const Uint32 backupId = ref->backupId;
-  const Uint32 nodeId = ref->nodeId;
+  const Uint32 nodeId = refToNode(signal->senderBlockRef());
   
   BackupRecordPtr ptr LINT_SET_PTR;
   c_backupPool.getPtr(ptr, ptrI);
@@ -3931,7 +3931,31 @@ Backup::execFSAPPENDREF(Signal* signal)
   filePtr.p->fileRunning = 0;  
   filePtr.p->errorCode = errCode;
 
-  checkFile(signal, filePtr);
+  if(errCode != 0)
+  {
+    BackupRecordPtr ptr LINT_SET_PTR;
+    c_backupPool.getPtr(ptr, filePtr.p->backupPtr);
+    ptr.p->setErrorCode(errCode);
+
+    if(ptr.p->m_gsn == GSN_STOP_BACKUP_REQ && !filePtr.p->fileClosing)
+    {
+      jam();
+
+      filePtr.p->fileClosing = 1;
+
+      FsCloseReq * req = (FsCloseReq *)signal->getDataPtrSend();
+      req->filePointer = filePtr.p->filePointer;
+      req->userPointer = filePtr.i;
+      req->userReference = reference();
+      req->fileFlag = 0;
+#ifdef DEBUG_ABORT
+      ndbout_c("***** a FSCLOSEREQ filePtr.i = %u", filePtr.i);
+#endif
+      sendSignal(NDBFS_REF, GSN_FSCLOSEREQ, signal, FsCloseReq::SignalLength, JBA);
+    }
+  }
+  else
+    checkFile(signal, filePtr);
 }
 
 void
@@ -4202,7 +4226,7 @@ Backup::execSTOP_BACKUP_REQ(Signal* sign
 {
   jamEntry();
   StopBackupReq * req = (StopBackupReq*)signal->getDataPtr();
-  
+ 
   CRASH_INSERTION((10020));
 
   const Uint32 ptrI = req->backupPtr;
@@ -4214,7 +4238,7 @@ Backup::execSTOP_BACKUP_REQ(Signal* sign
    * At least one GCP must have passed
    */
   ndbrequire(stopGCP > startGCP);
-  
+ 
   /**
    * Get backup record
    */
@@ -4224,6 +4248,14 @@ Backup::execSTOP_BACKUP_REQ(Signal* sign
   ptr.p->slaveState.setState(STOPPING);
   ptr.p->m_gsn = GSN_STOP_BACKUP_REQ;
 
+  if(ptr.p->checkError())
+  {
+    jam();
+    ptr.p->errorCode = 0;
+    closeFiles(signal, ptr);
+    return;
+  }
+
   /**
    * Insert footers
    */
@@ -4240,16 +4272,16 @@ Backup::execSTOP_BACKUP_REQ(Signal* sign
   {
     BackupFilePtr filePtr;
     ptr.p->files.getPtr(filePtr, ptr.p->ctlFilePtr);
-    
+ 
     const Uint32 gcpSz = sizeof(BackupFormat::CtlFile::GCPEntry) >> 2;
-    
+ 
     Uint32 * dst;
     LINT_INIT(dst);
     ndbrequire(filePtr.p->operation.dataBuffer.getWritePtr(&dst, gcpSz));
-    
+
     BackupFormat::CtlFile::GCPEntry * gcp = 
       (BackupFormat::CtlFile::GCPEntry*)dst;
-    
+
     gcp->SectionType   = htonl(BackupFormat::GCP_ENTRY);
     gcp->SectionLength = htonl(gcpSz);
     gcp->StartGCP      = htonl(startGCP);
@@ -4297,9 +4329,7 @@ Backup::closeFiles(Signal* sig, BackupRe
       jam();
       continue;
     }//if
-    
-    filePtr.p->fileClosing = 1;
-    
+
     if(filePtr.p->fileRunning == 1){
       jam();
 #ifdef DEBUG_ABORT
@@ -4308,7 +4338,8 @@ Backup::closeFiles(Signal* sig, BackupRe
       filePtr.p->operation.dataBuffer.eof();
     } else {
       jam();
-      
+
+      filePtr.p->fileClosing = 1; 
       FsCloseReq * req = (FsCloseReq *)sig->getDataPtrSend();
       req->filePointer = filePtr.p->filePointer;
       req->userPointer = filePtr.i;
@@ -4321,7 +4352,7 @@ Backup::closeFiles(Signal* sig, BackupRe
 		 FsCloseReq::SignalLength, JBA);
     }//if
   }//for
-  
+ 
   if(openCount == 0){
     jam();
     closeFilesDone(sig, ptr);
@@ -4391,11 +4422,26 @@ void
 Backup::closeFilesDone(Signal* signal, BackupRecordPtr ptr)
 {
   jam();
-  
-  jam();
+
+  jam(); 
   BackupFilePtr filePtr;
   ptr.p->files.getPtr(filePtr, ptr.p->logFilePtr);
   
+  //error when do insert footer or close file
+  if(ptr.p->checkError())
+  {
+    StopBackupRef * ref = (StopBackupRef*)signal->getDataPtr();
+    ref->backupPtr = ptr.i;
+    ref->backupId = ptr.p->backupId;
+    ref->errorCode = ptr.p->errorCode;
+    sendSignal(ptr.p->masterRef, GSN_STOP_BACKUP_REF, signal,
+             StopBackupConf::SignalLength, JBB);
+
+    ptr.p->m_gsn = GSN_STOP_BACKUP_REF;
+    ptr.p->slaveState.setState(CLEANING);
+    return;
+  }
+
   StopBackupConf* conf = (StopBackupConf*)signal->getDataPtrSend();
   conf->backupId = ptr.p->backupId;
   conf->backupPtr = ptr.i;

--- 1.56/ndb/src/ndbapi/ndberror.c	2007-08-15 17:15:08 +00:00
+++ 1.57/ndb/src/ndbapi/ndberror.c	2007-08-15 17:15:08 +00:00
@@ -525,7 +525,10 @@ ErrorBundle ErrorCodes[] = {
   { 4270, IE, "Unknown blob error" },
   { 4335, AE, "Only one autoincrement column allowed per table. Having a table without
primary key uses an autoincremented hidden key, i.e. a table without a primary key can
not have an autoincremented column" },
   { 4271, AE, "Invalid index object, not retrieved via getIndex()" },
-  { 4275, AE, "The blob method is incompatible with operation type or lock mode" }
+  { 4275, AE, "The blob method is incompatible with operation type or lock mode" },
+  
+  { 2810, TR, "No space left on the device" },
+  { 2815, TR, "Error in reading files, please check file system" }
 };
 
 static
Thread
bk commit into 5.0 tree (lzhou:1.2477) BUG#28647lzhou15 Aug