Below is the list of changes that have just been committed into a local
5.1 repository of gni. When gni does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-07-12 13:01:10+08:00, gni@stripped +10 -0
WL#3928 periodic fragment log file initialization status reporting
storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp@stripped, 2007-07-12 13:00:52+08:00, gni@stripped +4 -0
status reporting of fragment log file initialization
- define dump comand for status
storage/ndb/include/mgmapi/mgmapi_config_parameters.h@stripped, 2007-07-12 13:00:53+08:00, gni@stripped +2 -0
various status report frequency during startup
- new config parameter for various startup status report frequency.
storage/ndb/include/mgmapi/ndb_logevent.h@stripped, 2007-07-12 13:00:53+08:00, gni@stripped +14 -2
status reporting of fragment log file initialization
- new structured event for listening for fragment log file initialization status event
storage/ndb/src/common/debugger/EventLogger.cpp@stripped, 2007-07-12 13:00:53+08:00, gni@stripped +25 -1
status reporting of fragment log file initialization
- new structured event for listening for fragment log file intialization status event
- new print function for fragment log file initialization status event
storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp@stripped, 2007-07-12 13:00:53+08:00, gni@stripped +4 -0
status reporting of fragment log file initialization
- explict reporting of fragment log file initialization status
storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp@stripped, 2007-07-12 13:00:53+08:00, gni@stripped +22 -2
status reporting of fragment log file initialization
storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp@stripped, 2007-07-12 13:00:53+08:00, gni@stripped +6 -0
status reporting of fragment log file initialization
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp@stripped, 2007-07-12 13:00:53+08:00, gni@stripped +69 -1
status reporting of fragment log file initialization
- new dump command for fragment log file initialization status
- code for periodic reporting of fragment log file initialization status
storage/ndb/src/mgmapi/ndb_logevent.cpp@stripped, 2007-07-12 13:00:53+08:00, gni@stripped +7 -0
status reporting of fragment log file initialization
- add structured fragment log file intialization event
storage/ndb/src/mgmsrv/ConfigInfo.cpp@stripped, 2007-07-12 13:00:53+08:00, gni@stripped +13 -1
add the parameter in configuration file for status report frequency during startup
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: gni
# Host: dev3-221.dev.cn.tlan
# Root: /home/ngb/mysql/mysql-5.1/logfilestatrep
--- 1.39/storage/ndb/include/mgmapi/mgmapi_config_parameters.h 2007-07-12 13:01:19 +08:00
+++ 1.40/storage/ndb/include/mgmapi/mgmapi_config_parameters.h 2007-07-12 13:01:19 +08:00
@@ -121,6 +121,8 @@
#define CFG_DB_MAX_ALLOCATE 169
+#define CFG_DB_STARTUP_REPORT_FREQUENCY 170
+
#define CFG_DB_SGA 198 /* super pool mem */
#define CFG_DB_DATA_MEM_2 199 /* used in special build in 5.1 */
--- 1.21/storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp 2007-07-12 13:01:19 +08:00
+++ 1.22/storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp 2007-07-12 13:01:19 +08:00
@@ -61,6 +61,10 @@
_TCMin = 101000,
_TCMax = 101999,
+ _LQHMin = 102000,
+ LQHLogFileInitStatus = 102000,
+ _LQHMax = 102999,
+
// 1 QMGR Dump information about phase 1 variables
// 13 CMVMI Dump signal counter
// 13 NDBCNTR Dump start phase information
--- 1.49/storage/ndb/src/common/debugger/EventLogger.cpp 2007-07-12 13:01:19 +08:00
+++ 1.50/storage/ndb/src/common/debugger/EventLogger.cpp 2007-07-12 13:01:19 +08:00
@@ -884,7 +884,29 @@
"Restore completed: backup %u from node %u",
theData[1], theData[2]);
}
-
+void getTextLogFileInitStatus(QQQQ) {
+ if (theData[2])
+ BaseString::snprintf(m_text, m_text_len,
+ "Local redo log file initialization status:\n"
+ "#Total files: %lu, Completed: %lu\n"
+ "#Total MBytes: %lu, Completed: %lu",
+// refToNode(theData[1]),
+ theData[2], theData[3],
+ theData[4], theData[5]);
+ else
+ BaseString::snprintf(m_text, m_text_len,
+ "Node %u: Log file initializtion completed",
+ refToNode(theData[1]));
+}
+void getTextLogFileInitCompStatus(QQQQ) {
+ BaseString::snprintf(m_text, m_text_len,
+ "Local redo log file initialization completed:\n"
+ "#Total files: %lu, Completed: %lu\n"
+ "#Total MBytes: %lu, Completed: %lu",
+// refToNode(theData[1]),
+ theData[2], theData[3],
+ theData[4], theData[5]);
+}
void getTextSingleUser(QQQQ) {
switch (theData[1])
{
@@ -1039,6 +1061,8 @@
ROW(StartLog, LogLevel::llStartUp, 10, Logger::LL_INFO ),
ROW(UNDORecordsExecuted, LogLevel::llStartUp, 15, Logger::LL_INFO ),
ROW(StartReport, LogLevel::llStartUp, 4, Logger::LL_INFO ),
+ ROW(LogFileInitStatus, LogLevel::llStartUp, 7, Logger::LL_INFO),
+ ROW(LogFileInitCompStatus, LogLevel::llStartUp, 7, Logger::LL_INFO),
// NODERESTART
ROW(NR_CopyDict, LogLevel::llNodeRestart, 8, Logger::LL_INFO ),
--- 1.117/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2007-07-12 13:01:19 +08:00
+++ 1.118/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2007-07-12 13:01:19 +08:00
@@ -1369,7 +1369,19 @@
"0",
"0",
STR_VALUE(MAX_INT_RNIL) },
-
+
+ {
+ CFG_DB_STARTUP_REPORT_FREQUENCY,
+ "StartupStatusReportFrequency",
+ DB_TOKEN,
+ "Frequency of various status reports during startup in seconds",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_INT,
+ "0",
+ "0",
+ STR_VALUE(MAX_INT_RNIL) },
+
{
CFG_DB_O_DIRECT,
"ODirect",
--- 1.53/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp 2007-07-12 13:01:19 +08:00
+++ 1.54/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp 2007-07-12 13:01:19 +08:00
@@ -950,6 +950,10 @@
else if (check_block(TC, val))
{
}
+ else if (check_block(LQH, val))
+ {
+ sendSignal(DBLQH_REF, GSN_DUMP_STATE_ORD, signal, signal->length(), JBB);
+ }
return;
}
--- 1.75/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp 2007-07-12 13:01:19 +08:00
+++ 1.76/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp 2007-07-12 13:01:19 +08:00
@@ -2064,7 +2064,15 @@
Uint32 stopPageNo;
Uint32 fileNo;
};
-
+ //for statistic information about redo log initialization
+ Uint32 totalLogFiles;
+ Uint32 logFileInitDone;
+ Uint32 totallogMBytes;
+ Uint32 logMBytesInitDone;
+
+ Uint32 m_startup_report_frequency;
+ Uint32 m_next_report_time;
+
public:
Dblqh(Block_context& ctx);
virtual ~Dblqh();
@@ -2557,7 +2565,19 @@
void send_restore_lcp(Signal * signal);
void execRESTORE_LCP_REF(Signal* signal);
void execRESTORE_LCP_CONF(Signal* signal);
-
+ /**
+ * For periodic redo log file initialization status reporting
+ * and explicit redo log file status reporting
+ */
+ /* Init at start of redo log file initialization, timers etc... */
+ void initReportStatus(Signal* signal);
+ /* Check timers for reporting at certain points */
+ void checkReportStatus(Signal* signal);
+ /* Send redo log file initialization status, invoked either periodically, or explicitly */
+ void reportStatus(Signal* signal);
+ /* redo log file initialization completed report*/
+ void logfileInitCompleteReport(Signal* signal);
+
Dbtup* c_tup;
Dbacc* c_acc;
--- 1.28/storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp 2007-07-12 13:01:19 +08:00
+++ 1.29/storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp 2007-07-12 13:01:19 +08:00
@@ -63,6 +63,12 @@
m_backup_ptr = RNIL;
clogFileSize = 16;
cmaxLogFilesInPageZero = 40;
+
+ totalLogFiles = 0;
+ logFileInitDone = 0;
+ totallogMBytes = 0;
+ logMBytesInitDone = 0;
+ m_startup_report_frequency = 0;
}//Dblqh::initData()
void Dblqh::initRecords()
--- 1.177/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2007-07-12 13:01:19 +08:00
+++ 1.178/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2007-07-12 13:01:19 +08:00
@@ -810,7 +810,11 @@
/* ***************<< */
cinitialStartOngoing = ZTRUE;
ndbrequire(cnoLogFiles != 0);
-
+ if ((cstartType == NodeState::ST_INITIAL_START) ||
+ (cstartType == NodeState::ST_INITIAL_NODE_RESTART)) {
+ reportStatus(signal);
+ }
+ initReportStatus(signal);
for (logPartPtr.i = 0; logPartPtr.i < 4; logPartPtr.i++) {
jam();
ptrAss(logPartPtr, logPartRecord);
@@ -1051,6 +1055,12 @@
ndbrequire(clogFileSize >= 4 && clogFileSize <= 1024);
}
+ m_startup_report_frequency = 0;
+ ndb_mgm_get_int_parameter(p,CFG_DB_STARTUP_REPORT_FREQUENCY,
+ &m_startup_report_frequency);
+ totalLogFiles = 4 * cnoLogFiles;
+ totallogMBytes = totalLogFiles * clogFileSize;
+
cmaxLogFilesInPageZero = (ZPAGE_SIZE - ZPAGE_HEADER_SIZE - 128) /
(ZFD_MBYTE_SIZE * clogFileSize);
@@ -12406,6 +12416,7 @@
return;
case LogFileRecord::CLOSING_INIT:
jam();
+ logFileInitDone++ ;
closingInitLab(signal);
return;
case LogFileRecord::CLOSING_SR:
@@ -12662,6 +12673,7 @@
return;
case LogFileOperationRecord::INIT_FIRST_PAGE:
jam();
+ logMBytesInitDone++;
initFirstPageLab(signal);
return;
case LogFileOperationRecord::WRITE_GCI_ZERO:
@@ -12674,6 +12686,7 @@
return;
case LogFileOperationRecord::WRITE_INIT_MBYTE:
jam();
+ logMBytesInitDone++;
writeInitMbyteLab(signal);
return;
case LogFileOperationRecord::ACTIVE_WRITE_LOG:
@@ -13300,6 +13313,7 @@
signal->theData[1] = logPartPtr.i;
sendSignal(cownref, GSN_CONTINUEB, signal, 2, JBB);
}//for
+ logfileInitCompleteReport(signal);
return;
} else {
jam();
@@ -13725,6 +13739,7 @@
writeSinglePage(signal, logFilePtr.p->currentMbyte * ZPAGES_IN_MBYTE,
ZPAGE_SIZE - 1, __LINE__);
lfoPtr.p->lfoState = LogFileOperationRecord::WRITE_INIT_MBYTE;
+ checkReportStatus(signal);
}//Dblqh::writeInitMbyte()
/* ------------------------------------------------------------------------- */
@@ -18989,6 +19004,10 @@
return;
}
+ if (dumpState->args[0] == DumpStateOrd::LQHLogFileInitStatus){
+ reportStatus(signal);
+ return;
+ }
#ifdef ERROR_INSERT
#ifdef NDB_DEBUG_FULL
@@ -19578,6 +19597,53 @@
logP.p->logPageWord[ZPOS_IN_WRITING]= 1;
}
+void Dblqh::initReportStatus(Signal* signal){
+ struct timeval the_time;
+ gettimeofday(&the_time,0);
+ m_next_report_time = the_time.tv_sec + m_startup_report_frequency;
+}
+
+void Dblqh::checkReportStatus(Signal* signal){
+ if (m_startup_report_frequency == 0)
+ return;
+
+ struct timeval the_time;
+ gettimeofday(&the_time, 0);
+ if (the_time.tv_sec > m_next_report_time)
+ {
+ reportStatus(signal);
+ m_next_report_time = the_time.tv_sec + m_startup_report_frequency;
+ }
+}
+
+void Dblqh::reportStatus(Signal* signal){
+ const int signal_length = 6;
+
+ signal->theData[0] = NDB_LE_LogFileInitStatus;
+ signal->theData[1] = reference();
+ for (int i = 2; i < signal_length; i++)
+ signal->theData[i] = 0;
+ if (getNodeState().startLevel < NodeState::SL_STARTED){
+ signal->theData[2] = totalLogFiles;
+ signal->theData[3] = logFileInitDone;
+ signal->theData[4] = totallogMBytes;
+ signal->theData[5] = logMBytesInitDone;
+ }
+ sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, signal_length, JBB);
+}
+
+void Dblqh::logfileInitCompleteReport(Signal* signal){
+ const int signal_length = 6;
+
+ signal->theData[0] = NDB_LE_LogFileInitCompStatus;
+ signal->theData[1] = reference();
+ signal->theData[2] = totalLogFiles;
+ signal->theData[3] = logFileInitDone;
+ signal->theData[4] = totallogMBytes;
+ signal->theData[5] = logMBytesInitDone;
+ sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, signal_length, JBB);
+}
+
#if defined ERROR_INSERT
void
Dblqh::TRACE_OP_DUMP(const Dblqh::TcConnectionrec* regTcPtr, const char * pos)
@@ -19614,3 +19680,5 @@
(* traceopout) << endl;
}
#endif
+
+
--- 1.12/storage/ndb/include/mgmapi/ndb_logevent.h 2007-07-12 13:01:19 +08:00
+++ 1.13/storage/ndb/include/mgmapi/ndb_logevent.h 2007-07-12 13:01:19 +08:00
@@ -178,6 +178,10 @@
NDB_LE_RestoreStarted = 66,
/** NDB_MGM_EVENT_CATEGORY_BACKUP */
NDB_LE_RestoreCompleted = 67,
+ /** NDB_MGM_EVENT_CATEGORY_FRAGLOGFILE */
+ NDB_LE_LogFileInitStatus = 68,
+ /** NDB_MGM_EVENT_CATEGORY_FRAGLOGFILE */
+ NDB_LE_LogFileInitCompStatus = 69,
/** NDB_MGM_EVENT_CATEGORY_INFO */
NDB_LE_EventBufferStatus = 58,
@@ -188,8 +192,8 @@
NDB_LE_StartReport = 60
/* 61 (used in upcoming patch) */
- /* 62-67 used */
- /* 68 unused */
+ /* 62-69 used */
+ /* 70 unused */
};
@@ -702,6 +706,14 @@
unsigned backup_id;
unsigned node_id;
} RestoreCompleted;
+ /** Log event data @ref NDB_LE_LogFileInitStatus */
+ struct {
+ unsigned node_id;
+ unsigned total_files;
+ unsigned file_done;
+ unsigned total_mbytes;
+ unsigned mbytes_done;
+ } LogFileInitStatus;
/** Log event data @ref NDB_LE_SingleUser */
struct {
unsigned type;
--- 1.15/storage/ndb/src/mgmapi/ndb_logevent.cpp 2007-07-12 13:01:19 +08:00
+++ 1.16/storage/ndb/src/mgmapi/ndb_logevent.cpp 2007-07-12 13:01:19 +08:00
@@ -358,6 +358,13 @@
ROW( SingleUser, "type", 1, type),
ROW( SingleUser, "node_id", 2, node_id),
+
+ ROW( LogFileInitStatus, "node_id", 1, node_id ),
+ ROW( LogFileInitStatus, "total_files", 2, total_files),
+ ROW( LogFileInitStatus, "file_done", 3, file_done),
+ ROW( LogFileInitStatus, "total_mbytes", 4, total_mbytes),
+ ROW( LogFileInitStatus, "mbytes_done", 5, mbytes_done),
+
{ NDB_LE_ILLEGAL_TYPE, 0, 0, 0, 0, 0}
};
| Thread |
|---|
| • bk commit into 5.1 tree (gni:1.2551) | gni | 12 Jul |