From: Date: July 23 2007 5:25pm Subject: bk commit into 5.0 tree (lzhou:1.2477) BUG#28647 List-Archive: http://lists.mysql.com/commits/31412 X-Bug: 28647 Message-Id: <200707231525.l6NFPM3O003309@dev3-63.dev.cn.tlan> 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-07-23 15:25:03+00:00, lzhou@dev3-63.(none) +3 -0 BUG#28647 Return backup failure message if disk full ndb/include/kernel/signaldata/BackupSignalData.hpp@stripped, 2007-07-23 15:24:58+00:00, lzhou@dev3-63.(none) +1 -0 Add one kind of backup failure ndb/src/kernel/blocks/backup/Backup.cpp@stripped, 2007-07-23 15:24:58+00:00, lzhou@dev3-63.(none) +51 -6 Close files when disk full ndb/src/ndbapi/ndberror.c@stripped, 2007-07-23 15:24:58+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.6/ndb/include/kernel/signaldata/BackupSignalData.hpp 2007-07-23 15:25:21 +00:00 +++ 1.7/ndb/include/kernel/signaldata/BackupSignalData.hpp 2007-07-23 15:25:21 +00:00 @@ -247,6 +247,7 @@ public: ,AbortScan = 1328 ,IncompatibleVersions = 1329 + ,NdbdExitAfsDiskFull = 2810 }; private: Uint32 requestType; --- 1.38/ndb/src/kernel/blocks/backup/Backup.cpp 2007-07-23 15:25:21 +00:00 +++ 1.39/ndb/src/kernel/blocks/backup/Backup.cpp 2007-07-23 15:25:21 +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 @@ -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 */ @@ -4298,8 +4330,6 @@ Backup::closeFiles(Signal* sig, BackupRe 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; @@ -4392,10 +4423,24 @@ Backup::closeFilesDone(Signal* signal, B { 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 = AbortBackupOrd::NdbdExitAfsDiskFull; + 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-07-23 15:25:21 +00:00 +++ 1.57/ndb/src/ndbapi/ndberror.c 2007-07-23 15:25:21 +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