4668 Jonas Oreland 2011-11-16
ndb - further cleanups wrt to CFG_DB_NO_REDOLOG_PARTS
modified:
storage/ndb/include/kernel/ndb_limits.h
storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
storage/ndb/src/kernel/ndbd.cpp
4667 Jonas Oreland 2011-11-14
ndb - fix bug in previous commit. Clearly separate between log-parts which a specific lqh-instance is responisble for. And the node-global log-part-count
modified:
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
=== modified file 'storage/ndb/include/kernel/ndb_limits.h'
--- a/storage/ndb/include/kernel/ndb_limits.h 2011-11-14 12:02:56 +0000
+++ b/storage/ndb/include/kernel/ndb_limits.h 2011-11-16 11:05:46 +0000
@@ -194,6 +194,7 @@
#define NDBMT_BLOCK_MASK ((1 << NDBMT_BLOCK_BITS) - 1)
#define NDBMT_BLOCK_INSTANCE_BITS 7
+#define NDB_DEFAULT_LOG_PARTS 4
#define NDB_MAX_LOG_PARTS 4
#define MAX_NDBMT_LQH_WORKERS NDB_MAX_LOG_PARTS
#define MAX_NDBMT_LQH_THREADS NDB_MAX_LOG_PARTS
=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp 2011-11-14 12:02:56 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp 2011-11-16 11:05:46 +0000
@@ -36,7 +36,9 @@ void Dblqh::initData()
clcpFileSize = ZNO_CONCURRENT_LCP;
clfoFileSize = 0;
clogFileFileSize = 0;
- clogPartFileSize = 0; // Not valid until READ_CONFIG
+
+ NdbLogPartInfo lpinfo(instance());
+ clogPartFileSize = lpinfo.partCount;
cpageRefFileSize = ZPAGE_REF_FILE_SIZE;
cscanrecFileSize = 0;
=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2011-11-14 14:38:07 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2011-11-16 11:05:46 +0000
@@ -1220,36 +1220,31 @@ void Dblqh::execREAD_CONFIG_REQ(Signal*
m_ctx.m_config.getOwnConfigIterator();
ndbrequire(p != 0);
- clogPartFileSize = 4;
- Uint32 nodeLogParts = 4;
- ndb_mgm_get_int_parameter(p, CFG_DB_NO_REDOLOG_PARTS,
- &nodeLogParts);
- globalData.ndbLogParts = nodeLogParts;
- ndbrequire(nodeLogParts <= NDB_MAX_LOG_PARTS);
- {
- NdbLogPartInfo lpinfo(instance());
- clogPartFileSize = lpinfo.partCount; // How many are this instance responsible for...
- }
-
- if (globalData.ndbMtLqhWorkers > nodeLogParts)
+ /**
+ * TODO move check of log-parts vs. ndbMtLqhWorkers to better place
+ * (Configuration.cpp ??)
+ */
+ ndbrequire(globalData.ndbLogParts <= NDB_MAX_LOG_PARTS);
+ if (globalData.ndbMtLqhWorkers > globalData.ndbLogParts)
{
char buf[255];
BaseString::snprintf(buf, sizeof(buf),
"Trying to start %d LQH workers with only %d log parts, try initial"
" node restart to be able to use more LQH workers.",
- globalData.ndbMtLqhWorkers, nodeLogParts);
+ globalData.ndbMtLqhWorkers, globalData.ndbLogParts);
progError(__LINE__, NDBD_EXIT_INVALID_CONFIG, buf);
}
- if (nodeLogParts != 4 &&
- nodeLogParts != 8 &&
- nodeLogParts != 16)
+
+ if (globalData.ndbLogParts != 4 &&
+ globalData.ndbLogParts != 8 &&
+ globalData.ndbLogParts != 16)
{
char buf[255];
BaseString::snprintf(buf, sizeof(buf),
"Trying to start with %d log parts, number of log parts can"
" only be set to 4, 8 or 16.",
- nodeLogParts);
+ globalData.ndbLogParts);
progError(__LINE__, NDBD_EXIT_INVALID_CONFIG, buf);
}
@@ -1280,7 +1275,7 @@ void Dblqh::execREAD_CONFIG_REQ(Signal*
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_LQH_TABLE, &ctabrecFileSize));
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_LQH_TC_CONNECT,
&ctcConnectrecFileSize));
- clogFileFileSize = 4 * cnoLogFiles;
+ clogFileFileSize = clogPartFileSize * cnoLogFiles;
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_LQH_SCAN, &cscanrecFileSize));
cmaxAccOps = cscanrecFileSize * MAX_PARALLEL_OP_PER_SCAN;
=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp 2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp 2011-11-16 11:05:46 +0000
@@ -275,6 +275,22 @@ Ndbfs::execREAD_CONFIG_REQ(Signal* signa
Uint32 noIdleFiles = 27;
ndb_mgm_get_int_parameter(p, CFG_DB_INITIAL_OPEN_FILES, &noIdleFiles);
+
+ {
+ /**
+ * each logpart keeps up to 3 logfiles open at any given time...
+ * (bound)
+ * make sure noIdleFiles is atleast 4 times #logparts
+ */
+ Uint32 logParts = NDB_DEFAULT_LOG_PARTS;
+ ndb_mgm_get_int_parameter(p, CFG_DB_NO_REDOLOG_PARTS, &logParts);
+ Uint32 logfiles = 4 * logParts;
+ if (noIdleFiles < logfiles)
+ {
+ noIdleFiles = logfiles;
+ }
+ }
+
// Make sure at least "noIdleFiles" files can be created
if (noIdleFiles > m_maxFiles && m_maxFiles != 0)
m_maxFiles = noIdleFiles;
=== modified file 'storage/ndb/src/kernel/ndbd.cpp'
--- a/storage/ndb/src/kernel/ndbd.cpp 2011-10-07 13:15:08 +0000
+++ b/storage/ndb/src/kernel/ndbd.cpp 2011-11-16 11:05:46 +0000
@@ -161,9 +161,13 @@ init_global_memory_manager(EmulatorData
ed.m_mem_manager->set_resource_limit(rl);
}
- Uint32 maxopen = 4 * 4; // 4 redo parts, max 4 files per part
+ Uint32 logParts = NDB_DEFAULT_LOG_PARTS;
+ ndb_mgm_get_int_parameter(p, CFG_DB_NO_REDOLOG_PARTS, &logParts);
+
+ Uint32 maxopen = logParts * 4; // 4 redo parts, max 4 files per part
Uint32 filebuffer = NDB_FILE_BUFFER_SIZE;
Uint32 filepages = (filebuffer / GLOBAL_PAGE_SIZE) * maxopen;
+ globalData.ndbLogParts = logParts;
{
/**
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.1-telco-7.0 branch (jonas.oreland:4667 to 4668) | Jonas Oreland | 16 Nov |