mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 02:51:44 +01:00
Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-4.1
into c-4a09e253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/mysql-5.0
This commit is contained in:
commit
9802cc6e58
4 changed files with 110 additions and 74 deletions
|
@ -89,6 +89,17 @@
|
|||
#define ZCURR_PAGE_INDEX 8
|
||||
#define ZLAST_LOG_PREP_REF 10
|
||||
#define ZPOS_DIRTY 11
|
||||
/* A number of debug items written in the page header of all log files */
|
||||
#define ZPOS_LOG_TIMER 12
|
||||
#define ZPOS_PAGE_I 13
|
||||
#define ZPOS_PLACE_WRITTEN_FROM 14
|
||||
#define ZPOS_PAGE_NO 15
|
||||
#define ZPOS_PAGE_FILE_NO 16
|
||||
#define ZPOS_WORD_WRITTEN 17
|
||||
#define ZPOS_IN_WRITING 18
|
||||
#define ZPOS_PREV_PAGE_NO 19
|
||||
#define ZPOS_IN_FREE_LIST 20
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* CONSTANTS FOR THE VARIOUS REPLICA AND NODE TYPES. */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
@ -2281,7 +2292,7 @@ private:
|
|||
const LogPartRecordPtr &sltLogPartPtr);
|
||||
void checkGcpCompleted(Signal* signal, Uint32 pageWritten, Uint32 wordWritten);
|
||||
void initFsopenconf(Signal* signal);
|
||||
void initFsrwconf(Signal* signal);
|
||||
void initFsrwconf(Signal* signal, bool write);
|
||||
void initLfo(Signal* signal);
|
||||
void initLogfile(Signal* signal, Uint32 fileNo);
|
||||
void initLogpage(Signal* signal);
|
||||
|
@ -2297,7 +2308,8 @@ private:
|
|||
void writeFileDescriptor(Signal* signal);
|
||||
void writeFileHeaderOpen(Signal* signal, Uint32 type);
|
||||
void writeInitMbyte(Signal* signal);
|
||||
void writeSinglePage(Signal* signal, Uint32 pageNo, Uint32 wordWritten);
|
||||
void writeSinglePage(Signal* signal, Uint32 pageNo,
|
||||
Uint32 wordWritten, Uint32 place);
|
||||
void buildLinkedLogPageList(Signal* signal);
|
||||
void changeMbyte(Signal* signal);
|
||||
Uint32 checkIfExecLog(Signal* signal);
|
||||
|
@ -2306,7 +2318,7 @@ private:
|
|||
void checkScanTcCompleted(Signal* signal);
|
||||
void checkSrCompleted(Signal* signal);
|
||||
void closeFile(Signal* signal, LogFileRecordPtr logFilePtr);
|
||||
void completedLogPage(Signal* signal, Uint32 clpType);
|
||||
void completedLogPage(Signal* signal, Uint32 clpType, Uint32 place);
|
||||
void deleteFragrec(Uint32 fragId);
|
||||
void deleteTransidHash(Signal* signal);
|
||||
void findLogfile(Signal* signal,
|
||||
|
@ -2404,7 +2416,9 @@ private:
|
|||
void writeAbortLog(Signal* signal);
|
||||
void writeCommitLog(Signal* signal, LogPartRecordPtr regLogPartPtr);
|
||||
void writeCompletedGciLog(Signal* signal);
|
||||
void writeDirty(Signal* signal);
|
||||
void writeDbgInfoPageHeader(LogPageRecordPtr logPagePtr, Uint32 place,
|
||||
Uint32 pageNo, Uint32 wordWritten);
|
||||
void writeDirty(Signal* signal, Uint32 place);
|
||||
void writeKey(Signal* signal);
|
||||
void writeLogHeader(Signal* signal);
|
||||
void writeLogWord(Signal* signal, Uint32 data);
|
||||
|
|
|
@ -11796,42 +11796,34 @@ void Dblqh::execFSCLOSECONF(Signal* signal)
|
|||
ptrCheckGuard(logFilePtr, clogFileFileSize, logFileRecord);
|
||||
exitFromInvalidate(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileRecord::CLOSING_INIT:
|
||||
jam();
|
||||
closingInitLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileRecord::CLOSING_SR:
|
||||
jam();
|
||||
closingSrLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileRecord::CLOSING_EXEC_SR:
|
||||
jam();
|
||||
closeExecSrLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileRecord::CLOSING_EXEC_SR_COMPLETED:
|
||||
jam();
|
||||
closeExecSrCompletedLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileRecord::CLOSING_WRITE_LOG:
|
||||
jam();
|
||||
closeWriteLogLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileRecord::CLOSING_EXEC_LOG:
|
||||
jam();
|
||||
closeExecLogLab(signal);
|
||||
return;
|
||||
break;
|
||||
default:
|
||||
jam();
|
||||
systemErrorLab(signal);
|
||||
return;
|
||||
break;
|
||||
}//switch
|
||||
}//Dblqh::execFSCLOSECONF()
|
||||
|
||||
|
@ -11849,77 +11841,64 @@ void Dblqh::execFSOPENCONF(Signal* signal)
|
|||
logFilePtr.p->logFileStatus = LogFileRecord::OPEN;
|
||||
readFileInInvalidate(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileRecord::OPENING_INIT:
|
||||
jam();
|
||||
logFilePtr.p->logFileStatus = LogFileRecord::OPEN;
|
||||
openFileInitLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileRecord::OPEN_SR_FRONTPAGE:
|
||||
jam();
|
||||
logFilePtr.p->logFileStatus = LogFileRecord::OPEN;
|
||||
openSrFrontpageLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileRecord::OPEN_SR_LAST_FILE:
|
||||
jam();
|
||||
logFilePtr.p->logFileStatus = LogFileRecord::OPEN;
|
||||
openSrLastFileLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileRecord::OPEN_SR_NEXT_FILE:
|
||||
jam();
|
||||
logFilePtr.p->logFileStatus = LogFileRecord::OPEN;
|
||||
openSrNextFileLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileRecord::OPEN_EXEC_SR_START:
|
||||
jam();
|
||||
logFilePtr.p->logFileStatus = LogFileRecord::OPEN;
|
||||
openExecSrStartLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileRecord::OPEN_EXEC_SR_NEW_MBYTE:
|
||||
jam();
|
||||
logFilePtr.p->logFileStatus = LogFileRecord::OPEN;
|
||||
openExecSrNewMbyteLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileRecord::OPEN_SR_FOURTH_PHASE:
|
||||
jam();
|
||||
logFilePtr.p->logFileStatus = LogFileRecord::OPEN;
|
||||
openSrFourthPhaseLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileRecord::OPEN_SR_FOURTH_NEXT:
|
||||
jam();
|
||||
logFilePtr.p->logFileStatus = LogFileRecord::OPEN;
|
||||
openSrFourthNextLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileRecord::OPEN_SR_FOURTH_ZERO:
|
||||
jam();
|
||||
logFilePtr.p->logFileStatus = LogFileRecord::OPEN;
|
||||
openSrFourthZeroLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileRecord::OPENING_WRITE_LOG:
|
||||
jam();
|
||||
logFilePtr.p->logFileStatus = LogFileRecord::OPEN;
|
||||
return;
|
||||
break;
|
||||
case LogFileRecord::OPEN_EXEC_LOG:
|
||||
jam();
|
||||
logFilePtr.p->logFileStatus = LogFileRecord::OPEN;
|
||||
openExecLogLab(signal);
|
||||
return;
|
||||
break;
|
||||
default:
|
||||
jam();
|
||||
systemErrorLab(signal);
|
||||
return;
|
||||
break;
|
||||
}//switch
|
||||
}//Dblqh::execFSOPENCONF()
|
||||
|
||||
|
@ -11930,7 +11909,7 @@ void Dblqh::execFSOPENCONF(Signal* signal)
|
|||
void Dblqh::execFSREADCONF(Signal* signal)
|
||||
{
|
||||
jamEntry();
|
||||
initFsrwconf(signal);
|
||||
initFsrwconf(signal, false);
|
||||
|
||||
switch (lfoPtr.p->lfoState) {
|
||||
case LogFileOperationRecord::READ_SR_LAST_MBYTE:
|
||||
|
@ -11938,57 +11917,47 @@ void Dblqh::execFSREADCONF(Signal* signal)
|
|||
releaseLfo(signal);
|
||||
readSrLastMbyteLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileOperationRecord::READ_SR_FRONTPAGE:
|
||||
jam();
|
||||
releaseLfo(signal);
|
||||
readSrFrontpageLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileOperationRecord::READ_SR_LAST_FILE:
|
||||
jam();
|
||||
releaseLfo(signal);
|
||||
readSrLastFileLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileOperationRecord::READ_SR_NEXT_FILE:
|
||||
jam();
|
||||
releaseLfo(signal);
|
||||
readSrNextFileLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileOperationRecord::READ_EXEC_SR:
|
||||
jam();
|
||||
readExecSrLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileOperationRecord::READ_EXEC_LOG:
|
||||
jam();
|
||||
readExecLogLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileOperationRecord::READ_SR_INVALIDATE_PAGES:
|
||||
jam();
|
||||
invalidateLogAfterLastGCI(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileOperationRecord::READ_SR_FOURTH_PHASE:
|
||||
jam();
|
||||
releaseLfo(signal);
|
||||
readSrFourthPhaseLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileOperationRecord::READ_SR_FOURTH_ZERO:
|
||||
jam();
|
||||
releaseLfo(signal);
|
||||
readSrFourthZeroLab(signal);
|
||||
return;
|
||||
break;
|
||||
default:
|
||||
jam();
|
||||
systemErrorLab(signal);
|
||||
return;
|
||||
break;
|
||||
}//switch
|
||||
}//Dblqh::execFSREADCONF()
|
||||
|
||||
|
@ -12045,63 +12014,52 @@ void Dblqh::execFSREADREF(Signal* signal)
|
|||
void Dblqh::execFSWRITECONF(Signal* signal)
|
||||
{
|
||||
jamEntry();
|
||||
initFsrwconf(signal);
|
||||
initFsrwconf(signal, true);
|
||||
switch (lfoPtr.p->lfoState) {
|
||||
case LogFileOperationRecord::WRITE_SR_INVALIDATE_PAGES:
|
||||
jam();
|
||||
invalidateLogAfterLastGCI(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileOperationRecord::WRITE_PAGE_ZERO:
|
||||
jam();
|
||||
writePageZeroLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileOperationRecord::LAST_WRITE_IN_FILE:
|
||||
jam();
|
||||
lastWriteInFileLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileOperationRecord::INIT_WRITE_AT_END:
|
||||
jam();
|
||||
initWriteEndLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileOperationRecord::INIT_FIRST_PAGE:
|
||||
jam();
|
||||
initFirstPageLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileOperationRecord::WRITE_GCI_ZERO:
|
||||
jam();
|
||||
writeGciZeroLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileOperationRecord::WRITE_DIRTY:
|
||||
jam();
|
||||
writeDirtyLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileOperationRecord::WRITE_INIT_MBYTE:
|
||||
jam();
|
||||
writeInitMbyteLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileOperationRecord::ACTIVE_WRITE_LOG:
|
||||
jam();
|
||||
writeLogfileLab(signal);
|
||||
return;
|
||||
break;
|
||||
case LogFileOperationRecord::FIRST_PAGE_WRITE_IN_LOGFILE:
|
||||
jam();
|
||||
firstPageWriteLab(signal);
|
||||
return;
|
||||
break;
|
||||
default:
|
||||
jam();
|
||||
systemErrorLab(signal);
|
||||
return;
|
||||
break;
|
||||
}//switch
|
||||
}//Dblqh::execFSWRITECONF()
|
||||
|
||||
|
@ -12177,16 +12135,35 @@ void Dblqh::initFsopenconf(Signal* signal)
|
|||
/* ======= INITIATE WHEN RECEIVING FSREADCONF AND FSWRITECONF ======= */
|
||||
/* */
|
||||
/* ========================================================================= */
|
||||
void Dblqh::initFsrwconf(Signal* signal)
|
||||
void Dblqh::initFsrwconf(Signal* signal, bool write)
|
||||
{
|
||||
LogPageRecordPtr logP;
|
||||
Uint32 noPages, totPages;
|
||||
lfoPtr.i = signal->theData[0];
|
||||
ptrCheckGuard(lfoPtr, clfoFileSize, logFileOperationRecord);
|
||||
totPages= lfoPtr.p->noPagesRw;
|
||||
logFilePtr.i = lfoPtr.p->logFileRec;
|
||||
ptrCheckGuard(logFilePtr, clogFileFileSize, logFileRecord);
|
||||
logPartPtr.i = logFilePtr.p->logPartRec;
|
||||
ptrCheckGuard(logPartPtr, clogPartFileSize, logPartRecord);
|
||||
logPagePtr.i = lfoPtr.p->firstLfoPage;
|
||||
ptrCheckGuard(logPagePtr, clogPageFileSize, logPageRecord);
|
||||
logP= logPagePtr;
|
||||
noPages= 1;
|
||||
ndbassert(totPages > 0);
|
||||
for (;;)
|
||||
{
|
||||
logP.p->logPageWord[ZPOS_IN_WRITING]= 0;
|
||||
logP.p->logPageWord[ZPOS_IN_FREE_LIST]= 0;
|
||||
if (noPages == totPages)
|
||||
return;
|
||||
if (write)
|
||||
logP.i= logP.p->logPageWord[ZNEXT_PAGE];
|
||||
else
|
||||
logP.i= lfoPtr.p->logPageArray[noPages];
|
||||
ptrCheckGuard(logP, clogPageFileSize, logPageRecord);
|
||||
noPages++;
|
||||
}
|
||||
}//Dblqh::initFsrwconf()
|
||||
|
||||
/* ######################################################################### */
|
||||
|
@ -12274,7 +12251,7 @@ void Dblqh::timeSup(Signal* signal)
|
|||
ndbrequire(wordWritten < ZPAGE_SIZE);
|
||||
if (logFilePtr.p->noLogpagesInBuffer > 0) {
|
||||
jam();
|
||||
completedLogPage(signal, ZENFORCE_WRITE);
|
||||
completedLogPage(signal, ZENFORCE_WRITE, __LINE__);
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*SINCE WE ARE ONLY WRITING PART OF THE LAST PAGE WE HAVE TO UPDATE THE WORD */
|
||||
/*WRITTEN TO REFLECT THE REAL LAST WORD WRITTEN. WE ALSO HAVE TO MOVE THE */
|
||||
|
@ -12296,7 +12273,8 @@ void Dblqh::timeSup(Signal* signal)
|
|||
releaseLogpage(signal);
|
||||
} else {
|
||||
jam();
|
||||
writeSinglePage(signal, logFilePtr.p->currentFilepage, wordWritten);
|
||||
writeSinglePage(signal, logFilePtr.p->currentFilepage,
|
||||
wordWritten, __LINE__);
|
||||
lfoPtr.p->lfoState = LogFileOperationRecord::ACTIVE_WRITE_LOG;
|
||||
}//if
|
||||
}//if
|
||||
|
@ -12432,7 +12410,7 @@ void Dblqh::firstPageWriteLab(Signal* signal)
|
|||
logPagePtr.i = logFilePtr.p->logPageZero;
|
||||
ptrCheckGuard(logPagePtr, clogPageFileSize, logPageRecord);
|
||||
logPagePtr.p->logPageWord[ZPAGE_HEADER_SIZE + ZPOS_FILE_NO] = fileNo;
|
||||
writeSinglePage(signal, 0, ZPAGE_SIZE - 1);
|
||||
writeSinglePage(signal, 0, ZPAGE_SIZE - 1, __LINE__);
|
||||
lfoPtr.p->logFileRec = currLogFile;
|
||||
lfoPtr.p->lfoState = LogFileOperationRecord::WRITE_PAGE_ZERO;
|
||||
return;
|
||||
|
@ -12521,7 +12499,7 @@ void Dblqh::lastWriteInFileLab(Signal* signal)
|
|||
logPagePtr.i = logFilePtr.p->logPageZero;
|
||||
ptrCheckGuard(logPagePtr, clogPageFileSize, logPageRecord);
|
||||
logPagePtr.p->logPageWord[ZPAGE_HEADER_SIZE + ZPOS_FILE_NO] = fileNo;
|
||||
writeSinglePage(signal, 0, ZPAGE_SIZE - 1);
|
||||
writeSinglePage(signal, 0, ZPAGE_SIZE - 1, __LINE__);
|
||||
lfoPtr.p->logFileRec = currLogFile;
|
||||
lfoPtr.p->lfoState = LogFileOperationRecord::WRITE_PAGE_ZERO;
|
||||
return;
|
||||
|
@ -12572,7 +12550,8 @@ void Dblqh::openFileInitLab(Signal* signal)
|
|||
{
|
||||
logFilePtr.p->logFileStatus = LogFileRecord::OPEN_INIT;
|
||||
seizeLogpage(signal);
|
||||
writeSinglePage(signal, (ZNO_MBYTES_IN_FILE * ZPAGES_IN_MBYTE) - 1, ZPAGE_SIZE - 1);
|
||||
writeSinglePage(signal, (ZNO_MBYTES_IN_FILE * ZPAGES_IN_MBYTE) - 1,
|
||||
ZPAGE_SIZE - 1, __LINE__);
|
||||
lfoPtr.p->lfoState = LogFileOperationRecord::INIT_WRITE_AT_END;
|
||||
return;
|
||||
}//Dblqh::openFileInitLab()
|
||||
|
@ -12613,7 +12592,7 @@ void Dblqh::initFirstPageLab(Signal* signal)
|
|||
logPagePtr.p->logPageWord[ZPOS_LOG_LAP] = 1;
|
||||
logPagePtr.p->logPageWord[ZPAGE_HEADER_SIZE] = ZCOMPLETED_GCI_TYPE;
|
||||
logPagePtr.p->logPageWord[ZPAGE_HEADER_SIZE + 1] = 1;
|
||||
writeSinglePage(signal, 1, ZPAGE_SIZE - 1);
|
||||
writeSinglePage(signal, 1, ZPAGE_SIZE - 1, __LINE__);
|
||||
lfoPtr.p->lfoState = LogFileOperationRecord::WRITE_GCI_ZERO;
|
||||
return;
|
||||
}//if
|
||||
|
@ -12915,17 +12894,13 @@ void Dblqh::releaseLogpage(Signal* signal)
|
|||
{
|
||||
#ifdef VM_TRACE
|
||||
// Check that log page isn't already in free list
|
||||
LogPageRecordPtr TlogPagePtr;
|
||||
TlogPagePtr.i = cfirstfreeLogPage;
|
||||
while (TlogPagePtr.i != RNIL){
|
||||
ptrCheckGuard(TlogPagePtr, clogPageFileSize, logPageRecord);
|
||||
ndbrequire(TlogPagePtr.i != logPagePtr.i);
|
||||
TlogPagePtr.i = TlogPagePtr.p->logPageWord[ZNEXT_PAGE];
|
||||
}
|
||||
ndbrequire(logPagePtr.p->logPageWord[ZPOS_IN_FREE_LIST] == 0);
|
||||
#endif
|
||||
|
||||
cnoOfLogPages++;
|
||||
logPagePtr.p->logPageWord[ZNEXT_PAGE] = cfirstfreeLogPage;
|
||||
logPagePtr.p->logPageWord[ZPOS_IN_WRITING]= 0;
|
||||
logPagePtr.p->logPageWord[ZPOS_IN_FREE_LIST]= 1;
|
||||
cfirstfreeLogPage = logPagePtr.i;
|
||||
}//Dblqh::releaseLogpage()
|
||||
|
||||
|
@ -12971,6 +12946,7 @@ void Dblqh::seizeLogpage(Signal* signal)
|
|||
/* ------------------------------------------------------------------------- */
|
||||
cfirstfreeLogPage = logPagePtr.p->logPageWord[ZNEXT_PAGE];
|
||||
logPagePtr.p->logPageWord[ZNEXT_PAGE] = RNIL;
|
||||
logPagePtr.p->logPageWord[ZPOS_IN_FREE_LIST] = 0;
|
||||
}//Dblqh::seizeLogpage()
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
@ -13078,7 +13054,7 @@ WMO_LOOP:
|
|||
/* LOG FILE. THIS HAS SPECIAL SIGNIFANCE TO FIND */
|
||||
/* THE END OF THE LOG AT SYSTEM RESTART. */
|
||||
/* ------------------------------------------------------- */
|
||||
writeSinglePage(signal, 0, ZPAGE_SIZE - 1);
|
||||
writeSinglePage(signal, 0, ZPAGE_SIZE - 1, __LINE__);
|
||||
if (wmoType == ZINIT) {
|
||||
jam();
|
||||
lfoPtr.p->lfoState = LogFileOperationRecord::INIT_FIRST_PAGE;
|
||||
|
@ -13112,7 +13088,8 @@ WMO_LOOP:
|
|||
void Dblqh::writeInitMbyte(Signal* signal)
|
||||
{
|
||||
initLogpage(signal);
|
||||
writeSinglePage(signal, logFilePtr.p->currentMbyte * ZPAGES_IN_MBYTE, ZPAGE_SIZE - 1);
|
||||
writeSinglePage(signal, logFilePtr.p->currentMbyte * ZPAGES_IN_MBYTE,
|
||||
ZPAGE_SIZE - 1, __LINE__);
|
||||
lfoPtr.p->lfoState = LogFileOperationRecord::WRITE_INIT_MBYTE;
|
||||
}//Dblqh::writeInitMbyte()
|
||||
|
||||
|
@ -13122,13 +13099,15 @@ void Dblqh::writeInitMbyte(Signal* signal)
|
|||
/* INPUT: TWSP_PAGE_NO THE PAGE NUMBER WRITTEN */
|
||||
/* SUBROUTINE SHORT NAME: WSP */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
void Dblqh::writeSinglePage(Signal* signal, Uint32 pageNo, Uint32 wordWritten)
|
||||
void Dblqh::writeSinglePage(Signal* signal, Uint32 pageNo,
|
||||
Uint32 wordWritten, Uint32 place)
|
||||
{
|
||||
seizeLfo(signal);
|
||||
initLfo(signal);
|
||||
lfoPtr.p->firstLfoPage = logPagePtr.i;
|
||||
logPagePtr.p->logPageWord[ZNEXT_PAGE] = RNIL;
|
||||
|
||||
writeDbgInfoPageHeader(logPagePtr, place, pageNo, wordWritten);
|
||||
// Calculate checksum for page
|
||||
logPagePtr.p->logPageWord[ZPOS_CHECKSUM] = calcPageCheckSum(logPagePtr);
|
||||
|
||||
|
@ -14596,7 +14575,7 @@ void Dblqh::execSr(Signal* signal)
|
|||
* IN THIS WE HAVE COMPLETED EXECUTION OF THE CURRENT LOG PAGE
|
||||
* AND CAN WRITE IT TO DISK SINCE IT IS DIRTY.
|
||||
* ----------------------------------------------------------------- */
|
||||
writeDirty(signal);
|
||||
writeDirty(signal, __LINE__);
|
||||
return;
|
||||
break;
|
||||
case LogPartRecord::LES_EXEC_LOG:
|
||||
|
@ -14607,7 +14586,7 @@ void Dblqh::execSr(Signal* signal)
|
|||
* ------------------------------------------------------------------- */
|
||||
if (logFilePtr.p->currentLogpage != logPartPtr.p->prevLogpage) {
|
||||
jam();
|
||||
writeDirty(signal);
|
||||
writeDirty(signal, __LINE__);
|
||||
return;
|
||||
}//if
|
||||
break;
|
||||
|
@ -15051,7 +15030,8 @@ void Dblqh::invalidateLogAfterLastGCI(Signal* signal) {
|
|||
// This page must be invalidated.
|
||||
logPagePtr.p->logPageWord[ZPOS_LOG_LAP] = 0;
|
||||
// Contact NDBFS. Real time break.
|
||||
writeSinglePage(signal, logPartPtr.p->invalidatePageNo, ZPAGE_SIZE - 1);
|
||||
writeSinglePage(signal, logPartPtr.p->invalidatePageNo,
|
||||
ZPAGE_SIZE - 1, __LINE__);
|
||||
lfoPtr.p->lfoState = LogFileOperationRecord::WRITE_SR_INVALIDATE_PAGES;
|
||||
} else {
|
||||
// We are done with invalidating. Finish start phase 3.4.
|
||||
|
@ -16000,7 +15980,7 @@ void Dblqh::closeFile(Signal* signal, LogFileRecordPtr clfLogFilePtr)
|
|||
// logPartPtr
|
||||
// Defines lfoPtr
|
||||
/* ---------------------------------------------------------------- */
|
||||
void Dblqh::completedLogPage(Signal* signal, Uint32 clpType)
|
||||
void Dblqh::completedLogPage(Signal* signal, Uint32 clpType, Uint32 place)
|
||||
{
|
||||
LogPageRecordPtr clpLogPagePtr;
|
||||
LogPageRecordPtr wlpLogPagePtr;
|
||||
|
@ -16043,6 +16023,9 @@ void Dblqh::completedLogPage(Signal* signal, Uint32 clpType)
|
|||
twlpNoPages++;
|
||||
ptrCheckGuard(wlpLogPagePtr, clogPageFileSize, logPageRecord);
|
||||
|
||||
writeDbgInfoPageHeader(wlpLogPagePtr, place,
|
||||
logFilePtr.p->filePosition + twlpNoPages - 1,
|
||||
ZPAGE_SIZE);
|
||||
// Calculate checksum for page
|
||||
wlpLogPagePtr.p->logPageWord[ZPOS_CHECKSUM] = calcPageCheckSum(wlpLogPagePtr);
|
||||
wlpLogPagePtr.i = wlpLogPagePtr.p->logPageWord[ZNEXT_PAGE];
|
||||
|
@ -16445,6 +16428,8 @@ void Dblqh::initialiseLogPage(Signal* signal)
|
|||
refresh_watch_dog();
|
||||
ptrAss(logPagePtr, logPageRecord);
|
||||
logPagePtr.p->logPageWord[ZNEXT_PAGE] = logPagePtr.i + 1;
|
||||
logPagePtr.p->logPageWord[ZPOS_IN_FREE_LIST]= 1;
|
||||
logPagePtr.p->logPageWord[ZPOS_IN_WRITING]= 0;
|
||||
}//for
|
||||
logPagePtr.i = clogPageFileSize - 1;
|
||||
ptrAss(logPagePtr, logPageRecord);
|
||||
|
@ -18101,10 +18086,14 @@ void Dblqh::writeCompletedGciLog(Signal* signal)
|
|||
*
|
||||
* SUBROUTINE SHORT NAME: WD
|
||||
* ------------------------------------------------------------------------- */
|
||||
void Dblqh::writeDirty(Signal* signal)
|
||||
void Dblqh::writeDirty(Signal* signal, Uint32 place)
|
||||
{
|
||||
logPagePtr.p->logPageWord[ZPOS_DIRTY] = ZNOT_DIRTY;
|
||||
|
||||
ndbassert(logPartPtr.p->prevFilepage ==
|
||||
logPagePtr.p->logPageWord[ZPOS_PAGE_NO]);
|
||||
writeDbgInfoPageHeader(logPagePtr, place, logPartPtr.p->prevFilepage,
|
||||
ZPAGE_SIZE);
|
||||
// Calculate checksum for page
|
||||
logPagePtr.p->logPageWord[ZPOS_CHECKSUM] = calcPageCheckSum(logPagePtr);
|
||||
|
||||
|
@ -18138,7 +18127,7 @@ void Dblqh::writeLogWord(Signal* signal, Uint32 data)
|
|||
logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX] = logPos + 1;
|
||||
if ((logPos + 1) == ZPAGE_SIZE) {
|
||||
jam();
|
||||
completedLogPage(signal, ZNORMAL);
|
||||
completedLogPage(signal, ZNORMAL, __LINE__);
|
||||
seizeLogpage(signal);
|
||||
initLogpage(signal);
|
||||
logFilePtr.p->currentLogpage = logPagePtr.i;
|
||||
|
@ -18196,7 +18185,7 @@ void Dblqh::writeNextLog(Signal* signal)
|
|||
/* -------------------------------------------------- */
|
||||
/* WE HAVE TO CHANGE LOG FILE */
|
||||
/* -------------------------------------------------- */
|
||||
completedLogPage(signal, ZLAST_WRITE_IN_FILE);
|
||||
completedLogPage(signal, ZLAST_WRITE_IN_FILE, __LINE__);
|
||||
if (wnlNextLogFilePtr.p->fileNo == 0) {
|
||||
jam();
|
||||
/* -------------------------------------------------- */
|
||||
|
@ -18215,7 +18204,7 @@ void Dblqh::writeNextLog(Signal* signal)
|
|||
/* INCREMENT THE CURRENT MBYTE */
|
||||
/* SET PAGE INDEX TO PAGE HEADER SIZE */
|
||||
/* -------------------------------------------------- */
|
||||
completedLogPage(signal, ZENFORCE_WRITE);
|
||||
completedLogPage(signal, ZENFORCE_WRITE, __LINE__);
|
||||
twnlNewMbyte = logFilePtr.p->currentMbyte + 1;
|
||||
}//if
|
||||
/* -------------------------------------------------- */
|
||||
|
@ -18640,3 +18629,16 @@ Uint32 Dblqh::calcPageCheckSum(LogPageRecordPtr logP){
|
|||
return checkSum;
|
||||
}
|
||||
|
||||
void Dblqh::writeDbgInfoPageHeader(LogPageRecordPtr logP, Uint32 place,
|
||||
Uint32 pageNo, Uint32 wordWritten)
|
||||
{
|
||||
logP.p->logPageWord[ZPOS_LOG_TIMER]= logPartPtr.p->logTimer;
|
||||
logP.p->logPageWord[ZPOS_PREV_PAGE_NO]= logP.p->logPageWord[ZPOS_PAGE_NO];
|
||||
logP.p->logPageWord[ZPOS_PAGE_I]= logP.i;
|
||||
logP.p->logPageWord[ZPOS_PLACE_WRITTEN_FROM]= place;
|
||||
logP.p->logPageWord[ZPOS_PAGE_NO]= pageNo;
|
||||
logP.p->logPageWord[ZPOS_PAGE_FILE_NO]= logFilePtr.p->fileNo;
|
||||
logP.p->logPageWord[ZPOS_WORD_WRITTEN]= wordWritten;
|
||||
logP.p->logPageWord[ZPOS_IN_WRITING]= 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -266,7 +266,16 @@ NdbOut& operator<<(NdbOut& no, const PageHeader& ph) {
|
|||
printOut("Current page index:", ph.m_current_page_index);
|
||||
printOut("Oldest prepare op. file No.:", ph.m_old_prepare_file_number);
|
||||
printOut("Oldest prepare op. page ref.:", ph.m_old_prepare_page_reference);
|
||||
printOut("Dirty flag:", ph.m_dirty_flag);
|
||||
printOut("Dirty flag:", ph.m_dirty_flag);
|
||||
printOut("Write Timer:", ph.m_log_timer);
|
||||
printOut("Page i-val:", ph.m_page_i_value);
|
||||
printOut("Place written:", ph.m_place_written_from);
|
||||
printOut("Page No in File:", ph.m_page_no);
|
||||
printOut("File No:", ph.m_file_no);
|
||||
printOut("Word Written:", ph.m_word_written);
|
||||
printOut("In Writing (should be 1)", ph.m_in_writing_flag);
|
||||
printOut("Prev Page No (can be garbage)", ph.m_prev_page_no);
|
||||
printOut("In Free List (should be 0):", ph.m_in_free_list);
|
||||
no << endl;
|
||||
return no;
|
||||
}
|
||||
|
|
|
@ -147,6 +147,17 @@ protected:
|
|||
Uint32 m_old_prepare_file_number;
|
||||
Uint32 m_old_prepare_page_reference;
|
||||
Uint32 m_dirty_flag;
|
||||
/* Debug info Start */
|
||||
Uint32 m_log_timer;
|
||||
Uint32 m_page_i_value;
|
||||
Uint32 m_place_written_from;
|
||||
Uint32 m_page_no;
|
||||
Uint32 m_file_no;
|
||||
Uint32 m_word_written;
|
||||
Uint32 m_in_writing_flag;
|
||||
Uint32 m_prev_page_no;
|
||||
Uint32 m_in_free_list;
|
||||
/* Debug info End */
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Reference in a new issue