summaryrefslogtreecommitdiff
path: root/storage/ndb/src/kernel/blocks/backup
diff options
context:
space:
mode:
authorunknown <stewart@willster.(none)>2006-10-18 18:19:16 +1000
committerunknown <stewart@willster.(none)>2006-10-18 18:19:16 +1000
commit7968c44c0edb8c0d098f9ba81455ee29b855e3cc (patch)
treebf9401d2fa3d6c4201b4bc2e2c91e8e5bca8d1ee /storage/ndb/src/kernel/blocks/backup
parent675557c844ed2335818e355459ec9217aafcb9d5 (diff)
downloadmariadb-git-7968c44c0edb8c0d098f9ba81455ee29b855e3cc.tar.gz
Bug #19148 Backup causes cluster down if _really_ early abort happens
Early abort, failing to allocate buffers, would go down the abort track and end up trying to sendDropTriggers (as the standard stop backup does). However, it is possible to not have any tables yet defined in the backup (due to allocating buffers is before this). Simple check in sendDropTrig (and continue to next step). Files may be open, so we continue to close them. Also updated ERROR_Codes (and added one to test this bug). storage/ndb/src/kernel/blocks/ERROR_codes.txt: update BACKUP error insert codes to reflect current reality. storage/ndb/src/kernel/blocks/backup/Backup.cpp: Allow for early abort when no tables have been included in backup. Allow for abort when file records have been seized but not yet allocated to specific uses (is the case when buffer allocation fails) storage/ndb/src/kernel/blocks/backup/Backup.hpp: initialize BackupRecord file Ptrs storage/ndb/test/src/NdbBackup.cpp: Add extra failure codes for buffer allocation failure in backup
Diffstat (limited to 'storage/ndb/src/kernel/blocks/backup')
-rw-r--r--storage/ndb/src/kernel/blocks/backup/Backup.cpp42
-rw-r--r--storage/ndb/src/kernel/blocks/backup/Backup.hpp1
2 files changed, 33 insertions, 10 deletions
diff --git a/storage/ndb/src/kernel/blocks/backup/Backup.cpp b/storage/ndb/src/kernel/blocks/backup/Backup.cpp
index 23a2f908c20..c668ef45cf3 100644
--- a/storage/ndb/src/kernel/blocks/backup/Backup.cpp
+++ b/storage/ndb/src/kernel/blocks/backup/Backup.cpp
@@ -2004,7 +2004,15 @@ Backup::sendDropTrig(Signal* signal, BackupRecordPtr ptr)
if (ptr.p->slaveData.dropTrig.tableId == RNIL) {
jam();
- ptr.p->tables.first(tabPtr);
+ if(ptr.p->tables.count())
+ ptr.p->tables.first(tabPtr);
+ else
+ {
+ // Early abort, go to close files
+ jam();
+ closeFiles(signal, ptr);
+ return;
+ }
} else {
jam();
ndbrequire(findTable(ptr, tabPtr, ptr.p->slaveData.dropTrig.tableId));
@@ -2105,8 +2113,11 @@ Backup::execDROP_TRIG_REF(Signal* signal)
BackupRecordPtr ptr;
c_backupPool.getPtr(ptr, ptrI);
- ndbout << "ERROR DROPPING TRIGGER: " << ref->getConf()->getTriggerId();
- ndbout << " Err: " << (Uint32)ref->getErrorCode() << endl << endl;
+ if(ref->getConf()->getTriggerId() != -1)
+ {
+ ndbout << "ERROR DROPPING TRIGGER: " << ref->getConf()->getTriggerId();
+ ndbout << " Err: " << (Uint32)ref->getErrorCode() << endl << endl;
+ }
dropTrigReply(signal, ptr);
}
@@ -2538,8 +2549,9 @@ Backup::execDEFINE_BACKUP_REQ(Signal* signal)
files[i].p->filePointer = RNIL;
files[i].p->m_flags = 0;
files[i].p->errorCode = 0;
-
- if(files[i].p->pages.seize(noOfPages[i]) == false) {
+
+ if(ERROR_INSERTED(10035) || files[i].p->pages.seize(noOfPages[i]) == false)
+ {
jam();
DEBUG_OUT("Failed to seize " << noOfPages[i] << " pages");
defineBackupRef(signal, ptr, DefineBackupRef::FailedToAllocateBuffers);
@@ -4451,14 +4463,24 @@ Backup::closeFilesDone(Signal* signal, BackupRecordPtr ptr)
}
jam();
- BackupFilePtr filePtr;
- ptr.p->files.getPtr(filePtr, ptr.p->logFilePtr);
-
+
StopBackupConf* conf = (StopBackupConf*)signal->getDataPtrSend();
conf->backupId = ptr.p->backupId;
conf->backupPtr = ptr.i;
- conf->noOfLogBytes = filePtr.p->operation.noOfBytes;
- conf->noOfLogRecords = filePtr.p->operation.noOfRecords;
+
+ BackupFilePtr filePtr;
+ if(ptr.p->logFilePtr != RNIL)
+ {
+ ptr.p->files.getPtr(filePtr, ptr.p->logFilePtr);
+ conf->noOfLogBytes= filePtr.p->operation.noOfBytes;
+ conf->noOfLogRecords= filePtr.p->operation.noOfRecords;
+ }
+ else
+ {
+ conf->noOfLogBytes= 0;
+ conf->noOfLogRecords= 0;
+ }
+
sendSignal(ptr.p->masterRef, GSN_STOP_BACKUP_CONF, signal,
StopBackupConf::SignalLength, JBB);
diff --git a/storage/ndb/src/kernel/blocks/backup/Backup.hpp b/storage/ndb/src/kernel/blocks/backup/Backup.hpp
index a5929efa5c8..16dafd665c1 100644
--- a/storage/ndb/src/kernel/blocks/backup/Backup.hpp
+++ b/storage/ndb/src/kernel/blocks/backup/Backup.hpp
@@ -427,6 +427,7 @@ public:
: slaveState(b, validSlaveTransitions, validSlaveTransitionsCount,1)
, tables(tp), triggers(trp), files(bp)
, masterData(b), backup(b)
+ , ctlFilePtr(RNIL), logFilePtr(RNIL), dataFilePtr(RNIL)
{
}