List:Commits« Previous MessageNext Message »
From:lzhou Date:September 4 2007 4: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-09-04 14:15:45+00:00, lzhou@dev3-63.(none) +3 -0
  BUG#28647 Return backup failure message if disk full

  ndb/src/kernel/blocks/backup/Backup.cpp@stripped, 2007-09-04 14:15:40+00:00,
lzhou@dev3-63.(none) +79 -3
    Close files when disk full

  ndb/src/ndbapi/ndberror.c@stripped, 2007-09-04 14:15:40+00:00, lzhou@dev3-63.(none) +4 -1
    Add new error messages for backup failure.

  ndb/test/src/NdbBackup.cpp@stripped, 2007-09-04 14:15:40+00:00, lzhou@dev3-63.(none) +2 -1
    Add test case for disk full

# 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-09-04 14:15:59 +00:00
+++ 1.39/ndb/src/kernel/blocks/backup/Backup.cpp	2007-09-04 14:15:59 +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,6 +3931,31 @@ Backup::execFSAPPENDREF(Signal* signal)
   filePtr.p->fileRunning = 0;  
   filePtr.p->errorCode = errCode;
 
+  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);
+    }
+    return;
+  }
+
   checkFile(signal, filePtr);
 }
 
@@ -3948,6 +3973,35 @@ Backup::execFSAPPENDCONF(Signal* signal)
   BackupFilePtr filePtr LINT_SET_PTR;
   c_backupFilePool.getPtr(filePtr, filePtrI);
   
+  if (ERROR_INSERTED(10036))
+  {
+    jam();
+    BackupRecordPtr ptr LINT_SET_PTR;
+    c_backupPool.getPtr(ptr, filePtr.p->backupPtr);
+    ptr.p->errorCode = 2810;
+    
+    filePtr.p->fileRunning = 0;
+    filePtr.p->errorCode = ptr.p->errorCode;
+
+    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);
+    }
+    return;
+  }
+
   OperationRecord & op = filePtr.p->operation;
   
   op.dataBuffer.updateReadPtr(bytes >> 2);
@@ -4224,6 +4278,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
    */
@@ -4298,8 +4360,6 @@ Backup::closeFiles(Signal* sig, BackupRe
       continue;
     }//if
     
-    filePtr.p->fileClosing = 1;
-    
     if(filePtr.p->fileRunning == 1){
       jam();
 #ifdef DEBUG_ABORT
@@ -4309,6 +4369,7 @@ Backup::closeFiles(Signal* sig, BackupRe
     } else {
       jam();
       
+      filePtr.p->fileClosing = 1; 
       FsCloseReq * req = (FsCloseReq *)sig->getDataPtrSend();
       req->filePointer = filePtr.p->filePointer;
       req->userPointer = filePtr.i;
@@ -4396,6 +4457,21 @@ Backup::closeFilesDone(Signal* signal, B
   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.27/ndb/test/src/NdbBackup.cpp	2007-09-04 14:15:59 +00:00
+++ 1.28/ndb/test/src/NdbBackup.cpp	2007-09-04 14:15:59 +00:00
@@ -349,7 +349,8 @@ NdbBackup::NF(NdbRestarter& _restarter, 
 int
 FailS_codes[] = {
   10027,
-  10033
+  10033,
+  10036
 };
 
 int

--- 1.56/ndb/src/ndbapi/ndberror.c	2007-09-04 14:15:59 +00:00
+++ 1.57/ndb/src/ndbapi/ndberror.c	2007-09-04 14:15:59 +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#28647lzhou4 Sep