Below is the list of changes that have just been committed into a local
5.1 repository of justin.he. When justin.he 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-06-20 17:47:26+08:00, Justin.He@stripped +8 -0
WL#3927, LCP progress status report
storage/ndb/include/mgmapi/mgmapi_config_parameters.h@stripped, 2007-06-20 17:47:23+08:00, Justin.He@stripped +1 -0
add lcp report frequency parameter type definition
storage/ndb/include/mgmapi/ndb_logevent.h@stripped, 2007-06-20 17:47:23+08:00, Justin.He@stripped +12 -2
add lcp progress report event type definition
storage/ndb/src/common/debugger/EventLogger.cpp@stripped, 2007-06-20 17:47:23+08:00, Justin.He@stripped +15 -1
and function to tranlate signal data info meaningful log info text string
storage/ndb/src/kernel/blocks/backup/Backup.cpp@stripped, 2007-06-20 17:47:23+08:00, Justin.He@stripped +58 -1
add sourcecode related to report LCP progress status in backup block
storage/ndb/src/kernel/blocks/backup/Backup.hpp@stripped, 2007-06-20 17:47:23+08:00, Justin.He@stripped +14 -1
add some variables and function definition for report LCP progress in backup block
storage/ndb/src/kernel/blocks/backup/BackupInit.cpp@stripped, 2007-06-20 17:47:23+08:00, Justin.He@stripped +4 -0
read LCP frequency parameter from mgmsrv
storage/ndb/src/mgmapi/ndb_logevent.cpp@stripped, 2007-06-20 17:47:23+08:00, Justin.He@stripped +7 -0
add map for structure variables and their string name
storage/ndb/src/mgmsrv/ConfigInfo.cpp@stripped, 2007-06-20 17:47:23+08:00, Justin.He@stripped +12 -0
add default definiton for "LCPReportFrequency"
# 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: Justin.He
# Host: dev3-240.dev.cn.tlan
# Root: /home/justin.he/mysql/mysql-5.1/LCP_progress_report-5.1-telco
--- 1.39/storage/ndb/include/mgmapi/mgmapi_config_parameters.h 2007-06-20 17:47:35 +08:00
+++ 1.40/storage/ndb/include/mgmapi/mgmapi_config_parameters.h 2007-06-20 17:47:35 +08:00
@@ -116,6 +116,7 @@
#define CFG_DB_MEMREPORT_FREQUENCY 166
#define CFG_DB_BACKUP_REPORT_FREQUENCY 167
+#define CFG_DB_LCP_REPORT_FREQUENCY 170
#define CFG_DB_O_DIRECT 168
--- 1.49/storage/ndb/src/common/debugger/EventLogger.cpp 2007-06-20 17:47:35 +08:00
+++ 1.50/storage/ndb/src/common/debugger/EventLogger.cpp 2007-06-20 17:47:35 +08:00
@@ -509,6 +509,19 @@
theData[4],
theData[5]);
}
+void getTextLCPProgressStatus(QQQQ) {
+ if (theData[1])
+ BaseString::snprintf(m_text, m_text_len,
+ "Local checkpoint status: lcp %u started from node %u\n"
+ " #Records: %llu\n"
+ " Data: %llu bytes",
+ theData[2], theData[1],
+ make_uint64(theData[3], theData[4]),
+ make_uint64(theData[5], theData[6]));
+ else
+ BaseString::snprintf(m_text, m_text_len,
+ "Local checkpoint not started");
+}
void getTextTransReportCounters(QQQQ) {
// -------------------------------------------------------------------
// Report information about transaction activity once per 10 seconds.
@@ -1018,9 +1031,10 @@
ROW(GlobalCheckpointStarted, LogLevel::llCheckpoint, 9, Logger::LL_INFO ),
ROW(GlobalCheckpointCompleted,LogLevel::llCheckpoint,10, Logger::LL_INFO ),
ROW(LocalCheckpointStarted, LogLevel::llCheckpoint, 7, Logger::LL_INFO ),
- ROW(LocalCheckpointCompleted,LogLevel::llCheckpoint, 8, Logger::LL_INFO ),
+ ROW(LocalCheckpointCompleted,LogLevel::llCheckpoint, 7, Logger::LL_INFO ),
ROW(LCPStoppedInCalcKeepGci, LogLevel::llCheckpoint, 0, Logger::LL_ALERT ),
ROW(LCPFragmentCompleted, LogLevel::llCheckpoint, 11, Logger::LL_INFO ),
+ ROW(LCPProgressStatus, LogLevel::llCheckpoint, 7, Logger::LL_INFO ),
ROW(UndoLogBlocked, LogLevel::llCheckpoint, 7, Logger::LL_INFO ),
// STARTUP
--- 1.117/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2007-06-20 17:47:35 +08:00
+++ 1.118/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2007-06-20 17:47:35 +08:00
@@ -880,6 +880,18 @@
"0",
"31" },
+ {
+ CFG_DB_LCP_REPORT_FREQUENCY,
+ "LCPReportFrequency",
+ DB_TOKEN,
+ "Frequency of progress status reports during LCP in seconds",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_INT,
+ "0",
+ "0",
+ STR_VALUE(MAX_INT_RNIL) },
+
{
CFG_DB_GCP_INTERVAL,
"TimeBetweenGlobalCheckpoints",
--- 1.71/storage/ndb/src/kernel/blocks/backup/Backup.cpp 2007-06-20 17:47:35 +08:00
+++ 1.72/storage/ndb/src/kernel/blocks/backup/Backup.cpp 2007-06-20 17:47:35 +08:00
@@ -2597,6 +2597,56 @@
}
void
+Backup::initLCPProgressStatus(Signal *signal, BackupRecordPtr ptr)
+{
+ struct timeval the_time;
+ gettimeofday(&the_time, 0);
+ ptr.p->m_next_lcp_report = the_time.tv_sec + m_lcp_report_frequency;
+}
+
+void
+Backup::checkLCPReportStatus(Signal *signal, BackupRecordPtr ptr)
+{
+ if (m_lcp_report_frequency == 0)
+ return;
+
+ struct timeval the_time;
+ gettimeofday(&the_time, 0);
+ if ((Uint32)the_time.tv_sec > ptr.p->m_next_lcp_report)
+ {
+ reportLCPStatus(signal, ptr);
+ ptr.p->m_next_lcp_report = the_time.tv_sec + m_lcp_report_frequency;
+ }
+}
+
+void
+Backup::reportLCPStatus(Signal* signal, BackupRecordPtr ptr)
+{
+ const int signal_length = 7;
+
+ signal->theData[0] = NDB_LE_LCPProgressStatus;
+ for (int i= 1; i < signal_length; i++)
+ signal->theData[i] = 0;
+
+ signal->theData[1] = refToNode(ptr.p->masterRef);
+ signal->theData[2] = ptr.p->backupId;
+
+ if (ptr.p->dataFilePtr == RNIL)
+ {
+ sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, signal_length, JBB);
+ return;
+ }
+
+ BackupFilePtr dataFilePtr LINT_SET_PTR;
+ ptr.p->files.getPtr(dataFilePtr, ptr.p->dataFilePtr);
+ signal->theData[3] = (Uint32)(dataFilePtr.p->operation.m_records_total & 0xFFFFFFFF);
+ signal->theData[4] = (Uint32)(dataFilePtr.p->operation.m_records_total >> 32);
+ signal->theData[5] = (Uint32)(dataFilePtr.p->operation.m_bytes_total & 0xFFFFFFFF);
+ signal->theData[6] = (Uint32)(dataFilePtr.p->operation.m_bytes_total >> 32);
+ sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, signal_length, JBB);
+}
+
+void
Backup::execDEFINE_BACKUP_REQ(Signal* signal)
{
jamEntry();
@@ -4167,12 +4217,14 @@
ScanFragNextReq::SignalLength, JBB);
/*
- check if it is time to report backup status
+ check if it is time to report backup or LCP status
*/
BackupRecordPtr ptr LINT_SET_PTR;
c_backupPool.getPtr(ptr, filePtr.p->backupPtr);
if (!ptr.p->is_lcp())
checkReportStatus(signal, ptr);
+ else
+ checkLCPReportStatus(signal, ptr);
}
return;
}//if
@@ -5198,6 +5250,11 @@
BackupFilePtr filePtr LINT_SET_PTR;
ptr.p->files.getPtr(filePtr, ptr.p->ctlFilePtr);
ndbrequire(filePtr.p->m_flags == 0);
+
+ if(m_lcp_report_frequency)
+ reportLCPStatus(signal, ptr);
+ filePtr.p->operation.m_bytes_total = 0;
+ filePtr.p->operation.m_records_total = 0;
if (!ptr.p->tables.isEmpty())
{
--- 1.31/storage/ndb/src/kernel/blocks/backup/Backup.hpp 2007-06-20 17:47:35 +08:00
+++ 1.32/storage/ndb/src/kernel/blocks/backup/Backup.hpp 2007-06-20 17:47:35 +08:00
@@ -289,7 +289,7 @@
Uint32 maxRecordSize;
/*
- keeps track of total written into backup file to be able to show
+ keeps track of total written into backup or LCP file to be able to show
backup status
*/
Uint64 m_records_total;
@@ -445,6 +445,8 @@
/* next time to report backup status */
Uint32 m_next_report;
+ /* next time to report LCP progress status */
+ Uint32 m_next_lcp_report;
Uint32 m_gsn;
CompoundState slaveState;
@@ -578,6 +580,7 @@
BACKUP_WORDS_PER_PAGE);
Uint32 m_backup_report_frequency;
+ Uint32 m_lcp_report_frequency;
/**
* Pools
@@ -675,6 +678,16 @@
void checkReportStatus(Signal* signal, BackupRecordPtr ptr);
/* Send backup status, invoked either periodically, or explicitly */
void reportStatus(Signal* signal, BackupRecordPtr ptr);
+
+ /*
+ For periodic LCP status reporting and explicit LCP status reporting
+ */
+ /* Init at start of LCP, timers etc... */
+ void initLCPProgressStatus(Signal* signal, BackupRecordPtr ptr);
+ /* Sheck timers for reporting at certain points */
+ void checkLCPReportStatus(Signal* signal, BackupRecordPtr ptr);
+ /* Send LCP status, invoked either periodically, or explicitly */
+ void reportLCPStatus(Signal* signal, BackupRecordPtr ptr);
void sendSTTORRY(Signal*);
void createSequence(Signal* signal);
--- 1.28/storage/ndb/src/kernel/blocks/backup/BackupInit.cpp 2007-06-20 17:47:35 +08:00
+++ 1.29/storage/ndb/src/kernel/blocks/backup/BackupInit.cpp 2007-06-20 17:47:35 +08:00
@@ -165,6 +165,10 @@
m_backup_report_frequency = 0;
ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_REPORT_FREQUENCY,
&m_backup_report_frequency);
+ m_lcp_report_frequency = 0;
+ ndb_mgm_get_int_parameter(p, CFG_DB_LCP_REPORT_FREQUENCY,
+ &m_lcp_report_frequency);
+
/*
We adjust the disk speed parameters from bytes per second to rather be
words per 100 milliseconds. We convert disk synch size from bytes per
--- 1.12/storage/ndb/include/mgmapi/ndb_logevent.h 2007-06-20 17:47:35 +08:00
+++ 1.13/storage/ndb/include/mgmapi/ndb_logevent.h 2007-06-20 17:47:35 +08:00
@@ -57,6 +57,8 @@
NDB_LE_LCPStoppedInCalcKeepGci = 8,
/** NDB_MGM_EVENT_CATEGORY_CHECKPOINT */
NDB_LE_LCPFragmentCompleted = 9,
+ /** NDB_MGM_EVENT_CATEGORY_CHECKPOINT */
+ NDB_LE_LCPProgressStatus = 68,
/** NDB_MGM_EVENT_CATEGORY_STARTUP */
NDB_LE_NDBStartStarted = 10,
@@ -188,8 +190,7 @@
NDB_LE_StartReport = 60
/* 61 (used in upcoming patch) */
- /* 62-67 used */
- /* 68 unused */
+ /* 62-68 used */
};
@@ -372,6 +373,15 @@
unsigned table_id;
unsigned fragment_id;
} LCPFragmentCompleted;
+ /** Log event specific data for for corresponding NDB_LE_LCPProgressStatus log event */
+ struct {
+ unsigned starting_node;
+ unsigned lcp_id;
+ unsigned n_records_lo;
+ unsigned n_records_hi;
+ unsigned n_bytes_lo;
+ unsigned n_bytes_hi;
+ } LCPProgressStatus;
/** Log event specific data for for corresponding NDB_LE_ log event */
struct {
unsigned acc_count;
--- 1.15/storage/ndb/src/mgmapi/ndb_logevent.cpp 2007-06-20 17:47:35 +08:00
+++ 1.16/storage/ndb/src/mgmapi/ndb_logevent.cpp 2007-06-20 17:47:35 +08:00
@@ -125,6 +125,13 @@
ROW( LocalCheckpointCompleted, "lci", 1, lci),
+ ROW( LCPProgressStatus, "starting_node", 1, starting_node),
+ ROW( LCPProgressStatus, "lcp_id", 2, lcp_id),
+ ROW( LCPProgressStatus, "n_records_lo", 3, n_records_lo),
+ ROW( LCPProgressStatus, "n_records_hi", 4, n_records_hi),
+ ROW( LCPProgressStatus, "n_bytes_lo", 5, n_bytes_lo),
+ ROW( LCPProgressStatus, "n_bytes_hi", 6, n_bytes_hi),
+
ROW( LCPStoppedInCalcKeepGci, "data", 1, data),
ROW( LCPFragmentCompleted, "node", 1, node),
| Thread |
|---|
| • bk commit into 5.1 tree (Justin.He:1.2551) | justin.he | 20 Jun |