List:Commits« Previous MessageNext Message »
From:lzhou Date:September 14 2007 2:18pm
Subject:bk commit into 5.1 tree (lzhou:1.2552) BUG#28647
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of root. When root 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-14 22:18:20+08:00, lzhou@stripped +3 -0
  BUG#28647 Stop backup if disk full

  storage/ndb/src/kernel/blocks/backup/Backup.cpp@stripped, 2007-09-14 22:18:15+08:00, lzhou@stripped +57 -2
    Close files when disk full

  storage/ndb/src/ndbapi/ndberror.c@stripped, 2007-09-14 22:18:15+08:00, lzhou@stripped +2 -0
    Add error messages for backup failure

  storage/ndb/test/src/NdbBackup.cpp@stripped, 2007-09-14 22:18:15+08:00, lzhou@stripped +2 -1
    Add test case for disk full

diff -Nrup a/storage/ndb/src/kernel/blocks/backup/Backup.cpp b/storage/ndb/src/kernel/blocks/backup/Backup.cpp
--- a/storage/ndb/src/kernel/blocks/backup/Backup.cpp	2007-06-12 16:38:05 +08:00
+++ b/storage/ndb/src/kernel/blocks/backup/Backup.cpp	2007-09-14 22:18:15 +08:00
@@ -967,6 +967,7 @@ Backup::checkNodeFail(Signal* signal,
       ref->backupPtr = ptr.i;
       ref->backupId = ptr.p->backupId;
       ref->errorCode = AbortBackupOrd::BackupFailureDueToNodeFail;
+      ref->nodeId = getOwnNodeId();
       gsn= GSN_STOP_BACKUP_REF;
       len= StopBackupRef::SignalLength;
       pos= &ref->nodeId - signal->getDataPtr();
@@ -2080,6 +2081,15 @@ Backup::sendDropTrig(Signal* signal, Bac
     /**
      * Insert footers
      */
+    //if backup error, we needn't insert footers
+    if(ptr.p->checkError())
+    {
+      jam();
+      closeFiles(signal, ptr);
+      ptr.p->errorCode = 0;
+      return;
+    }
+
     {
       BackupFilePtr filePtr LINT_SET_PTR;
       ptr.p->files.getPtr(filePtr, ptr.p->logFilePtr);
@@ -4186,6 +4196,37 @@ Backup::checkFile(Signal* signal, Backup
 #if 0
   ndbout << "Ptr to data = " << hex << tmp << endl;
 #endif
+  BackupRecordPtr ptr LINT_SET_PTR;
+  c_backupPool.getPtr(ptr, filePtr.p->backupPtr);
+
+  if (ERROR_INSERTED(10036))
+  {
+    jam();
+    filePtr.p->m_flags &= ~(Uint32)BackupFile::BF_FILE_THREAD;
+    filePtr.p->errorCode = 2810;
+    ptr.p->setErrorCode(2810);
+
+    if(ptr.p->m_gsn == GSN_STOP_BACKUP_REQ)
+    {
+      jam();
+      closeFile(signal, ptr, filePtr);
+    }
+    return;
+  }
+
+  if(filePtr.p->errorCode != 0)
+  {
+    jam();
+    ptr.p->setErrorCode(filePtr.p->errorCode);
+
+    if(ptr.p->m_gsn == GSN_STOP_BACKUP_REQ)
+    {
+      jam();
+      closeFile(signal, ptr, filePtr);
+    }
+    return;
+  }
+
   if (!ready_to_write(ready, sz, eof, filePtr.p))
   {
     jam();
@@ -4217,8 +4258,6 @@ Backup::checkFile(Signal* signal, Backup
   ndbrequire(flags & BackupFile::BF_OPEN);
   ndbrequire(flags & BackupFile::BF_FILE_THREAD);
   
-  BackupRecordPtr ptr LINT_SET_PTR;
-  c_backupPool.getPtr(ptr, filePtr.p->backupPtr);
   closeFile(signal, ptr, filePtr);
 }
 
@@ -4580,6 +4619,22 @@ Backup::closeFilesDone(Signal* signal, B
   }
   
   jam();
+
+  //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;
+    ref->nodeId = getOwnNodeId();
+    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;
diff -Nrup a/storage/ndb/src/ndbapi/ndberror.c b/storage/ndb/src/ndbapi/ndberror.c
--- a/storage/ndb/src/ndbapi/ndberror.c	2007-09-07 17:15:04 +08:00
+++ b/storage/ndb/src/ndbapi/ndberror.c	2007-09-14 22:18:15 +08:00
@@ -624,6 +624,8 @@ ErrorBundle ErrorCodes[] = {
   { 4273, DMEC, IE, "No blob table in dict cache" },
   { 4274, DMEC, IE, "Corrupted main table PK in blob operation" },
   { 4275, DMEC, AE, "The blob method is incompatible with operation type or lock mode" },
+  { 2810, DMEC, TR, "No space left on the device" },
+  { 2815, DMEC, TR, "Error in reading files, please check file system" },
 
   { NO_CONTACT_WITH_PROCESS, DMEC, AE,
     "No contact with the process (dead ?)."},
diff -Nrup a/storage/ndb/test/src/NdbBackup.cpp b/storage/ndb/test/src/NdbBackup.cpp
--- a/storage/ndb/test/src/NdbBackup.cpp	2006-12-24 03:20:31 +08:00
+++ b/storage/ndb/test/src/NdbBackup.cpp	2007-09-14 22:18:15 +08:00
@@ -350,7 +350,8 @@ FailS_codes[] = {
   10025,
   10027,
   10033,
-  10035
+  10035,
+  10036
 };
 
 int
Thread
bk commit into 5.1 tree (lzhou:1.2552) BUG#28647lzhou14 Sep