diff options
author | unknown <joreland@mysql.com> | 2005-04-22 09:07:25 +0200 |
---|---|---|
committer | unknown <joreland@mysql.com> | 2005-04-22 09:07:25 +0200 |
commit | d9faad9c1a41c36d03f0f49c57e9064b9334f5eb (patch) | |
tree | 55e66f1207081480bcc86f88ad90987e40263039 /ndb/src/mgmsrv | |
parent | 135c7b5a1db9bcd442de73e0c762ca0f1dec652f (diff) | |
download | mariadb-git-d9faad9c1a41c36d03f0f49c57e9064b9334f5eb.tar.gz |
bug#9924 - ndb backup abort handling
Redo abort handling according to descr. in Backup.txt
bug#9960 - ndb backup
increase wait completed timeout to 48 hours
ndb/include/kernel/signaldata/BackupImpl.hpp:
Add nodeid to reply to be able to fake reply during NF
ndb/include/kernel/signaldata/BackupSignalData.hpp:
new error codes
ndb/src/common/debugger/signaldata/BackupImpl.cpp:
fix printout
ndb/src/kernel/blocks/backup/Backup.cpp:
bug#9924 - ndb backup abort handling
Redo abort handling according to descr. in Backup.txt
ndb/src/kernel/blocks/backup/Backup.hpp:
bug#9924 - ndb backup abort handling
Redo abort handling according to descr. in Backup.txt
ndb/src/kernel/blocks/backup/Backup.txt:
bug#9924 - ndb backup abort handling
Redo abort handling according to descr. in Backup.txt
ndb/src/kernel/blocks/backup/BackupInit.cpp:
bug#9924 - ndb backup abort handling
Redo abort handling according to descr. in Backup.txt
ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp:
Init own version
ndb/src/mgmapi/mgmapi.cpp:
bug#9960 - ndb backup
increase wait completed timeout to 48 hours
ndb/src/mgmsrv/MgmtSrvr.cpp:
Handle node failures activly
(mainly for backup...)
ndb/src/mgmsrv/MgmtSrvr.hpp:
Handle node failures activly
(mainly for backup...)
ndb/src/mgmsrv/MgmtSrvrGeneralSignalHandling.cpp:
Handle node failures activly
(mainly for backup...)
ndb/src/ndbapi/ndberror.c:
new error codes
ndb/test/ndbapi/testBackup.cpp:
fix return codes
ndb/test/run-test/daily-basic-tests.txt:
Add failure test cases to autotest
ndb/test/src/NdbBackup.cpp:
fix error codes
introduce checking of backup resources after each test
Diffstat (limited to 'ndb/src/mgmsrv')
-rw-r--r-- | ndb/src/mgmsrv/MgmtSrvr.cpp | 29 | ||||
-rw-r--r-- | ndb/src/mgmsrv/MgmtSrvr.hpp | 4 | ||||
-rw-r--r-- | ndb/src/mgmsrv/MgmtSrvrGeneralSignalHandling.cpp | 6 |
3 files changed, 18 insertions, 21 deletions
diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index fb05e57e138..ceaedc9955b 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -791,7 +791,7 @@ MgmtSrvr::restartNode(int processId, bool nostart, result = sendSignal(processId, NO_WAIT, signal, true); } - if (result == -1) { + if (result == -1 && theWaitState != WAIT_NODEFAILURE) { m_stopRec.inUse = false; return SEND_OR_RECEIVE_FAILED; } @@ -1920,6 +1920,7 @@ MgmtSrvr::handleReceivedSignal(NdbApiSignal* signal) #ifdef VM_TRACE ndbout_c("I'm not master resending to %d", aNodeId); #endif + theWaitNode= aNodeId; NdbApiSignal aSignal(_ownReference); BackupReq* req = CAST_PTR(BackupReq, aSignal.getDataPtrSend()); aSignal.set(TestOrd::TraceAPI, BACKUP, GSN_BACKUP_REQ, @@ -1947,6 +1948,7 @@ MgmtSrvr::handleReceivedSignal(NdbApiSignal* signal) event.Event = BackupEvent::BackupAborted; event.Aborted.Reason = rep->reason; event.Aborted.BackupId = rep->backupId; + event.Aborted.ErrorCode = rep->reason; backupCallback(event); } break; @@ -2076,6 +2078,13 @@ MgmtSrvr::handleStatus(NodeId nodeId, bool alive, bool nfComplete) handleStopReply(nodeId, 0); DBUG_VOID_RETURN; } + + if(theWaitNode == nodeId && + theWaitState != NO_WAIT && theWaitState != WAIT_STOP) + { + theWaitState = WAIT_NODEFAILURE; + NdbCondition_Signal(theMgmtWaitForResponseCondPtr); + } } eventReport(_ownNodeId, theData); @@ -2427,7 +2436,7 @@ MgmtSrvr::startBackup(Uint32& backupId, int waitCompleted) int result; if (waitCompleted == 2) { result = sendRecSignal(nodeId, WAIT_BACKUP_COMPLETED, - signal, true, 30*60*1000 /*30 secs*/); + signal, true, 48*60*60*1000 /* 48 hours */); } else if (waitCompleted == 1) { result = sendRecSignal(nodeId, WAIT_BACKUP_STARTED, @@ -2456,22 +2465,6 @@ MgmtSrvr::startBackup(Uint32& backupId, int waitCompleted) return -1; break; } - } else { - switch(m_lastBackupEvent.Event){ - case BackupEvent::BackupCompleted: - backupId = m_lastBackupEvent.Completed.BackupId; - break; - case BackupEvent::BackupStarted: - backupId = m_lastBackupEvent.Started.BackupId; - break; - case BackupEvent::BackupFailedToStart: - return m_lastBackupEvent.FailedToStart.ErrorCode; - case BackupEvent::BackupAborted: - return m_lastBackupEvent.Aborted.ErrorCode; - default: - return -1; - break; - } } return 0; diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index a05b29b7f31..ce78983b3c3 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -611,7 +611,8 @@ private: WAIT_STOP, WAIT_BACKUP_STARTED, WAIT_BACKUP_COMPLETED, - WAIT_VERSION + WAIT_VERSION, + WAIT_NODEFAILURE }; /** @@ -695,6 +696,7 @@ private: NdbApiSignal* theSignalIdleList; // List of unused signals + Uint32 theWaitNode; WaitSignalType theWaitState; // State denoting a set of signals we accept to recieve. diff --git a/ndb/src/mgmsrv/MgmtSrvrGeneralSignalHandling.cpp b/ndb/src/mgmsrv/MgmtSrvrGeneralSignalHandling.cpp index 2126c9d358d..f93948abc75 100644 --- a/ndb/src/mgmsrv/MgmtSrvrGeneralSignalHandling.cpp +++ b/ndb/src/mgmsrv/MgmtSrvrGeneralSignalHandling.cpp @@ -108,6 +108,7 @@ MgmtSrvr::sendRecSignal(Uint16 aNodeId, return -1; } theWaitState = aWaitState; + theWaitNode = aNodeId; return receiveOptimisedResponse(waitTime); } @@ -119,11 +120,12 @@ MgmtSrvr::receiveOptimisedResponse(int waitTime) theFacade->checkForceSend(_blockNumber); NDB_TICKS maxTime = NdbTick_CurrentMillisecond() + waitTime; - while (theWaitState != NO_WAIT && waitTime > 0) { + while (theWaitState != NO_WAIT && theWaitState != WAIT_NODEFAILURE + && waitTime > 0) { NdbCondition_WaitTimeout(theMgmtWaitForResponseCondPtr, theFacade->theMutexPtr, waitTime); - if(theWaitState == NO_WAIT) + if(theWaitState == NO_WAIT || theWaitState == WAIT_NODEFAILURE) break; waitTime = (maxTime - NdbTick_CurrentMillisecond()); }//while |