Commit 6011ad78 authored by jonas@perch.ndb.mysql.com's avatar jonas@perch.ndb.mysql.com

Merge perch.ndb.mysql.com:/home/jonas/src/51-work

into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
parents e4c3a581 8fb56fbc
......@@ -223,29 +223,25 @@ Backup::execCONTINUEB(Signal* signal)
}
case BackupContinueB::BACKUP_FRAGMENT_INFO:
{
jam();
const Uint32 ptr_I = Tdata1;
Uint32 tabPtr_I = Tdata2;
Uint32 fragPtr_I = signal->theData[3];
BackupRecordPtr ptr;
c_backupPool.getPtr(ptr, ptr_I);
if (tabPtr_I == RNIL)
{
closeFiles(signal, ptr);
return;
}
jam();
TablePtr tabPtr;
ptr.p->tables.getPtr(tabPtr, tabPtr_I);
jam();
if(tabPtr.p->fragments.getSize())
if (fragPtr_I != tabPtr.p->fragments.getSize())
{
jam();
FragmentPtr fragPtr;
tabPtr.p->fragments.getPtr(fragPtr, fragPtr_I);
BackupFilePtr filePtr;
ptr.p->files.getPtr(filePtr, ptr.p->ctlFilePtr);
const Uint32 sz = sizeof(BackupFormat::CtlFile::FragmentInfo) >> 2;
Uint32 * dst;
if (!filePtr.p->operation.dataBuffer.getWritePtr(&dst, sz))
......@@ -280,10 +276,12 @@ Backup::execCONTINUEB(Signal* signal)
ptr.p->tables.next(tabPtr);
if ((tabPtr_I = tabPtr.i) == RNIL)
{
jam();
closeFiles(signal, ptr);
return;
}
}
signal->theData[0] = BackupContinueB::BACKUP_FRAGMENT_INFO;
signal->theData[1] = ptr_I;
signal->theData[2] = tabPtr_I;
......@@ -2048,20 +2046,21 @@ Backup::sendDropTrig(Signal* signal, BackupRecordPtr ptr)
{
TablePtr tabPtr;
ptr.p->tables.first(tabPtr);
if(tabPtr.i == RNIL)
if (ptr.p->tables.first(tabPtr))
{
closeFiles(signal, ptr);
return;
}
jam();
signal->theData[0] = BackupContinueB::BACKUP_FRAGMENT_INFO;
signal->theData[1] = ptr.i;
signal->theData[2] = tabPtr.i;
signal->theData[3] = 0;
sendSignal(BACKUP_REF, GSN_CONTINUEB, signal, 4, JBB);
}
else
{
jam();
closeFiles(signal, ptr);
}
}
}
}
}
......@@ -2379,19 +2378,10 @@ Backup::defineBackupRef(Signal* signal, BackupRecordPtr ptr, Uint32 errCode)
{
jam();
ndbrequire(! (filePtr.p->m_flags & BackupFile::BF_FILE_THREAD));
ndbrequire(! (filePtr.p->m_flags & BackupFile::BF_CLOSING));
filePtr.p->m_flags &= ~(Uint32)BackupFile::BF_LCP_META;
if (filePtr.p->m_flags & BackupFile::BF_OPEN)
{
filePtr.p->m_flags |= BackupFile::BF_CLOSING;
FsCloseReq * req = (FsCloseReq *)signal->getDataPtrSend();
req->filePointer = filePtr.p->filePointer;
req->userPointer = filePtr.i;
req->userReference = reference();
req->fileFlag = 0;
FsCloseReq::setRemoveFileFlag(req->fileFlag, 1);
sendSignal(NDBFS_REF, GSN_FSCLOSEREQ, signal,
FsCloseReq::SignalLength, JBA);
closeFile(signal, ptr, filePtr);
return;
}
}
......@@ -4097,29 +4087,10 @@ Backup::checkFile(Signal* signal, BackupFilePtr filePtr)
ndbrequire(flags & BackupFile::BF_OPEN);
ndbrequire(flags & BackupFile::BF_FILE_THREAD);
ndbrequire(! (flags & BackupFile::BF_CLOSING));
filePtr.p->m_flags |= BackupFile::BF_CLOSING;
FsCloseReq * req = (FsCloseReq *)signal->getDataPtrSend();
req->filePointer = filePtr.p->filePointer;
req->userPointer = filePtr.i;
req->userReference = reference();
req->fileFlag = 0;
BackupRecordPtr ptr;
c_backupPool.getPtr(ptr, filePtr.p->backupPtr);
if (ptr.p->errorCode)
{
FsCloseReq::setRemoveFileFlag(req->fileFlag, 1);
}
#ifdef DEBUG_ABORT
ndbout_c("***** a FSCLOSEREQ filePtr.i = %u run=%d cl=%d", filePtr.i,
running, closing);
#endif
sendSignal(NDBFS_REF, GSN_FSCLOSEREQ, signal, FsCloseReq::SignalLength, JBA);
closeFile(signal, ptr, filePtr);
}
......@@ -4384,7 +4355,7 @@ Backup::closeFiles(Signal* sig, BackupRecordPtr ptr)
else
{
jam();
checkFile(sig, filePtr); // make sure we write everything before closing
closeFile(sig, ptr, filePtr);
}
}
......@@ -4394,6 +4365,33 @@ Backup::closeFiles(Signal* sig, BackupRecordPtr ptr)
}//if
}
void
Backup::closeFile(Signal* signal, BackupRecordPtr ptr, BackupFilePtr filePtr)
{
ndbrequire(filePtr.p->m_flags & BackupFile::BF_OPEN);
ndbrequire(! (filePtr.p->m_flags & BackupFile::BF_OPENING));
ndbrequire(! (filePtr.p->m_flags & BackupFile::BF_CLOSING));
filePtr.p->m_flags |= BackupFile::BF_CLOSING;
FsCloseReq * req = (FsCloseReq *)signal->getDataPtrSend();
req->filePointer = filePtr.p->filePointer;
req->userPointer = filePtr.i;
req->userReference = reference();
req->fileFlag = 0;
if (ptr.p->errorCode)
{
FsCloseReq::setRemoveFileFlag(req->fileFlag, 1);
}
#ifdef DEBUG_ABORT
ndbout_c("***** a FSCLOSEREQ filePtr.i = %u flags: %x",
filePtr.i, filePtr.p->m_flags);
#endif
sendSignal(NDBFS_REF, GSN_FSCLOSEREQ, signal, FsCloseReq::SignalLength, JBA);
}
void
Backup::execFSCLOSEREF(Signal* signal)
{
......
......@@ -582,6 +582,7 @@ public:
void openFiles(Signal* signal, BackupRecordPtr ptr);
void openFilesReply(Signal*, BackupRecordPtr ptr, BackupFilePtr);
void closeFiles(Signal*, BackupRecordPtr ptr);
void closeFile(Signal*, BackupRecordPtr, BackupFilePtr);
void closeFilesDone(Signal*, BackupRecordPtr ptr);
void sendDefineBackupReq(Signal *signal, BackupRecordPtr ptr);
......
......@@ -14706,6 +14706,8 @@ void Dblqh::execSr(Signal* signal)
LogFileRecordPtr nextLogFilePtr;
LogPageRecordPtr tmpLogPagePtr;
Uint32 logWord;
Uint32 line;
const char * crash_msg = 0;
jamEntry();
logPartPtr.i = signal->theData[0];
......@@ -14916,8 +14918,14 @@ void Dblqh::execSr(Signal* signal)
/* PLACE THAN IN THE FIRST PAGE OF A NEW FILE IN THE FIRST POSITION AFTER THE*/
/* HEADER. */
/*---------------------------------------------------------------------------*/
ndbrequire(logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX] ==
(ZPAGE_HEADER_SIZE + ZPOS_NO_FD));
if (unlikely(logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX] !=
(ZPAGE_HEADER_SIZE + ZPOS_NO_FD)))
{
line = __LINE__;
logWord = logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX];
crash_msg = "ZFD_TYPE at incorrect position!";
goto crash;
}
{
Uint32 noFdDescriptors =
logPagePtr.p->logPageWord[ZPAGE_HEADER_SIZE + ZPOS_NO_FD];
......@@ -14954,19 +14962,10 @@ void Dblqh::execSr(Signal* signal)
/*---------------------------------------------------------------------------*/
/* SEND A SIGNAL TO THE SIGNAL LOG AND THEN CRASH THE SYSTEM. */
/*---------------------------------------------------------------------------*/
signal->theData[0] = RNIL;
signal->theData[1] = logPartPtr.i;
Uint32 tmp = logFilePtr.p->fileName[3];
tmp = (tmp >> 8) & 0xff;// To get the Directory, DXX.
signal->theData[2] = tmp;
signal->theData[3] = logFilePtr.p->fileNo;
signal->theData[4] = logFilePtr.p->currentFilepage;
signal->theData[5] = logFilePtr.p->currentMbyte;
signal->theData[6] = logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX];
signal->theData[7] = ~0;
signal->theData[8] = __LINE__;
sendSignal(cownref, GSN_DEBUG_SIG, signal, 9, JBA);
return;
line = __LINE__;
logWord = ZNEXT_MBYTE_TYPE;
crash_msg = "end of log wo/ having found last GCI";
goto crash;
}//if
}//if
/*---------------------------------------------------------------------------*/
......@@ -15021,6 +15020,19 @@ void Dblqh::execSr(Signal* signal)
/*---------------------------------------------------------------------------*/
/* SEND A SIGNAL TO THE SIGNAL LOG AND THEN CRASH THE SYSTEM. */
/*---------------------------------------------------------------------------*/
line = __LINE__;
crash_msg = "Invalid logword";
goto crash;
break;
}//switch
/*---------------------------------------------------------------------------*/
// We continue to execute log records until we find a proper one to execute or
// that we reach a new page.
/*---------------------------------------------------------------------------*/
} while (1);
return;
crash:
signal->theData[0] = RNIL;
signal->theData[1] = logPartPtr.i;
Uint32 tmp = logFilePtr.p->fileName[3];
......@@ -15031,16 +15043,22 @@ void Dblqh::execSr(Signal* signal)
signal->theData[5] = logFilePtr.p->currentFilepage;
signal->theData[6] = logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX];
signal->theData[7] = logWord;
signal->theData[8] = __LINE__;
sendSignal(cownref, GSN_DEBUG_SIG, signal, 9, JBA);
return;
break;
}//switch
/*---------------------------------------------------------------------------*/
// We continue to execute log records until we find a proper one to execute or
// that we reach a new page.
/*---------------------------------------------------------------------------*/
} while (1);
signal->theData[8] = line;
char buf[255];
BaseString::snprintf(buf, sizeof(buf),
"Error while reading REDO log. from %d\n"
"D=%d, F=%d Mb=%d FP=%d W1=%d W2=%d : %s",
signal->theData[8],
signal->theData[2],
signal->theData[3],
signal->theData[4],
signal->theData[5],
signal->theData[6],
signal->theData[7],
crash_msg ? crash_msg : "");
progError(__LINE__, NDBD_EXIT_SR_REDOLOG, buf);
}//Dblqh::execSr()
/*---------------------------------------------------------------------------*/
......@@ -15056,8 +15074,8 @@ void Dblqh::execDEBUG_SIG(Signal* signal)
UintR tdebug;
jamEntry();
logPagePtr.i = signal->theData[0];
tdebug = logPagePtr.p->logPageWord[0];
//logPagePtr.i = signal->theData[0];
//tdebug = logPagePtr.p->logPageWord[0];
char buf[100];
BaseString::snprintf(buf, 100,
......
......@@ -124,6 +124,7 @@ int runBankSum(NDBT_Context* ctx, NDBT_Step* step){
result = NDBT_FAILED; \
continue; }
static
int
restart_cluster(NDBT_Context* ctx, NDBT_Step* step, NdbRestarter& restarter)
{
......@@ -177,6 +178,7 @@ restart_cluster(NDBT_Context* ctx, NDBT_Step* step, NdbRestarter& restarter)
return result;
}
static
ndb_mgm_node_state*
select_node_to_stop(Vector<ndb_mgm_node_state>& nodes)
{
......@@ -215,6 +217,7 @@ select_node_to_stop(Vector<ndb_mgm_node_state>& nodes)
}
}
static
ndb_mgm_node_state*
select_node_to_start(Vector<ndb_mgm_node_state>& nodes)
{
......@@ -294,23 +297,27 @@ loop:
goto loop;
if (action == AA_RestartNode)
{
g_err << "Restarting " << node->node_id << endl;
if (restarter.restartOneDbNode(node->node_id, false, false, true))
return NDBT_FAILED;
}
if (action == AA_StopNode)
{
else
g_err << "Stopping " << node->node_id << endl;
if (restarter.restartOneDbNode(node->node_id, false, true, true))
return NDBT_FAILED;
if (restarter.waitNodesNoStart(&node->node_id, 1))
return NDBT_FAILED;
node->node_status = NDB_MGM_NODE_STATUS_NOT_STARTED;
}
if (action == AA_StopNode)
break;
else
goto start;
}
case AA_StartNode:
if ((node = select_node_to_start(nodes)) == 0)
goto loop;
start:
g_err << "Starting " << node->node_id << endl;
if (restarter.startNodes(&node->node_id, 1))
return NDBT_FAILED;
......@@ -322,6 +329,25 @@ loop:
}
}
Vector<int> not_started;
{
ndb_mgm_node_state* node = 0;
while((node = select_node_to_start(nodes)))
{
not_started.push_back(node->node_id);
node->node_status = NDB_MGM_NODE_STATUS_STARTED;
}
}
if (not_started.size())
{
g_err << "Starting stopped nodes " << endl;
if (restarter.startNodes(not_started.getBase(), not_started.size()))
return NDBT_FAILED;
if (restarter.waitClusterStarted())
return NDBT_FAILED;
}
ctx->stopTest();
return NDBT_OK;
}
......
......@@ -985,7 +985,7 @@ NDBT_Tables::createTable(Ndb* pNdb, const char* _name, bool _temp,
loop:
r = pNdb->getDictionary()->createTable(tmpTab);
if(r == -1){
if(pNdb->getDictionary()->getNdbError().code == 723)
if(pNdb->getDictionary()->getNdbError().code == 755)
{
if (create_default_tablespace(pNdb) == 0)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment