Commit c8e0d0db authored by unknown's avatar unknown

ndb - make size of redo log files (fragment log files) configurable

  using new config variable FragmentLogFileSize (4M - 1G)


mysql-test/ndb/ndb_config_1_node.ini:
  change log file size (test)
mysql-test/ndb/ndb_config_2_node.ini:
  change log file size (test)
storage/ndb/include/mgmapi/mgmapi_config_parameters.h:
  add new confif parameter
storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp:
  make logfile size configurable
storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp:
  make logfile size configurable
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
  make logfile size configurable
storage/ndb/src/mgmsrv/ConfigInfo.cpp:
  add new config variable
storage/ndb/src/ndbapi/ndberror.c:
  update error message
parent 1a166bc4
...@@ -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. */
...@@ -1436,17 +1434,17 @@ public: ...@@ -1436,17 +1434,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.
...@@ -2162,6 +2160,7 @@ private: ...@@ -2162,6 +2160,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);
......
...@@ -871,6 +871,18 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -871,6 +871,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