Below is the list of changes that have just been committed into a local
5.1 repository of zhl. When zhl 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-25 13:33:34+00:00, lzhou@dev3-63.(none) +10 -0
TMP patch for node restart
storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp@stripped, 2007-07-25 13:33:26+00:00,
lzhou@dev3-63.(none) +4 -0
Add node restart status type
storage/ndb/include/mgmapi/mgmapi_config_parameters.h@stripped, 2007-07-25 13:33:26+00:00,
lzhou@dev3-63.(none) +1 -0
Define startup report frequency
storage/ndb/include/mgmapi/ndb_logevent.h@stripped, 2007-07-25 13:33:26+00:00,
lzhou@dev3-63.(none) +11 -2
Define node restart status variable
storage/ndb/src/common/debugger/EventLogger.cpp@stripped, 2007-07-25 13:33:26+00:00,
lzhou@dev3-63.(none) +7 -0
Add output for node restart status
storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp@stripped, 2007-07-25 13:33:26+00:00,
lzhou@dev3-63.(none) +4 -0
Add dump state order for node restart status
storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp@stripped, 2007-07-25 13:33:26+00:00,
lzhou@dev3-63.(none) +18 -0
define variable and function for node restart
storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp@stripped, 2007-07-25 13:33:26+00:00,
lzhou@dev3-63.(none) +3 -0
Initialize variable for node restart
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp@stripped, 2007-07-25 13:33:26+00:00,
lzhou@dev3-63.(none) +76 -0
Implement node restart status report
storage/ndb/src/mgmapi/ndb_logevent.cpp@stripped, 2007-07-25 13:33:27+00:00,
lzhou@dev3-63.(none) +5 -0
Define node restart status
storage/ndb/src/mgmsrv/ConfigInfo.cpp@stripped, 2007-07-25 13:33:27+00:00,
lzhou@dev3-63.(none) +12 -0
Define statup report frequency
# 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: lzhou
# Host: dev3-63.(none)
# Root: /home/zhl/mysql/mysql-5.1/wl3932
--- 1.39/storage/ndb/include/mgmapi/mgmapi_config_parameters.h 2007-07-25 13:33:55 +00:00
+++ 1.40/storage/ndb/include/mgmapi/mgmapi_config_parameters.h 2007-07-25 13:33:55 +00:00
@@ -120,6 +120,7 @@
#define CFG_DB_O_DIRECT 168
#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-25 13:33:55 +00:00
+++ 1.22/storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp 2007-07-25 13:33:55 +00:00
@@ -61,6 +61,10 @@ public:
_TCMin = 101000,
_TCMax = 101999,
+ _LQHMin = 102000,
+ NRStatus = 102001,
+ _LQHMax = 102999,
+
// 1 QMGR Dump information about phase 1 variables
// 13 CMVMI Dump signal counter
// 13 NDBCNTR Dump start phase information
--- 1.50/storage/ndb/src/common/debugger/EventLogger.cpp 2007-07-25 13:33:55 +00:00
+++ 1.51/storage/ndb/src/common/debugger/EventLogger.cpp 2007-07-25 13:33:55 +00:00
@@ -499,6 +499,12 @@ void getTextNR_CopyFragsCompleted(QQQQ)
"to Node %u",
theData[1]);
}
+void getTextNR_Status(QQQQ) {
+ BaseString::snprintf(m_text, m_text_len,
+ "Node restart status: Copy %llu bytes data from node %u to node
%u\n",
+ make_uint64(theData[3], theData[4]),
+ theData[2],theData[1]);
+}
void getTextLCPFragmentCompleted(QQQQ) {
BaseString::snprintf(m_text, m_text_len,
"Table ID = %u, fragment ID = %u has completed LCP "
@@ -1046,6 +1052,7 @@ const EventLoggerBase::EventRepLogLevelM
ROW(NR_CopyFragsStarted, LogLevel::llNodeRestart, 8, Logger::LL_INFO ),
ROW(NR_CopyFragDone, LogLevel::llNodeRestart,10, Logger::LL_INFO ),
ROW(NR_CopyFragsCompleted, LogLevel::llNodeRestart, 8, Logger::LL_INFO ),
+ ROW(NR_Status, LogLevel::llNodeRestart, 8, Logger::LL_INFO ),
ROW(NodeFailCompleted, LogLevel::llNodeRestart, 8, Logger::LL_ALERT),
ROW(NODE_FAILREP, LogLevel::llNodeRestart, 8, Logger::LL_ALERT),
--- 1.117/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2007-07-25 13:33:55 +00:00
+++ 1.118/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2007-07-25 13:33:55 +00:00
@@ -1371,6 +1371,18 @@ const ConfigInfo::ParamInfo ConfigInfo::
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",
DB_TOKEN,
--- 1.53/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp 2007-07-25 13:33:56 +00:00
+++ 1.54/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp 2007-07-25 13:33:56 +00:00
@@ -947,6 +947,10 @@ Cmvmi::execDUMP_STATE_ORD(Signal* signal
{
sendSignal(BACKUP_REF, GSN_DUMP_STATE_ORD, signal, signal->length(), JBB);
}
+ else if (check_block(LQH, val))
+ {
+ sendSignal(DBLQH_REF, GSN_DUMP_STATE_ORD, signal, signal->length(), JBB);
+ }
else if (check_block(TC, val))
{
}
--- 1.79/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp 2007-07-25 13:33:56 +00:00
+++ 1.80/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp 2007-07-25 13:33:56 +00:00
@@ -2895,8 +2895,26 @@ private:
Uint32 c_diskless;
Uint32 c_o_direct;
Uint32 c_error_insert_table_id;
+
+ /*
+ keeps track of total data written into new data node and show backup status
+ */
+ Uint64 m_nr_bytes_total;
+ /* next time to report node start status */
+ Uint32 m_nr_next_report;
+ Uint32 m_nr_report_frequency;
public:
+ /*
+ For periodic node restart status reporting and explicit node restart status reporting
+ */
+ /* Init at start of node restart, timers etc... */
+ void initNRReportStatus(Signal* signal);
+ /* Sheck timers for reporting at certain points */
+ void checkNRReportStatus(Signal* signal, ScanRecordPtr scanptr);
+ /* Send backup status, invoked either periodically, or explicitly */
+ void reportNRStatus(Signal* signal, ScanRecordPtr scanptr);
+
bool is_same_trans(Uint32 opId, Uint32 trid1, Uint32 trid2);
void get_op_info(Uint32 opId, Uint32 *hash, Uint32* gci);
void accminupdate(Signal*, Uint32 opPtrI, const Local_key*);
--- 1.28/storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp 2007-07-25 13:33:56 +00:00
+++ 1.29/storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp 2007-07-25 13:33:56 +00:00
@@ -63,6 +63,9 @@ void Dblqh::initData()
m_backup_ptr = RNIL;
clogFileSize = 16;
cmaxLogFilesInPageZero = 40;
+
+ m_nr_bytes_total = 0;
+ m_nr_report_frequency = 0;
}//Dblqh::initData()
void Dblqh::initRecords()
--- 1.187/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2007-07-25 13:33:56 +00:00
+++ 1.188/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2007-07-25 13:33:56 +00:00
@@ -946,6 +946,7 @@ void Dblqh::checkStartCompletedLab(Signa
void Dblqh::startphase4Lab(Signal* signal)
{
sendNdbSttorryLab(signal);
+ initNRReportStatus(signal);
return;
}//Dblqh::startphase4Lab()
@@ -1047,6 +1048,10 @@ void Dblqh::execREAD_CONFIG_REQ(Signal*
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_LQH_FRAG, &tmp));
c_fragment_pool.setSize(tmp);
+ m_nr_report_frequency = 0;
+ ndb_mgm_get_int_parameter(p, CFG_DB_STARTUP_REPORT_FREQUENCY,
+ &m_nr_report_frequency);
+
if (!ndb_mgm_get_int_parameter(p, CFG_DB_REDOLOG_FILE_SIZE,
&clogFileSize))
{
@@ -10659,6 +10664,7 @@ void Dblqh::copyTupkeyConfLab(Signal* si
tcConnectptr.p->copyCountWords += TnoOfWords;
scanptr.p->scanState = ScanRecord::WAIT_LQHKEY_COPY;
if (tcConnectptr.p->copyCountWords < cmaxWordsAtNodeRec) {
+ m_nr_bytes_total += (TnoOfWords << 2);
nextRecordCopy(signal);
return;
}//if
@@ -10705,6 +10711,7 @@ void Dblqh::copyCompletedLab(Signal* sig
// threshold value. Since this did not occur we must be waiting for completion.
// Check that this is so. If not we crash to find out what is going on.
/*---------------------------------------------------------------------------*/
+ checkNRReportStatus(signal,scanptr);
if (scanptr.p->scanCompletedStatus == ZTRUE) {
jam();
closeCopyLab(signal);
@@ -19012,6 +19019,26 @@ Dblqh::execDUMP_STATE_ORD(Signal* signal
jamEntry();
DumpStateOrd * const dumpState = (DumpStateOrd *)&signal->theData[0];
Uint32 arg= dumpState->args[0];
+
+ /* Dump commands used in public interfaces */
+ switch(arg) {
+ case DumpStateOrd::NRStatus:
+ {
+ scanptr.i = tcConnectptr.p->tcScanRec;
+ if (scanptr.i != RNIL)
+ {
+ c_scanRecordPool.getPtr(scanptr);
+ reportNRStatus(signal,scanptr);
+ }
+ return;
+ }
+ default:
+ /* continue to debug section */
+ break;
+ }
+
+ /* Debugging or unclassified section */
+
if(dumpState->args[0] == DumpStateOrd::CommitAckMarkersSize){
infoEvent("LQH: m_commitAckMarkerPool: %d free size: %d",
m_commitAckMarkerPool.getNoOfFree(),
@@ -19642,6 +19669,55 @@ Dblqh::execDUMP_STATE_ORD(Signal* signal
}
}
}//Dblqh::execDUMP_STATE_ORD()
+
+// Node recovery status report
+void
+Dblqh::initNRReportStatus(Signal *signal)
+{
+ struct timeval the_time;
+ gettimeofday(&the_time, 0);
+ m_nr_next_report = the_time.tv_sec + m_nr_report_frequency;
+}
+
+void
+Dblqh::checkNRReportStatus(Signal *signal, ScanRecordPtr scanptr)
+{
+ ndbout_c("zhl in Dblqh::checkNRReportStatus");
+ if (m_nr_report_frequency == 0)
+ return;
+
+ struct timeval the_time;
+ gettimeofday(&the_time, 0);
+ if (the_time.tv_sec > m_nr_next_report)
+ {
+ reportNRStatus(signal, scanptr);
+ m_nr_next_report = the_time.tv_sec + m_nr_report_frequency;
+ }
+}
+
+void
+Dblqh::reportNRStatus(Signal* signal, ScanRecordPtr scanptr)
+{
+ ndbout_c("zhl in Dblqh::reportNRStatus");
+ const int signal_length = 5;
+
+ signal->theData[0] = NDB_LE_NR_Status;
+ for (int i= 1; i < signal_length; i++)
+ signal->theData[i] = 0;
+
+ if (scanptr.i == RNIL)
+ {
+ sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, signal_length, JBB);
+ return;
+ }
+ signal->theData[1] = scanptr.p->scanNodeId;
+ signal->theData[2] = getOwnNodeId();;
+
+ signal->theData[3] = (Uint32)(m_nr_bytes_total & 0xFFFFFFFF);
+ signal->theData[4] = (Uint32)(m_nr_bytes_total >> 32);
+ ndbout_c("zhl in Dblqh::reportNRStatus,before send to cmvmi,signal->theData[0] is
%d, signal->theData[1] is %d , signal->theData[2] is %d, signal->theData[3] is
%d, signal->theData[4] is %d",signal->theData[0],
signal->theData[1],signal->theData[2],
signal->theData[3],signal->theData[4]);
+ sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, signal_length, JBB);
+}
/* **************************************************************** */
/* ---------------------------------------------------------------- */
--- 1.12/storage/ndb/include/mgmapi/ndb_logevent.h 2007-07-25 13:33:56 +00:00
+++ 1.13/storage/ndb/include/mgmapi/ndb_logevent.h 2007-07-25 13:33:56 +00:00
@@ -97,6 +97,8 @@ extern "C" {
NDB_LE_NR_CopyFragDone = 25,
/** NDB_MGM_EVENT_CATEGORY_NODE_RESTART */
NDB_LE_NR_CopyFragsCompleted = 26,
+ /** NDB_MGM_EVENT_CATEGORY_NODE_RESTART */
+ NDB_LE_NR_Status = 70,
/* NODEFAIL */
/** NDB_MGM_EVENT_CATEGORY_NODE_RESTART */
@@ -188,8 +190,8 @@ extern "C" {
NDB_LE_StartReport = 60
/* 61 (used in upcoming patch) */
- /* 62-67 used */
- /* 68 unused */
+ /* 62-70 used */
+ /* 71 unused */
};
@@ -484,6 +486,13 @@ extern "C" {
struct {
unsigned dest_node;
} NR_CopyFragsCompleted;
+ /** Log event specific data for for corresponding NDB_LE_ log event */
+ struct {
+ unsigned starting_node;
+ unsigned copy_node;
+ unsigned n_bytes_lo;
+ unsigned n_bytes_hi;
+ } NR_Status;
/** Log event specific data for for corresponding NDB_LE_ log event */
struct {
--- 1.15/storage/ndb/src/mgmapi/ndb_logevent.cpp 2007-07-25 13:33:56 +00:00
+++ 1.16/storage/ndb/src/mgmapi/ndb_logevent.cpp 2007-07-25 13:33:56 +00:00
@@ -205,6 +205,11 @@ struct Ndb_logevent_body_row ndb_logeven
ROW( NR_CopyFragsCompleted, "dest_node", 1, dest_node),
+ ROW( NR_Status, "starting_node", 1, starting_node),
+ ROW( NR_Status, "copy_node", 2, copy_node),
+ ROW( NR_Status, "n_bytes_lo", 3, n_bytes_lo),
+ ROW( NR_Status, "n_bytes_hi", 4, n_bytes_hi),
+
ROW( NodeFailCompleted, "block", 1, block), /* 0 = all */
ROW( NodeFailCompleted, "failed_node", 2, failed_node),
ROW( NodeFailCompleted, "completing_node", 3, completing_node), /* 0 = all */
| Thread |
|---|
| • bk commit into 5.1 tree (lzhou:1.2559) | lzhou | 25 Jul |