Commit dfb34b07 authored by unknown's avatar unknown

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

into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb


mysql-test/ndb/ndb_config_1_node.ini:
  Auto merged
mysql-test/ndb/ndb_config_2_node.ini:
  Auto merged
storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp:
  Auto merged
storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
  Auto merged
storage/ndb/src/mgmsrv/ConfigInfo.cpp:
  Auto merged
storage/ndb/src/ndbapi/ndberror.c:
  Auto merged
parents b5445c15 c8e0d0db
...@@ -10,7 +10,8 @@ DataDir= CHOOSE_FILESYSTEM ...@@ -10,7 +10,8 @@ DataDir= CHOOSE_FILESYSTEM
MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes
MaxNoOfAttributes= CHOOSE_MaxNoOfAttributes MaxNoOfAttributes= CHOOSE_MaxNoOfAttributes
TimeBetweenGlobalCheckpoints= 500 TimeBetweenGlobalCheckpoints= 500
NoOfFragmentLogFiles= 3 NoOfFragmentLogFiles= 8
FragmentLogFileSize= 6M
DiskPageBufferMemory= CHOOSE_DiskPageBufferMemory DiskPageBufferMemory= CHOOSE_DiskPageBufferMemory
# #
......
...@@ -10,7 +10,8 @@ DataDir= CHOOSE_FILESYSTEM ...@@ -10,7 +10,8 @@ DataDir= CHOOSE_FILESYSTEM
MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes
MaxNoOfAttributes= CHOOSE_MaxNoOfAttributes MaxNoOfAttributes= CHOOSE_MaxNoOfAttributes
TimeBetweenGlobalCheckpoints= 500 TimeBetweenGlobalCheckpoints= 500
NoOfFragmentLogFiles= 3 NoOfFragmentLogFiles= 4
FragmentLogFileSize=12M
DiskPageBufferMemory= CHOOSE_DiskPageBufferMemory DiskPageBufferMemory= CHOOSE_DiskPageBufferMemory
# the following parametes just function as a small regression # the following parametes just function as a small regression
# test that the parameter exists # test that the parameter exists
......
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
#define CFG_DB_FILESYSTEM_PATH 125 #define CFG_DB_FILESYSTEM_PATH 125
#define CFG_DB_NO_REDOLOG_FILES 126 #define CFG_DB_NO_REDOLOG_FILES 126
#define CFG_DB_REDOLOG_FILE_SIZE 140
#define CFG_DB_LCP_DISC_PAGES_TUP 127 #define CFG_DB_LCP_DISC_PAGES_TUP 127
#define CFG_DB_LCP_DISC_PAGES_TUP_SR 128 #define CFG_DB_LCP_DISC_PAGES_TUP_SR 128
......
...@@ -71,7 +71,6 @@ class Dbtup; ...@@ -71,7 +71,6 @@ class Dbtup;
/* CONSTANTS OF THE LOG PAGES */ /* CONSTANTS OF THE LOG PAGES */
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
#define ZPAGE_HEADER_SIZE 32 #define ZPAGE_HEADER_SIZE 32
#define ZNO_MBYTES_IN_FILE 16
#define ZPAGE_SIZE 8192 #define ZPAGE_SIZE 8192
#define ZPAGES_IN_MBYTE 32 #define ZPAGES_IN_MBYTE 32
#define ZTWOLOG_NO_PAGES_IN_MBYTE 5 #define ZTWOLOG_NO_PAGES_IN_MBYTE 5
...@@ -142,7 +141,7 @@ class Dbtup; ...@@ -142,7 +141,7 @@ class Dbtup;
/* IN THE MBYTE. */ /* IN THE MBYTE. */
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
#define ZFD_HEADER_SIZE 3 #define ZFD_HEADER_SIZE 3
#define ZFD_PART_SIZE 48 #define ZFD_MBYTE_SIZE 3
#define ZLOG_HEAD_SIZE 8 #define ZLOG_HEAD_SIZE 8
#define ZNEXT_LOG_SIZE 2 #define ZNEXT_LOG_SIZE 2
#define ZABORT_LOG_SIZE 3 #define ZABORT_LOG_SIZE 3
...@@ -169,7 +168,6 @@ class Dbtup; ...@@ -169,7 +168,6 @@ class Dbtup;
#define ZPOS_LOG_TYPE 0 #define ZPOS_LOG_TYPE 0
#define ZPOS_NO_FD 1 #define ZPOS_NO_FD 1
#define ZPOS_FILE_NO 2 #define ZPOS_FILE_NO 2
#define ZMAX_LOG_FILES_IN_PAGE_ZERO 40
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
/* THE POSITIONS WITHIN A PREPARE LOG RECORD AND A NEW PREPARE */ /* THE POSITIONS WITHIN A PREPARE LOG RECORD AND A NEW PREPARE */
/* LOG RECORD. */ /* LOG RECORD. */
...@@ -1437,17 +1435,17 @@ public: ...@@ -1437,17 +1435,17 @@ public:
* header of each log file. That information is used during * header of each log file. That information is used during
* system restart to find the tail of the log. * system restart to find the tail of the log.
*/ */
UintR logLastPrepRef[16]; UintR *logLastPrepRef;
/** /**
* The max global checkpoint completed before the mbyte in the * The max global checkpoint completed before the mbyte in the
* log file was started. One variable per mbyte. * log file was started. One variable per mbyte.
*/ */
UintR logMaxGciCompleted[16]; UintR *logMaxGciCompleted;
/** /**
* The max global checkpoint started before the mbyte in the log * The max global checkpoint started before the mbyte in the log
* file was started. One variable per mbyte. * file was started. One variable per mbyte.
*/ */
UintR logMaxGciStarted[16]; UintR *logMaxGciStarted;
/** /**
* This variable contains the file name as needed by the file * This variable contains the file name as needed by the file
* system when opening the file. * system when opening the file.
...@@ -2163,6 +2161,7 @@ private: ...@@ -2163,6 +2161,7 @@ private:
void execSTART_RECREF(Signal* signal); void execSTART_RECREF(Signal* signal);
void execGCP_SAVEREQ(Signal* signal); void execGCP_SAVEREQ(Signal* signal);
void execFSOPENREF(Signal* signal);
void execFSOPENCONF(Signal* signal); void execFSOPENCONF(Signal* signal);
void execFSCLOSECONF(Signal* signal); void execFSCLOSECONF(Signal* signal);
void execFSWRITECONF(Signal* signal); void execFSWRITECONF(Signal* signal);
...@@ -2671,6 +2670,8 @@ private: ...@@ -2671,6 +2670,8 @@ private:
LogPartRecord *logPartRecord; LogPartRecord *logPartRecord;
LogPartRecordPtr logPartPtr; LogPartRecordPtr logPartPtr;
UintR clogPartFileSize; UintR clogPartFileSize;
Uint32 clogFileSize; // In MBYTE
Uint32 cmaxLogFilesInPageZero; //
// Configurable // Configurable
LogFileRecord *logFileRecord; LogFileRecord *logFileRecord;
......
...@@ -60,6 +60,8 @@ void Dblqh::initData() ...@@ -60,6 +60,8 @@ void Dblqh::initData()
cLqhTimeOutCheckCount = 0; cLqhTimeOutCheckCount = 0;
cbookedAccOps = 0; cbookedAccOps = 0;
m_backup_ptr = RNIL; m_backup_ptr = RNIL;
clogFileSize = 16;
cmaxLogFilesInPageZero = 40;
}//Dblqh::initData() }//Dblqh::initData()
void Dblqh::initRecords() void Dblqh::initRecords()
...@@ -260,6 +262,7 @@ Dblqh::Dblqh(Block_context& ctx): ...@@ -260,6 +262,7 @@ Dblqh::Dblqh(Block_context& ctx):
addRecSignal(GSN_START_FRAGREQ, &Dblqh::execSTART_FRAGREQ); addRecSignal(GSN_START_FRAGREQ, &Dblqh::execSTART_FRAGREQ);
addRecSignal(GSN_START_RECREF, &Dblqh::execSTART_RECREF); addRecSignal(GSN_START_RECREF, &Dblqh::execSTART_RECREF);
addRecSignal(GSN_GCP_SAVEREQ, &Dblqh::execGCP_SAVEREQ); addRecSignal(GSN_GCP_SAVEREQ, &Dblqh::execGCP_SAVEREQ);
addRecSignal(GSN_FSOPENREF, &Dblqh::execFSOPENREF, true);
addRecSignal(GSN_FSOPENCONF, &Dblqh::execFSOPENCONF); addRecSignal(GSN_FSOPENCONF, &Dblqh::execFSOPENCONF);
addRecSignal(GSN_FSCLOSECONF, &Dblqh::execFSCLOSECONF); addRecSignal(GSN_FSCLOSECONF, &Dblqh::execFSCLOSECONF);
addRecSignal(GSN_FSWRITECONF, &Dblqh::execFSWRITECONF); addRecSignal(GSN_FSWRITECONF, &Dblqh::execFSWRITECONF);
......
...@@ -1041,6 +1041,34 @@ void Dblqh::execREAD_CONFIG_REQ(Signal* signal) ...@@ -1041,6 +1041,34 @@ void Dblqh::execREAD_CONFIG_REQ(Signal* signal)
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_LQH_FRAG, &tmp)); ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_LQH_FRAG, &tmp));
c_fragment_pool.setSize(tmp); c_fragment_pool.setSize(tmp);
if (!ndb_mgm_get_int_parameter(p, CFG_DB_REDOLOG_FILE_SIZE,
&clogFileSize))
{
// convert to mbyte
clogFileSize = (clogFileSize + 1024*1024 - 1) / (1024 * 1024);
ndbrequire(clogFileSize >= 4 && clogFileSize <= 1024);
}
cmaxLogFilesInPageZero = (ZPAGE_SIZE - ZPAGE_HEADER_SIZE - 128) /
(ZFD_MBYTE_SIZE * clogFileSize);
/**
* "Old" cmaxLogFilesInPageZero was 40
* Each FD need 3 words per mb, require that they can fit into 1 page
* (atleast 1 FD)
* Is also checked in ConfigInfo.cpp (max FragmentLogFileSize = 1Gb)
* 1Gb = 1024Mb => 3(ZFD_MBYTE_SIZE) * 1024 < 8192 (ZPAGE_SIZE)
*/
if (cmaxLogFilesInPageZero > 40)
{
jam();
cmaxLogFilesInPageZero = 40;
}
else
{
ndbrequire(cmaxLogFilesInPageZero);
}
initRecords(); initRecords();
initialiseRecordsLab(signal, 0, ref, senderData); initialiseRecordsLab(signal, 0, ref, senderData);
...@@ -11793,9 +11821,9 @@ void Dblqh::sendStartLcp(Signal* signal) ...@@ -11793,9 +11821,9 @@ void Dblqh::sendStartLcp(Signal* signal)
Uint32 Dblqh::remainingLogSize(const LogFileRecordPtr &sltCurrLogFilePtr, Uint32 Dblqh::remainingLogSize(const LogFileRecordPtr &sltCurrLogFilePtr,
const LogPartRecordPtr &sltLogPartPtr) const LogPartRecordPtr &sltLogPartPtr)
{ {
Uint32 hf = sltCurrLogFilePtr.p->fileNo*ZNO_MBYTES_IN_FILE+sltCurrLogFilePtr.p->currentMbyte; Uint32 hf = sltCurrLogFilePtr.p->fileNo*clogFileSize+sltCurrLogFilePtr.p->currentMbyte;
Uint32 tf = sltLogPartPtr.p->logTailFileNo*ZNO_MBYTES_IN_FILE+sltLogPartPtr.p->logTailMbyte; Uint32 tf = sltLogPartPtr.p->logTailFileNo*clogFileSize+sltLogPartPtr.p->logTailMbyte;
Uint32 sz = sltLogPartPtr.p->noLogFiles*ZNO_MBYTES_IN_FILE; Uint32 sz = sltLogPartPtr.p->noLogFiles*clogFileSize;
if (tf > hf) hf += sz; if (tf > hf) hf += sz;
return sz-(hf-tf); return sz-(hf-tf);
} }
...@@ -11853,7 +11881,7 @@ void Dblqh::setLogTail(Signal* signal, Uint32 keepGci) ...@@ -11853,7 +11881,7 @@ void Dblqh::setLogTail(Signal* signal, Uint32 keepGci)
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
SLT_LOOP: SLT_LOOP:
for (tsltIndex = tsltStartMbyte; for (tsltIndex = tsltStartMbyte;
tsltIndex <= ZNO_MBYTES_IN_FILE - 1; tsltIndex <= clogFileSize - 1;
tsltIndex++) { tsltIndex++) {
if (sltLogFilePtr.p->logMaxGciStarted[tsltIndex] >= keepGci) { if (sltLogFilePtr.p->logMaxGciStarted[tsltIndex] >= keepGci) {
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
...@@ -11869,7 +11897,7 @@ void Dblqh::setLogTail(Signal* signal, Uint32 keepGci) ...@@ -11869,7 +11897,7 @@ void Dblqh::setLogTail(Signal* signal, Uint32 keepGci)
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
/*STEPPING BACK INCLUDES ALSO STEPPING BACK TO THE PREVIOUS LOG FILE. */ /*STEPPING BACK INCLUDES ALSO STEPPING BACK TO THE PREVIOUS LOG FILE. */
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
tsltMbyte = ZNO_MBYTES_IN_FILE - 1; tsltMbyte = clogFileSize - 1;
sltLogFilePtr.i = sltLogFilePtr.p->prevLogFile; sltLogFilePtr.i = sltLogFilePtr.p->prevLogFile;
ptrCheckGuard(sltLogFilePtr, clogFileFileSize, logFileRecord); ptrCheckGuard(sltLogFilePtr, clogFileFileSize, logFileRecord);
}//if }//if
...@@ -11907,7 +11935,7 @@ void Dblqh::setLogTail(Signal* signal, Uint32 keepGci) ...@@ -11907,7 +11935,7 @@ void Dblqh::setLogTail(Signal* signal, Uint32 keepGci)
UintR ToldTailFileNo = sltLogPartPtr.p->logTailFileNo; UintR ToldTailFileNo = sltLogPartPtr.p->logTailFileNo;
UintR ToldTailMByte = sltLogPartPtr.p->logTailMbyte; UintR ToldTailMByte = sltLogPartPtr.p->logTailMbyte;
arrGuard(tsltMbyte, 16); arrGuard(tsltMbyte, clogFileSize);
sltLogPartPtr.p->logTailFileNo = sltLogPartPtr.p->logTailFileNo =
sltLogFilePtr.p->logLastPrepRef[tsltMbyte] >> 16; sltLogFilePtr.p->logLastPrepRef[tsltMbyte] >> 16;
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
...@@ -12407,6 +12435,26 @@ void Dblqh::execFSOPENCONF(Signal* signal) ...@@ -12407,6 +12435,26 @@ void Dblqh::execFSOPENCONF(Signal* signal)
}//switch }//switch
}//Dblqh::execFSOPENCONF() }//Dblqh::execFSOPENCONF()
void
Dblqh::execFSOPENREF(Signal* signal)
{
jamEntry();
FsRef* ref = (FsRef*)signal->getDataPtr();
Uint32 err = ref->errorCode;
if (err == FsRef::fsErrInvalidFileSize)
{
char buf[256];
BaseString::snprintf(buf, sizeof(buf),
"Invalid file size for redo logfile, "
" size only changable with --initial");
progError(__LINE__,
NDBD_EXIT_INVALID_CONFIG,
buf);
return;
}
SimulatedBlock::execFSOPENREF(signal);
}
/* ************>> */ /* ************>> */
/* FSREADCONF > */ /* FSREADCONF > */
...@@ -13052,7 +13100,7 @@ void Dblqh::openFileInitLab(Signal* signal) ...@@ -13052,7 +13100,7 @@ void Dblqh::openFileInitLab(Signal* signal)
{ {
logFilePtr.p->logFileStatus = LogFileRecord::OPEN_INIT; logFilePtr.p->logFileStatus = LogFileRecord::OPEN_INIT;
seizeLogpage(signal); seizeLogpage(signal);
writeSinglePage(signal, (ZNO_MBYTES_IN_FILE * ZPAGES_IN_MBYTE) - 1, writeSinglePage(signal, (clogFileSize * ZPAGES_IN_MBYTE) - 1,
ZPAGE_SIZE - 1, __LINE__); ZPAGE_SIZE - 1, __LINE__);
lfoPtr.p->lfoState = LogFileOperationRecord::INIT_WRITE_AT_END; lfoPtr.p->lfoState = LogFileOperationRecord::INIT_WRITE_AT_END;
return; return;
...@@ -13115,7 +13163,7 @@ void Dblqh::writeInitMbyteLab(Signal* signal) ...@@ -13115,7 +13163,7 @@ void Dblqh::writeInitMbyteLab(Signal* signal)
{ {
releaseLfo(signal); releaseLfo(signal);
logFilePtr.p->currentMbyte = logFilePtr.p->currentMbyte + 1; logFilePtr.p->currentMbyte = logFilePtr.p->currentMbyte + 1;
if (logFilePtr.p->currentMbyte == ZNO_MBYTES_IN_FILE) { if (logFilePtr.p->currentMbyte == clogFileSize) {
jam(); jam();
releaseLogpage(signal); releaseLogpage(signal);
logFilePtr.p->logFileStatus = LogFileRecord::CLOSING_INIT; logFilePtr.p->logFileStatus = LogFileRecord::CLOSING_INIT;
...@@ -13235,7 +13283,7 @@ void Dblqh::initLogfile(Signal* signal, Uint32 fileNo) ...@@ -13235,7 +13283,7 @@ void Dblqh::initLogfile(Signal* signal, Uint32 fileNo)
logFilePtr.p->lastPageWritten = 0; logFilePtr.p->lastPageWritten = 0;
logFilePtr.p->logPageZero = RNIL; logFilePtr.p->logPageZero = RNIL;
logFilePtr.p->currentMbyte = 0; logFilePtr.p->currentMbyte = 0;
for (tilIndex = 0; tilIndex <= 15; tilIndex++) { for (tilIndex = 0; tilIndex < clogFileSize; tilIndex++) {
logFilePtr.p->logMaxGciCompleted[tilIndex] = (UintR)-1; logFilePtr.p->logMaxGciCompleted[tilIndex] = (UintR)-1;
logFilePtr.p->logMaxGciStarted[tilIndex] = (UintR)-1; logFilePtr.p->logMaxGciStarted[tilIndex] = (UintR)-1;
logFilePtr.p->logLastPrepRef[tilIndex] = 0; logFilePtr.p->logLastPrepRef[tilIndex] = 0;
...@@ -13286,8 +13334,12 @@ void Dblqh::openFileRw(Signal* signal, LogFileRecordPtr olfLogFilePtr) ...@@ -13286,8 +13334,12 @@ void Dblqh::openFileRw(Signal* signal, LogFileRecordPtr olfLogFilePtr)
signal->theData[3] = olfLogFilePtr.p->fileName[1]; signal->theData[3] = olfLogFilePtr.p->fileName[1];
signal->theData[4] = olfLogFilePtr.p->fileName[2]; signal->theData[4] = olfLogFilePtr.p->fileName[2];
signal->theData[5] = olfLogFilePtr.p->fileName[3]; signal->theData[5] = olfLogFilePtr.p->fileName[3];
signal->theData[6] = ZOPEN_READ_WRITE | FsOpenReq::OM_AUTOSYNC; signal->theData[6] = ZOPEN_READ_WRITE | FsOpenReq::OM_AUTOSYNC | FsOpenReq::OM_CHECK_SIZE;
req->auto_sync_size = MAX_REDO_PAGES_WITHOUT_SYNCH * sizeof(LogPageRecord); req->auto_sync_size = MAX_REDO_PAGES_WITHOUT_SYNCH * sizeof(LogPageRecord);
Uint64 sz = clogFileSize;
sz *= 1024; sz *= 1024;
req->file_size_hi = sz >> 32;
req->file_size_lo = sz & 0xFFFFFFFF;
sendSignal(NDBFS_REF, GSN_FSOPENREQ, signal, FsOpenReq::SignalLength, JBA); sendSignal(NDBFS_REF, GSN_FSOPENREQ, signal, FsOpenReq::SignalLength, JBA);
}//Dblqh::openFileRw() }//Dblqh::openFileRw()
...@@ -13342,8 +13394,12 @@ void Dblqh::openNextLogfile(Signal* signal) ...@@ -13342,8 +13394,12 @@ void Dblqh::openNextLogfile(Signal* signal)
signal->theData[3] = onlLogFilePtr.p->fileName[1]; signal->theData[3] = onlLogFilePtr.p->fileName[1];
signal->theData[4] = onlLogFilePtr.p->fileName[2]; signal->theData[4] = onlLogFilePtr.p->fileName[2];
signal->theData[5] = onlLogFilePtr.p->fileName[3]; signal->theData[5] = onlLogFilePtr.p->fileName[3];
signal->theData[6] = 2 | FsOpenReq::OM_AUTOSYNC; signal->theData[6] = 2 | FsOpenReq::OM_AUTOSYNC | FsOpenReq::OM_CHECK_SIZE;
req->auto_sync_size = MAX_REDO_PAGES_WITHOUT_SYNCH * sizeof(LogPageRecord); req->auto_sync_size = MAX_REDO_PAGES_WITHOUT_SYNCH * sizeof(LogPageRecord);
Uint64 sz = clogFileSize;
sz *= 1024; sz *= 1024;
req->file_size_hi = sz >> 32;
req->file_size_lo = sz & 0xFFFFFFFF;
sendSignal(NDBFS_REF, GSN_FSOPENREQ, signal, FsOpenReq::SignalLength, JBA); sendSignal(NDBFS_REF, GSN_FSOPENREQ, signal, FsOpenReq::SignalLength, JBA);
}//if }//if
}//Dblqh::openNextLogfile() }//Dblqh::openNextLogfile()
...@@ -13474,7 +13530,7 @@ void Dblqh::writeFileDescriptor(Signal* signal) ...@@ -13474,7 +13530,7 @@ void Dblqh::writeFileDescriptor(Signal* signal)
/* -------------------------------------------------- */ /* -------------------------------------------------- */
/* START BY WRITING TO LOG FILE RECORD */ /* START BY WRITING TO LOG FILE RECORD */
/* -------------------------------------------------- */ /* -------------------------------------------------- */
arrGuard(logFilePtr.p->currentMbyte, 16); arrGuard(logFilePtr.p->currentMbyte, clogFileSize);
logFilePtr.p->logMaxGciCompleted[logFilePtr.p->currentMbyte] = logFilePtr.p->logMaxGciCompleted[logFilePtr.p->currentMbyte] =
logPartPtr.p->logPartNewestCompletedGCI; logPartPtr.p->logPartNewestCompletedGCI;
logFilePtr.p->logMaxGciStarted[logFilePtr.p->currentMbyte] = cnewestGci; logFilePtr.p->logMaxGciStarted[logFilePtr.p->currentMbyte] = cnewestGci;
...@@ -13500,10 +13556,7 @@ void Dblqh::writeFileDescriptor(Signal* signal) ...@@ -13500,10 +13556,7 @@ void Dblqh::writeFileDescriptor(Signal* signal)
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
void Dblqh::writeFileHeaderOpen(Signal* signal, Uint32 wmoType) void Dblqh::writeFileHeaderOpen(Signal* signal, Uint32 wmoType)
{ {
LogFileRecordPtr wmoLogFilePtr;
UintR twmoNoLogDescriptors; UintR twmoNoLogDescriptors;
UintR twmoLoop;
UintR twmoIndex;
/* -------------------------------------------------- */ /* -------------------------------------------------- */
/* WRITE HEADER INFORMATION IN THE NEW FILE. */ /* WRITE HEADER INFORMATION IN THE NEW FILE. */
...@@ -13511,52 +13564,44 @@ void Dblqh::writeFileHeaderOpen(Signal* signal, Uint32 wmoType) ...@@ -13511,52 +13564,44 @@ void Dblqh::writeFileHeaderOpen(Signal* signal, Uint32 wmoType)
logPagePtr.p->logPageWord[ZPAGE_HEADER_SIZE + ZPOS_LOG_TYPE] = ZFD_TYPE; logPagePtr.p->logPageWord[ZPAGE_HEADER_SIZE + ZPOS_LOG_TYPE] = ZFD_TYPE;
logPagePtr.p->logPageWord[ZPAGE_HEADER_SIZE + ZPOS_FILE_NO] = logPagePtr.p->logPageWord[ZPAGE_HEADER_SIZE + ZPOS_FILE_NO] =
logFilePtr.p->fileNo; logFilePtr.p->fileNo;
if (logPartPtr.p->noLogFiles > ZMAX_LOG_FILES_IN_PAGE_ZERO) { if (logPartPtr.p->noLogFiles > cmaxLogFilesInPageZero) {
jam(); jam();
twmoNoLogDescriptors = ZMAX_LOG_FILES_IN_PAGE_ZERO; twmoNoLogDescriptors = cmaxLogFilesInPageZero;
} else { } else {
jam(); jam();
twmoNoLogDescriptors = logPartPtr.p->noLogFiles; twmoNoLogDescriptors = logPartPtr.p->noLogFiles;
}//if }//if
logPagePtr.p->logPageWord[ZPAGE_HEADER_SIZE + ZPOS_NO_FD] = logPagePtr.p->logPageWord[ZPAGE_HEADER_SIZE + ZPOS_NO_FD] =
twmoNoLogDescriptors; twmoNoLogDescriptors;
wmoLogFilePtr.i = logFilePtr.i;
twmoLoop = 0; {
WMO_LOOP: Uint32 pos = ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE;
jam(); LogFileRecordPtr filePtr = logFilePtr;
if (twmoLoop < twmoNoLogDescriptors) { for (Uint32 fd = 0; fd < twmoNoLogDescriptors; fd++)
jam(); {
ptrCheckGuard(wmoLogFilePtr, clogFileFileSize, logFileRecord); jam();
for (twmoIndex = 0; twmoIndex <= ZNO_MBYTES_IN_FILE - 1; twmoIndex++) { ptrCheckGuard(filePtr, clogFileFileSize, logFileRecord);
jam(); for (Uint32 mb = 0; mb < clogFileSize; mb ++)
arrGuard(((ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) + {
(twmoLoop * ZFD_PART_SIZE)) + twmoIndex, ZPAGE_SIZE); jam();
logPagePtr.p->logPageWord[((ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) + Uint32 pos0 = pos + fd * (ZFD_MBYTE_SIZE * clogFileSize) + mb;
(twmoLoop * ZFD_PART_SIZE)) + twmoIndex] = Uint32 pos1 = pos0 + clogFileSize;
wmoLogFilePtr.p->logMaxGciCompleted[twmoIndex]; Uint32 pos2 = pos1 + clogFileSize;
arrGuard((((ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) + arrGuard(pos0, ZPAGE_SIZE);
(twmoLoop * ZFD_PART_SIZE)) + ZNO_MBYTES_IN_FILE) + arrGuard(pos1, ZPAGE_SIZE);
twmoIndex, ZPAGE_SIZE); arrGuard(pos2, ZPAGE_SIZE);
logPagePtr.p->logPageWord[(((ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) + logPagePtr.p->logPageWord[pos0] = filePtr.p->logMaxGciCompleted[mb];
(twmoLoop * ZFD_PART_SIZE)) + ZNO_MBYTES_IN_FILE) + twmoIndex] = logPagePtr.p->logPageWord[pos1] = filePtr.p->logMaxGciStarted[mb];
wmoLogFilePtr.p->logMaxGciStarted[twmoIndex]; logPagePtr.p->logPageWord[pos2] = filePtr.p->logLastPrepRef[mb];
arrGuard((((ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) + }
(twmoLoop * ZFD_PART_SIZE)) + (2 * ZNO_MBYTES_IN_FILE)) + filePtr.i = filePtr.p->prevLogFile;
twmoIndex, ZPAGE_SIZE); }
logPagePtr.p->logPageWord[(((ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) + pos += (twmoNoLogDescriptors * ZFD_MBYTE_SIZE * clogFileSize);
(twmoLoop * ZFD_PART_SIZE)) + (2 * ZNO_MBYTES_IN_FILE)) + twmoIndex] = arrGuard(pos, ZPAGE_SIZE);
wmoLogFilePtr.p->logLastPrepRef[twmoIndex]; logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX] = pos;
}//for logPagePtr.p->logPageWord[pos] = ZNEXT_LOG_RECORD_TYPE;
wmoLogFilePtr.i = wmoLogFilePtr.p->prevLogFile; }
twmoLoop = twmoLoop + 1;
goto WMO_LOOP;
}//if
logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX] =
(ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) +
(ZFD_PART_SIZE * twmoNoLogDescriptors);
arrGuard(logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX], ZPAGE_SIZE);
logPagePtr.p->logPageWord[logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX]] =
ZNEXT_LOG_RECORD_TYPE;
/* ------------------------------------------------------- */ /* ------------------------------------------------------- */
/* THIS IS A SPECIAL WRITE OF THE FIRST PAGE IN THE */ /* THIS IS A SPECIAL WRITE OF THE FIRST PAGE IN THE */
/* LOG FILE. THIS HAS SPECIAL SIGNIFANCE TO FIND */ /* LOG FILE. THIS HAS SPECIAL SIGNIFANCE TO FIND */
...@@ -13701,9 +13746,9 @@ void Dblqh::openSrLastFileLab(Signal* signal) ...@@ -13701,9 +13746,9 @@ void Dblqh::openSrLastFileLab(Signal* signal)
void Dblqh::readSrLastFileLab(Signal* signal) void Dblqh::readSrLastFileLab(Signal* signal)
{ {
logPartPtr.p->logLap = logPagePtr.p->logPageWord[ZPOS_LOG_LAP]; logPartPtr.p->logLap = logPagePtr.p->logPageWord[ZPOS_LOG_LAP];
if (logPartPtr.p->noLogFiles > ZMAX_LOG_FILES_IN_PAGE_ZERO) { if (logPartPtr.p->noLogFiles > cmaxLogFilesInPageZero) {
jam(); jam();
initGciInLogFileRec(signal, ZMAX_LOG_FILES_IN_PAGE_ZERO); initGciInLogFileRec(signal, cmaxLogFilesInPageZero);
} else { } else {
jam(); jam();
initGciInLogFileRec(signal, logPartPtr.p->noLogFiles); initGciInLogFileRec(signal, logPartPtr.p->noLogFiles);
...@@ -13728,7 +13773,7 @@ void Dblqh::readSrLastMbyteLab(Signal* signal) ...@@ -13728,7 +13773,7 @@ void Dblqh::readSrLastMbyteLab(Signal* signal)
logPartPtr.p->lastMbyte = logFilePtr.p->currentMbyte - 1; logPartPtr.p->lastMbyte = logFilePtr.p->currentMbyte - 1;
}//if }//if
}//if }//if
arrGuard(logFilePtr.p->currentMbyte, 16); arrGuard(logFilePtr.p->currentMbyte, clogFileSize);
logFilePtr.p->logMaxGciCompleted[logFilePtr.p->currentMbyte] = logFilePtr.p->logMaxGciCompleted[logFilePtr.p->currentMbyte] =
logPagePtr.p->logPageWord[ZPOS_MAX_GCI_COMPLETED]; logPagePtr.p->logPageWord[ZPOS_MAX_GCI_COMPLETED];
logFilePtr.p->logMaxGciStarted[logFilePtr.p->currentMbyte] = logFilePtr.p->logMaxGciStarted[logFilePtr.p->currentMbyte] =
...@@ -13736,7 +13781,7 @@ void Dblqh::readSrLastMbyteLab(Signal* signal) ...@@ -13736,7 +13781,7 @@ void Dblqh::readSrLastMbyteLab(Signal* signal)
logFilePtr.p->logLastPrepRef[logFilePtr.p->currentMbyte] = logFilePtr.p->logLastPrepRef[logFilePtr.p->currentMbyte] =
logPagePtr.p->logPageWord[ZLAST_LOG_PREP_REF]; logPagePtr.p->logPageWord[ZLAST_LOG_PREP_REF];
releaseLogpage(signal); releaseLogpage(signal);
if (logFilePtr.p->currentMbyte < (ZNO_MBYTES_IN_FILE - 1)) { if (logFilePtr.p->currentMbyte < (clogFileSize - 1)) {
jam(); jam();
logFilePtr.p->currentMbyte++; logFilePtr.p->currentMbyte++;
readSinglePage(signal, ZPAGES_IN_MBYTE * logFilePtr.p->currentMbyte); readSinglePage(signal, ZPAGES_IN_MBYTE * logFilePtr.p->currentMbyte);
...@@ -13750,21 +13795,21 @@ void Dblqh::readSrLastMbyteLab(Signal* signal) ...@@ -13750,21 +13795,21 @@ void Dblqh::readSrLastMbyteLab(Signal* signal)
* ---------------------------------------------------------------------- */ * ---------------------------------------------------------------------- */
if (logPartPtr.p->lastMbyte == ZNIL) { if (logPartPtr.p->lastMbyte == ZNIL) {
jam(); jam();
logPartPtr.p->lastMbyte = ZNO_MBYTES_IN_FILE - 1; logPartPtr.p->lastMbyte = clogFileSize - 1;
}//if }//if
}//if }//if
logFilePtr.p->logFileStatus = LogFileRecord::CLOSING_SR; logFilePtr.p->logFileStatus = LogFileRecord::CLOSING_SR;
closeFile(signal, logFilePtr, __LINE__); closeFile(signal, logFilePtr, __LINE__);
if (logPartPtr.p->noLogFiles > ZMAX_LOG_FILES_IN_PAGE_ZERO) { if (logPartPtr.p->noLogFiles > cmaxLogFilesInPageZero) {
Uint32 fileNo; Uint32 fileNo;
if (logFilePtr.p->fileNo >= ZMAX_LOG_FILES_IN_PAGE_ZERO) { if (logFilePtr.p->fileNo >= cmaxLogFilesInPageZero) {
jam(); jam();
fileNo = logFilePtr.p->fileNo - ZMAX_LOG_FILES_IN_PAGE_ZERO; fileNo = logFilePtr.p->fileNo - cmaxLogFilesInPageZero;
} else { } else {
jam(); jam();
fileNo = fileNo =
(logPartPtr.p->noLogFiles + logFilePtr.p->fileNo) - (logPartPtr.p->noLogFiles + logFilePtr.p->fileNo) -
ZMAX_LOG_FILES_IN_PAGE_ZERO; cmaxLogFilesInPageZero;
}//if }//if
if (fileNo == 0) { if (fileNo == 0) {
jam(); jam();
...@@ -13774,11 +13819,11 @@ void Dblqh::readSrLastMbyteLab(Signal* signal) ...@@ -13774,11 +13819,11 @@ void Dblqh::readSrLastMbyteLab(Signal* signal)
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
fileNo = 1; fileNo = 1;
logPartPtr.p->srRemainingFiles = logPartPtr.p->srRemainingFiles =
logPartPtr.p->noLogFiles - (ZMAX_LOG_FILES_IN_PAGE_ZERO - 1); logPartPtr.p->noLogFiles - (cmaxLogFilesInPageZero - 1);
} else { } else {
jam(); jam();
logPartPtr.p->srRemainingFiles = logPartPtr.p->srRemainingFiles =
logPartPtr.p->noLogFiles - ZMAX_LOG_FILES_IN_PAGE_ZERO; logPartPtr.p->noLogFiles - cmaxLogFilesInPageZero;
}//if }//if
LogFileRecordPtr locLogFilePtr; LogFileRecordPtr locLogFilePtr;
findLogfile(signal, fileNo, logPartPtr, &locLogFilePtr); findLogfile(signal, fileNo, logPartPtr, &locLogFilePtr);
...@@ -13803,9 +13848,9 @@ void Dblqh::openSrNextFileLab(Signal* signal) ...@@ -13803,9 +13848,9 @@ void Dblqh::openSrNextFileLab(Signal* signal)
void Dblqh::readSrNextFileLab(Signal* signal) void Dblqh::readSrNextFileLab(Signal* signal)
{ {
if (logPartPtr.p->srRemainingFiles > ZMAX_LOG_FILES_IN_PAGE_ZERO) { if (logPartPtr.p->srRemainingFiles > cmaxLogFilesInPageZero) {
jam(); jam();
initGciInLogFileRec(signal, ZMAX_LOG_FILES_IN_PAGE_ZERO); initGciInLogFileRec(signal, cmaxLogFilesInPageZero);
} else { } else {
jam(); jam();
initGciInLogFileRec(signal, logPartPtr.p->srRemainingFiles); initGciInLogFileRec(signal, logPartPtr.p->srRemainingFiles);
...@@ -13813,16 +13858,16 @@ void Dblqh::readSrNextFileLab(Signal* signal) ...@@ -13813,16 +13858,16 @@ void Dblqh::readSrNextFileLab(Signal* signal)
releaseLogpage(signal); releaseLogpage(signal);
logFilePtr.p->logFileStatus = LogFileRecord::CLOSING_SR; logFilePtr.p->logFileStatus = LogFileRecord::CLOSING_SR;
closeFile(signal, logFilePtr, __LINE__); closeFile(signal, logFilePtr, __LINE__);
if (logPartPtr.p->srRemainingFiles > ZMAX_LOG_FILES_IN_PAGE_ZERO) { if (logPartPtr.p->srRemainingFiles > cmaxLogFilesInPageZero) {
Uint32 fileNo; Uint32 fileNo;
if (logFilePtr.p->fileNo >= ZMAX_LOG_FILES_IN_PAGE_ZERO) { if (logFilePtr.p->fileNo >= cmaxLogFilesInPageZero) {
jam(); jam();
fileNo = logFilePtr.p->fileNo - ZMAX_LOG_FILES_IN_PAGE_ZERO; fileNo = logFilePtr.p->fileNo - cmaxLogFilesInPageZero;
} else { } else {
jam(); jam();
fileNo = fileNo =
(logPartPtr.p->noLogFiles + logFilePtr.p->fileNo) - (logPartPtr.p->noLogFiles + logFilePtr.p->fileNo) -
ZMAX_LOG_FILES_IN_PAGE_ZERO; cmaxLogFilesInPageZero;
}//if }//if
if (fileNo == 0) { if (fileNo == 0) {
jam(); jam();
...@@ -13831,11 +13876,11 @@ void Dblqh::readSrNextFileLab(Signal* signal) ...@@ -13831,11 +13876,11 @@ void Dblqh::readSrNextFileLab(Signal* signal)
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
fileNo = 1; fileNo = 1;
logPartPtr.p->srRemainingFiles = logPartPtr.p->srRemainingFiles =
logPartPtr.p->srRemainingFiles - (ZMAX_LOG_FILES_IN_PAGE_ZERO - 1); logPartPtr.p->srRemainingFiles - (cmaxLogFilesInPageZero - 1);
} else { } else {
jam(); jam();
logPartPtr.p->srRemainingFiles = logPartPtr.p->srRemainingFiles =
logPartPtr.p->srRemainingFiles - ZMAX_LOG_FILES_IN_PAGE_ZERO; logPartPtr.p->srRemainingFiles - cmaxLogFilesInPageZero;
}//if }//if
LogFileRecordPtr locLogFilePtr; LogFileRecordPtr locLogFilePtr;
findLogfile(signal, fileNo, logPartPtr, &locLogFilePtr); findLogfile(signal, fileNo, logPartPtr, &locLogFilePtr);
...@@ -14706,7 +14751,7 @@ void Dblqh::srLogLimits(Signal* signal) ...@@ -14706,7 +14751,7 @@ void Dblqh::srLogLimits(Signal* signal)
* EXECUTED. * EXECUTED.
* ----------------------------------------------------------------------- */ * ----------------------------------------------------------------------- */
while(true) { while(true) {
ndbrequire(tmbyte < 16); ndbrequire(tmbyte < clogFileSize);
if (logPartPtr.p->logExecState == LogPartRecord::LES_SEARCH_STOP) { if (logPartPtr.p->logExecState == LogPartRecord::LES_SEARCH_STOP) {
if (logFilePtr.p->logMaxGciCompleted[tmbyte] < logPartPtr.p->logLastGci) { if (logFilePtr.p->logMaxGciCompleted[tmbyte] < logPartPtr.p->logLastGci) {
jam(); jam();
...@@ -14747,7 +14792,7 @@ void Dblqh::srLogLimits(Signal* signal) ...@@ -14747,7 +14792,7 @@ void Dblqh::srLogLimits(Signal* signal)
if (logPartPtr.p->logExecState != LogPartRecord::LES_EXEC_LOG) { if (logPartPtr.p->logExecState != LogPartRecord::LES_EXEC_LOG) {
if (tmbyte == 0) { if (tmbyte == 0) {
jam(); jam();
tmbyte = ZNO_MBYTES_IN_FILE - 1; tmbyte = clogFileSize - 1;
logFilePtr.i = logFilePtr.p->prevLogFile; logFilePtr.i = logFilePtr.p->prevLogFile;
ptrCheckGuard(logFilePtr, clogFileFileSize, logFileRecord); ptrCheckGuard(logFilePtr, clogFileFileSize, logFileRecord);
} else { } else {
...@@ -15141,7 +15186,7 @@ void Dblqh::execSr(Signal* signal) ...@@ -15141,7 +15186,7 @@ void Dblqh::execSr(Signal* signal)
logPagePtr.p->logPageWord[ZPAGE_HEADER_SIZE + ZPOS_NO_FD]; logPagePtr.p->logPageWord[ZPAGE_HEADER_SIZE + ZPOS_NO_FD];
logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX] = logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX] =
(ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) + (ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) +
(noFdDescriptors * ZFD_PART_SIZE); (noFdDescriptors * ZFD_MBYTE_SIZE * clogFileSize);
} }
break; break;
/* ========================================================================= */ /* ========================================================================= */
...@@ -15181,11 +15226,11 @@ void Dblqh::execSr(Signal* signal) ...@@ -15181,11 +15226,11 @@ void Dblqh::execSr(Signal* signal)
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* START EXECUTION OF A NEW MBYTE IN THE LOG. */ /* START EXECUTION OF A NEW MBYTE IN THE LOG. */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
if (logFilePtr.p->currentMbyte < (ZNO_MBYTES_IN_FILE - 1)) { if (logFilePtr.p->currentMbyte < (clogFileSize - 1)) {
jam(); jam();
logPartPtr.p->logExecState = LogPartRecord::LES_EXEC_LOG_NEW_MBYTE; logPartPtr.p->logExecState = LogPartRecord::LES_EXEC_LOG_NEW_MBYTE;
} else { } else {
ndbrequire(logFilePtr.p->currentMbyte == (ZNO_MBYTES_IN_FILE - 1)); ndbrequire(logFilePtr.p->currentMbyte == (clogFileSize - 1));
jam(); jam();
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* WE HAVE TO CHANGE FILE. CLOSE THIS ONE AND THEN OPEN THE NEXT. */ /* WE HAVE TO CHANGE FILE. CLOSE THIS ONE AND THEN OPEN THE NEXT. */
...@@ -15380,7 +15425,7 @@ void Dblqh::invalidateLogAfterLastGCI(Signal* signal) { ...@@ -15380,7 +15425,7 @@ void Dblqh::invalidateLogAfterLastGCI(Signal* signal) {
jam(); jam();
releaseLfo(signal); releaseLfo(signal);
releaseLogpage(signal); releaseLogpage(signal);
if (logPartPtr.p->invalidatePageNo < (ZNO_MBYTES_IN_FILE * ZPAGES_IN_MBYTE - 1)) { if (logPartPtr.p->invalidatePageNo < (clogFileSize * ZPAGES_IN_MBYTE - 1)) {
// We continue in this file. // We continue in this file.
logPartPtr.p->invalidatePageNo++; logPartPtr.p->invalidatePageNo++;
} else { } else {
...@@ -16721,6 +16766,22 @@ void Dblqh::initialiseLogFile(Signal* signal) ...@@ -16721,6 +16766,22 @@ void Dblqh::initialiseLogFile(Signal* signal)
ptrAss(logFilePtr, logFileRecord); ptrAss(logFilePtr, logFileRecord);
logFilePtr.p->nextLogFile = logFilePtr.i + 1; logFilePtr.p->nextLogFile = logFilePtr.i + 1;
logFilePtr.p->logFileStatus = LogFileRecord::LFS_IDLE; logFilePtr.p->logFileStatus = LogFileRecord::LFS_IDLE;
logFilePtr.p->logLastPrepRef = new Uint32[clogFileSize];
logFilePtr.p->logMaxGciCompleted = new Uint32[clogFileSize];
logFilePtr.p->logMaxGciStarted = new Uint32[clogFileSize];
if (logFilePtr.p->logLastPrepRef == 0 ||
logFilePtr.p->logMaxGciCompleted == 0 ||
logFilePtr.p->logMaxGciStarted == 0)
{
char buf[256];
BaseString::snprintf(buf, sizeof(buf),
"Failed to alloc mbyte(%u) arrays for logfile %u",
clogFileSize, logFilePtr.i);
progError(__LINE__, NDBD_EXIT_MEMALLOC, buf);
}
}//for }//for
logFilePtr.i = clogFileFileSize - 1; logFilePtr.i = clogFileFileSize - 1;
ptrAss(logFilePtr, logFileRecord); ptrAss(logFilePtr, logFileRecord);
...@@ -17049,41 +17110,31 @@ void Dblqh::initFragrec(Signal* signal, ...@@ -17049,41 +17110,31 @@ void Dblqh::initFragrec(Signal* signal,
* ========================================================================= */ * ========================================================================= */
void Dblqh::initGciInLogFileRec(Signal* signal, Uint32 noFdDescriptors) void Dblqh::initGciInLogFileRec(Signal* signal, Uint32 noFdDescriptors)
{ {
LogFileRecordPtr iglLogFilePtr; LogFileRecordPtr filePtr = logFilePtr;
UintR tiglLoop; Uint32 pos = ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE;
UintR tiglIndex; for (Uint32 fd = 0; fd < noFdDescriptors; fd++)
{
tiglLoop = 0;
iglLogFilePtr.i = logFilePtr.i;
iglLogFilePtr.p = logFilePtr.p;
IGL_LOOP:
for (tiglIndex = 0; tiglIndex <= ZNO_MBYTES_IN_FILE - 1; tiglIndex++) {
arrGuard(((ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) +
(tiglLoop * ZFD_PART_SIZE)) + tiglIndex, ZPAGE_SIZE);
iglLogFilePtr.p->logMaxGciCompleted[tiglIndex] =
logPagePtr.p->logPageWord[((ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) +
(tiglLoop * ZFD_PART_SIZE)) + tiglIndex];
arrGuard((((ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) + ZNO_MBYTES_IN_FILE) +
(tiglLoop * ZFD_PART_SIZE)) + tiglIndex, ZPAGE_SIZE);
iglLogFilePtr.p->logMaxGciStarted[tiglIndex] =
logPagePtr.p->logPageWord[(((ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) +
ZNO_MBYTES_IN_FILE) +
(tiglLoop * ZFD_PART_SIZE)) + tiglIndex];
arrGuard((((ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) +
(2 * ZNO_MBYTES_IN_FILE)) + (tiglLoop * ZFD_PART_SIZE)) +
tiglIndex, ZPAGE_SIZE);
iglLogFilePtr.p->logLastPrepRef[tiglIndex] =
logPagePtr.p->logPageWord[(((ZPAGE_HEADER_SIZE + ZFD_HEADER_SIZE) +
(2 * ZNO_MBYTES_IN_FILE)) +
(tiglLoop * ZFD_PART_SIZE)) + tiglIndex];
}//for
tiglLoop = tiglLoop + 1;
if (tiglLoop < noFdDescriptors) {
jam(); jam();
iglLogFilePtr.i = iglLogFilePtr.p->prevLogFile; for (Uint32 mb = 0; mb < clogFileSize; mb++)
ptrCheckGuard(iglLogFilePtr, clogFileFileSize, logFileRecord); {
goto IGL_LOOP; jam();
}//if Uint32 pos0 = pos + fd * (ZFD_MBYTE_SIZE * clogFileSize) + mb;
Uint32 pos1 = pos0 + clogFileSize;
Uint32 pos2 = pos1 + clogFileSize;
arrGuard(pos0, ZPAGE_SIZE);
arrGuard(pos1, ZPAGE_SIZE);
arrGuard(pos2, ZPAGE_SIZE);
filePtr.p->logMaxGciCompleted[mb] = logPagePtr.p->logPageWord[pos0];
filePtr.p->logMaxGciStarted[mb] = logPagePtr.p->logPageWord[pos1];
filePtr.p->logLastPrepRef[mb] = logPagePtr.p->logPageWord[pos2];
}
if (fd + 1 < noFdDescriptors)
{
jam();
filePtr.i = filePtr.p->prevLogFile;
ptrCheckGuard(filePtr, clogFileFileSize, logFileRecord);
}
}
}//Dblqh::initGciInLogFileRec() }//Dblqh::initGciInLogFileRec()
/* ========================================================================== /* ==========================================================================
...@@ -18336,7 +18387,7 @@ void Dblqh::writeNextLog(Signal* signal) ...@@ -18336,7 +18387,7 @@ void Dblqh::writeNextLog(Signal* signal)
ndbrequire(logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX] < ZPAGE_SIZE); ndbrequire(logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX] < ZPAGE_SIZE);
logPagePtr.p->logPageWord[logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX]] = logPagePtr.p->logPageWord[logPagePtr.p->logPageWord[ZCURR_PAGE_INDEX]] =
ZNEXT_MBYTE_TYPE; ZNEXT_MBYTE_TYPE;
if (logFilePtr.p->currentMbyte == (ZNO_MBYTES_IN_FILE - 1)) { if (logFilePtr.p->currentMbyte == (clogFileSize - 1)) {
jam(); jam();
/* -------------------------------------------------- */ /* -------------------------------------------------- */
/* CALCULATE THE NEW REMAINING WORDS WHEN */ /* CALCULATE THE NEW REMAINING WORDS WHEN */
...@@ -18425,7 +18476,7 @@ void Dblqh::writeNextLog(Signal* signal) ...@@ -18425,7 +18476,7 @@ void Dblqh::writeNextLog(Signal* signal)
systemError(signal, __LINE__); systemError(signal, __LINE__);
}//if }//if
}//if }//if
if (logFilePtr.p->currentMbyte == (ZNO_MBYTES_IN_FILE - 1)) { if (logFilePtr.p->currentMbyte == (clogFileSize - 1)) {
jam(); jam();
twnlNextMbyte = 0; twnlNextMbyte = 0;
if (logFilePtr.p->fileChangeState != LogFileRecord::NOT_ONGOING) { if (logFilePtr.p->fileChangeState != LogFileRecord::NOT_ONGOING) {
......
...@@ -879,6 +879,18 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -879,6 +879,18 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"3", "3",
STR_VALUE(MAX_INT_RNIL) }, STR_VALUE(MAX_INT_RNIL) },
{
CFG_DB_REDOLOG_FILE_SIZE,
"FragmentLogFileSize",
DB_TOKEN,
"Size of each Redo log file",
ConfigInfo::CI_USED,
false,
ConfigInfo::CI_INT,
"16M",
"4M",
"1G" },
{ {
CFG_DB_MAX_OPEN_FILES, CFG_DB_MAX_OPEN_FILES,
"MaxNoOfOpenFiles", "MaxNoOfOpenFiles",
......
...@@ -179,7 +179,7 @@ ErrorBundle ErrorCodes[] = { ...@@ -179,7 +179,7 @@ ErrorBundle ErrorCodes[] = {
{ 873, DMEC, TR, "Out of attrinfo records for scan in tuple manager" }, { 873, DMEC, TR, "Out of attrinfo records for scan in tuple manager" },
{ 899, DMEC, TR, "Rowid already allocated" }, { 899, DMEC, TR, "Rowid already allocated" },
{ 1217, DMEC, TR, "Out of operation records in local data manager (increase MaxNoOfLocalOperations)" }, { 1217, DMEC, TR, "Out of operation records in local data manager (increase MaxNoOfLocalOperations)" },
{ 1220, DMEC, TR, "REDO log files overloaded, consult online manual (decrease TimeBetweenLocalCheckpoints, and|or increase NoOfFragmentLogFiles)" }, { 1220, DMEC, TR, "REDO log files overloaded, consult online manual (increase FragmentLogFileSize)" },
{ 1222, DMEC, TR, "Out of transaction markers in LQH" }, { 1222, DMEC, TR, "Out of transaction markers in LQH" },
{ 4021, DMEC, TR, "Out of Send Buffer space in NDB API" }, { 4021, DMEC, TR, "Out of Send Buffer space in NDB API" },
{ 4022, DMEC, TR, "Out of Send Buffer space in NDB API" }, { 4022, DMEC, TR, "Out of Send Buffer space in NDB API" },
......
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