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-03-02 14:47:16+08:00, Justin.He@stripped +1 -0
Merge dev3-240.dev.cn.tlan:/home/justin.he/mysql/mysql-5.0/bug24568-5.0-ndb-bj
into dev3-240.dev.cn.tlan:/home/justin.he/mysql/mysql-5.1/bug24568-5.1-new-ndb-bj
MERGE: 1.1810.2545.3
storage/ndb/src/mgmsrv/ConfigInfo.cpp@stripped, 2007-03-02 14:47:11+08:00,
Justin.He@stripped +0 -0
Auto merged
MERGE: 1.60.28.2
storage/ndb/src/mgmsrv/ConfigInfo.cpp@stripped, 2007-03-02 14:47:11+08:00,
Justin.He@stripped +0 -0
Merge rename: ndb/src/mgmsrv/ConfigInfo.cpp ->
storage/ndb/src/mgmsrv/ConfigInfo.cpp
# 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/bug24568-5.1-new-ndb-bj/RESYNC
--- 1.60.28.1/ndb/src/mgmsrv/ConfigInfo.cpp 2007-03-02 14:47:23 +08:00
+++ 1.100/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2007-03-02 14:47:23 +08:00
@@ -65,8 +65,7 @@
"TCP",
"SCI",
- "SHM",
- "OSE"
+ "SHM"
};
const int ConfigInfo::m_noOfSectionNames =
sizeof(m_sectionNames)/sizeof(char*);
@@ -111,12 +110,10 @@
{ "TCP", checkConnectionSupport, 0 },
{ "SHM", checkConnectionSupport, 0 },
{ "SCI", checkConnectionSupport, 0 },
- { "OSE", checkConnectionSupport, 0 },
{ "TCP", transformConnection, 0 },
{ "SHM", transformConnection, 0 },
{ "SCI", transformConnection, 0 },
- { "OSE", transformConnection, 0 },
{ DB_TOKEN, fixNodeHostname, 0 },
{ API_TOKEN, fixNodeHostname, 0 },
@@ -128,9 +125,7 @@
{ "SHM", fixNodeId, "NodeId2" },
{ "SCI", fixNodeId, "NodeId1" },
{ "SCI", fixNodeId, "NodeId2" },
- { "OSE", fixNodeId, "NodeId1" },
- { "OSE", fixNodeId, "NodeId2" },
-
+
{ "TCP", fixHostname, "HostName1" },
{ "TCP", fixHostname, "HostName2" },
{ "SHM", fixHostname, "HostName1" },
@@ -139,8 +134,6 @@
{ "SCI", fixHostname, "HostName2" },
{ "SHM", fixHostname, "HostName1" },
{ "SHM", fixHostname, "HostName2" },
- { "OSE", fixHostname, "HostName1" },
- { "OSE", fixHostname, "HostName2" },
{ "TCP", fixPortNumber, 0 }, // has to come after fixHostName
{ "SHM", fixPortNumber, 0 }, // has to come after fixHostName
@@ -164,7 +157,6 @@
{ "TCP", checkConnectionConstraints, 0 },
{ "SHM", checkConnectionConstraints, 0 },
{ "SCI", checkConnectionConstraints, 0 },
- { "OSE", checkConnectionConstraints, 0 },
{ "TCP", checkTCPConstraints, "HostName1" },
{ "TCP", checkTCPConstraints, "HostName2" },
@@ -181,8 +173,7 @@
{ "TCP", saveInConfigValues, 0 },
{ "SHM", saveInConfigValues, 0 },
- { "SCI", saveInConfigValues, 0 },
- { "OSE", saveInConfigValues, 0 }
+ { "SCI", saveInConfigValues, 0 }
};
const int ConfigInfo::m_NoOfRules = sizeof(m_SectionRules)/sizeof(SectionRule);
@@ -761,6 +752,30 @@
STR_VALUE(MAX_INT_RNIL)},
{
+ CFG_DB_DISK_PAGE_BUFFER_MEMORY,
+ "DiskPageBufferMemory",
+ DB_TOKEN,
+ "Number bytes on each "DB_TOKEN_PRINT" node allocated for disk page buffer cache",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_INT64,
+ "64M",
+ "4M",
+ "1024G" },
+
+ {
+ CFG_DB_SGA,
+ "SharedGlobalMemory",
+ DB_TOKEN,
+ "Total number bytes on each "DB_TOKEN_PRINT" node allocated for any use",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_INT64,
+ "20M",
+ "0",
+ "65536G" }, // 32k pages * 32-bit i value
+
+ {
CFG_DB_START_PARTIAL_TIMEOUT,
"StartPartialTimeout",
DB_TOKEN,
@@ -852,7 +867,7 @@
ConfigInfo::CI_USED,
false,
ConfigInfo::CI_INT,
- "8",
+ "16",
"3",
STR_VALUE(MAX_INT_RNIL) },
@@ -869,6 +884,18 @@
STR_VALUE(MAX_INT_RNIL) },
{
+ CFG_DB_INITIAL_OPEN_FILES,
+ "InitialNoOfOpenFiles",
+ DB_TOKEN,
+ "Initial number of files open per "DB_TOKEN_PRINT" node.(One thread is created per
file)",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_INT,
+ "27",
+ "20",
+ STR_VALUE(MAX_INT_RNIL) },
+
+ {
CFG_DB_TRANSACTION_CHECK_INTERVAL,
"TimeBetweenInactiveTransactionAbortCheck",
DB_TOKEN,
@@ -915,8 +942,8 @@
CFG_DB_LCP_DISC_PAGES_TUP_SR,
"NoOfDiskPagesToDiskDuringRestartTUP",
DB_TOKEN,
- "?",
- ConfigInfo::CI_USED,
+ "DiskCheckpointSpeedSr",
+ ConfigInfo::CI_DEPRICATED,
true,
ConfigInfo::CI_INT,
"40",
@@ -927,8 +954,8 @@
CFG_DB_LCP_DISC_PAGES_TUP,
"NoOfDiskPagesToDiskAfterRestartTUP",
DB_TOKEN,
- "?",
- ConfigInfo::CI_USED,
+ "DiskCheckpointSpeed",
+ ConfigInfo::CI_DEPRICATED,
true,
ConfigInfo::CI_INT,
"40",
@@ -939,8 +966,8 @@
CFG_DB_LCP_DISC_PAGES_ACC_SR,
"NoOfDiskPagesToDiskDuringRestartACC",
DB_TOKEN,
- "?",
- ConfigInfo::CI_USED,
+ "DiskCheckpointSpeedSr",
+ ConfigInfo::CI_DEPRICATED,
true,
ConfigInfo::CI_INT,
"20",
@@ -951,8 +978,8 @@
CFG_DB_LCP_DISC_PAGES_ACC,
"NoOfDiskPagesToDiskAfterRestartACC",
DB_TOKEN,
- "?",
- ConfigInfo::CI_USED,
+ "DiskCheckpointSpeed",
+ ConfigInfo::CI_DEPRICATED,
true,
ConfigInfo::CI_INT,
"20",
@@ -1155,6 +1182,42 @@
0, 0 },
{
+ CFG_DB_DISK_SYNCH_SIZE,
+ "DiskSyncSize",
+ DB_TOKEN,
+ "Data written to a file before a synch is forced",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_INT,
+ "4M",
+ "32k",
+ STR_VALUE(MAX_INT_RNIL) },
+
+ {
+ CFG_DB_CHECKPOINT_SPEED,
+ "DiskCheckpointSpeed",
+ DB_TOKEN,
+ "Bytes per second allowed to be written by checkpoint",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_INT,
+ "10M",
+ "1M",
+ STR_VALUE(MAX_INT_RNIL) },
+
+ {
+ CFG_DB_CHECKPOINT_SPEED_SR,
+ "DiskCheckpointSpeedInRestart",
+ DB_TOKEN,
+ "Bytes per second allowed to be written by checkpoint during restart",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_INT,
+ "100M",
+ "1M",
+ STR_VALUE(MAX_INT_RNIL) },
+
+ {
CFG_DB_BACKUP_MEM,
"BackupMemory",
DB_TOKEN,
@@ -1214,6 +1277,30 @@
"2K",
STR_VALUE(MAX_INT_RNIL) },
+ {
+ CFG_DB_STRING_MEMORY,
+ "StringMemory",
+ DB_TOKEN,
+ "Default size of string memory (0 -> 5% of max 1-100 -> %of max, >100 ->
actual bytes)",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_INT,
+ "0",
+ "0",
+ STR_VALUE(MAX_INT_RNIL) },
+
+ {
+ CFG_DB_MEMREPORT_FREQUENCY,
+ "MemReportFrequency",
+ DB_TOKEN,
+ "Frequency of mem reports in seconds, 0 = only when passing %-limits",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_INT,
+ "0",
+ "0",
+ STR_VALUE(MAX_INT_RNIL) },
+
/***************************************************************************
* API
***************************************************************************/
@@ -2062,150 +2149,7 @@
false,
ConfigInfo::CI_STRING,
UNDEFINED,
- 0, 0 },
-
- /****************************************************************************
- * OSE
- ***************************************************************************/
- {
- CFG_SECTION_CONNECTION,
- "OSE",
- "OSE",
- "Connection section",
- ConfigInfo::CI_USED,
- false,
- ConfigInfo::CI_SECTION,
- (const char *)CONNECTION_TYPE_OSE,
- 0, 0
- },
-
- {
- CFG_CONNECTION_HOSTNAME_1,
- "HostName1",
- "OSE",
- "Name of computer on one side of the connection",
- ConfigInfo::CI_USED,
- false,
- ConfigInfo::CI_STRING,
- UNDEFINED,
- 0, 0 },
-
- {
- CFG_CONNECTION_HOSTNAME_2,
- "HostName2",
- "OSE",
- "Name of computer on one side of the connection",
- ConfigInfo::CI_USED,
- false,
- ConfigInfo::CI_STRING,
- UNDEFINED,
- 0, 0 },
-
- {
- CFG_CONNECTION_NODE_1,
- "NodeId1",
- "OSE",
- "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of
the connection",
- ConfigInfo::CI_USED,
- false,
- ConfigInfo::CI_INT,
- MANDATORY,
- "0",
- STR_VALUE(MAX_INT_RNIL) },
-
- {
- CFG_CONNECTION_NODE_2,
- "NodeId2",
- "OSE",
- "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of
the connection",
- ConfigInfo::CI_USED,
- false,
- ConfigInfo::CI_INT,
- UNDEFINED,
- "0",
- STR_VALUE(MAX_INT_RNIL) },
-
- {
- CFG_CONNECTION_SEND_SIGNAL_ID,
- "SendSignalId",
- "OSE",
- "Sends id in each signal. Used in trace files.",
- ConfigInfo::CI_USED,
- false,
- ConfigInfo::CI_BOOL,
- "true",
- "false",
- "true" },
-
- {
- CFG_CONNECTION_CHECKSUM,
- "Checksum",
- "OSE",
- "If checksum is enabled, all signals between nodes are checked for errors",
- ConfigInfo::CI_USED,
- false,
- ConfigInfo::CI_BOOL,
- "false",
- "false",
- "true" },
-
- {
- CFG_OSE_PRIO_A_SIZE,
- "PrioASignalSize",
- "OSE",
- "Size of priority A signals (in bytes)",
- ConfigInfo::CI_USED,
- false,
- ConfigInfo::CI_INT,
- "1000",
- "0",
- STR_VALUE(MAX_INT_RNIL) },
-
- {
- CFG_OSE_PRIO_B_SIZE,
- "PrioBSignalSize",
- "OSE",
- "Size of priority B signals (in bytes)",
- ConfigInfo::CI_USED,
- false,
- ConfigInfo::CI_INT,
- "1000",
- "0",
- STR_VALUE(MAX_INT_RNIL) },
-
- {
- CFG_OSE_RECEIVE_ARRAY_SIZE,
- "ReceiveArraySize",
- "OSE",
- "Number of OSE signals checked for correct ordering (in no of OSE signals)",
- ConfigInfo::CI_USED,
- false,
- ConfigInfo::CI_INT,
- "10",
- "0",
- STR_VALUE(MAX_INT_RNIL) },
-
- {
- CFG_CONNECTION_NODE_1_SYSTEM,
- "NodeId1_System",
- "OSE",
- "System for node 1 in connection",
- ConfigInfo::CI_INTERNAL,
- false,
- ConfigInfo::CI_STRING,
- UNDEFINED,
- 0, 0 },
-
- {
- CFG_CONNECTION_NODE_2_SYSTEM,
- "NodeId2_System",
- "OSE",
- "System for node 2 in connection",
- ConfigInfo::CI_INTERNAL,
- false,
- ConfigInfo::CI_STRING,
- UNDEFINED,
- 0, 0 },
+ 0, 0 }
};
const int ConfigInfo::m_NoOfParams = sizeof(m_ParamInfo) / sizeof(ParamInfo);
@@ -2317,7 +2261,6 @@
break;
case CI_BOOL:
{
- bool tmp_bool;
require(InitConfigFileParser::convertStringToBool(param._default, default_bool));
require(p->put(param._fname, default_bool));
break;
@@ -2325,7 +2268,6 @@
case CI_INT:
case CI_INT64:
{
- Uint64 tmp_uint64;
require(InitConfigFileParser::convertStringToUint64(param._default,
default_uint64));
require(p->put(param._fname, default_uint64));
break;
@@ -2750,12 +2692,7 @@
error= 1;
#endif
}
- else if (strcasecmp("OSE",ctx.fname) == 0)
- {
-#ifndef NDB_OSE_TRANSPORTER
- error= 1;
-#endif
- }
+
if (error)
{
ctx.reportError("Binary not compiled with this connection support, "
@@ -2841,7 +2778,7 @@
Properties::Iterator it(defaults);
for(const char * name = it.first(); name != NULL; name = it.next()){
- ConfigInfo::Status st = ctx.m_info->getStatus(ctx.m_currentInfo, name);
+ (void) ctx.m_info->getStatus(ctx.m_currentInfo, name);
if(!ctx.m_currentSection->contains(name)){
switch (ctx.m_info->getType(ctx.m_currentInfo, name)){
case ConfigInfo::CI_INT:
@@ -3222,7 +3159,31 @@
} else {
ctx.m_userProperties.put("NoOfReplicas", replicas);
}
-
+
+ /**
+ * In kernel, will calculate the MaxNoOfMeataTables use the following sum:
+ * Uint32 noOfMetaTables = noOfTables + noOfOrderedIndexes +
+ * noOfUniqueHashIndexes + 2
+ * 2 is the number of the SysTables.
+ * So must check that the sum does't exceed the max value of Uint32.
+ */
+ Uint32 noOfTables = 0,
+ noOfOrderedIndexes = 0,
+ noOfUniqueHashIndexes = 0;
+ ctx.m_currentSection->get("MaxNoOfTables", &noOfTables);
+ ctx.m_currentSection->get("MaxNoOfOrderedIndexes", &noOfOrderedIndexes);
+ ctx.m_currentSection->get("MaxNoOfUniqueHashIndexes", &noOfUniqueHashIndexes);
+
+ Uint64 sum= (Uint64)noOfTables + noOfOrderedIndexes + noOfUniqueHashIndexes;
+
+ if (sum > ((Uint32)~0 - 2)) {
+ ctx.reportError("The sum of MaxNoOfTables, MaxNoOfOrderedIndexes and"
+ " MaxNoOfUniqueHashIndexes must not exceed %u - [%s]"
+ " starting at line: %d",
+ ((Uint32)~0 - 2), ctx.fname, ctx.m_sectionLineno);
+ return false;
+ }
+
return true;
}
@@ -3448,7 +3409,7 @@
if(!ctx.m_currentInfo->get(n, &info))
continue;
- Uint32 id = 0;
+ id = 0;
info->get("Id", &id);
if(id == KEY_INTERNAL)
@@ -3652,6 +3613,7 @@
Uint32 db_nodes= 0;
Uint32 replicas= 0;
Uint32 db_host_count= 0;
+ bool with_arbitration_rank= false;
ctx.m_userProperties.get(DB_TOKEN, &db_nodes);
ctx.m_userProperties.get("NoOfReplicas", &replicas);
if((db_nodes % replicas) != 0){
@@ -3687,83 +3649,90 @@
tmp->get("HostName", &host);
if (strcmp(type,DB_TOKEN) == 0)
- {
- {
- Uint32 ii;
- if (!p_db_hosts.get(host,&ii))
- db_host_count++;
- p_db_hosts.put(host,i);
- if (p_arbitrators.get(host,&ii))
- {
- arbitration_warning.appfmt(arbit_warn_fmt, ii, i, host);
- p_arbitrators.remove(host); // only one warning per db node
- }
- }
- {
- unsigned j;
- BaseString str, str2;
- str.assfmt("#group%d_",group);
- p_db_hosts.put(str.c_str(),i_group,host);
- str2.assfmt("##group%d_",group);
- p_db_hosts.put(str2.c_str(),i_group,i);
- for (j= 0; j < i_group; j++)
- {
- const char *other_host;
- p_db_hosts.get(str.c_str(),j,&other_host);
- if (strcmp(host,other_host) == 0) {
- unsigned int other_i, c= 0;
- p_db_hosts.get(str2.c_str(),j,&other_i);
- p_db_hosts.get(str.c_str(),&c);
- if (c == 0) // first warning in this node group
- node_group_warning.appfmt(" Node group %d", group);
- c|= 1 << j;
- p_db_hosts.put(str.c_str(),c);
-
- node_group_warning.appfmt(",\n db node with id %d and id %d "
- "on same host %s", other_i, i, host);
- }
- }
- i_group++;
- DBUG_ASSERT(i_group <= replicas);
- if (i_group == replicas)
- {
- unsigned c= 0;
- p_db_hosts.get(str.c_str(),&c);
- if (c+1 == (1u << (replicas-1))) // all nodes on same machine
- node_group_warning.append(".\n Host failure will "
- "cause complete cluster shutdown.");
- else if (c > 0)
- node_group_warning.append(".\n Host failure may "
- "cause complete cluster shutdown.");
- group++;
- i_group= 0;
- }
- }
+ {
+ {
+ Uint32 ii;
+ if (!p_db_hosts.get(host,&ii))
+ db_host_count++;
+ p_db_hosts.put(host,i);
+ if (p_arbitrators.get(host,&ii))
+ {
+ arbitration_warning.appfmt(arbit_warn_fmt, ii, i, host);
+ p_arbitrators.remove(host); // only one warning per db node
+ }
+ }
+ {
+ unsigned j;
+ BaseString str, str2;
+ str.assfmt("#group%d_",group);
+ p_db_hosts.put(str.c_str(),i_group,host);
+ str2.assfmt("##group%d_",group);
+ p_db_hosts.put(str2.c_str(),i_group,i);
+ for (j= 0; j < i_group; j++)
+ {
+ const char *other_host;
+ p_db_hosts.get(str.c_str(),j,&other_host);
+ if (strcmp(host,other_host) == 0) {
+ unsigned int other_i, c= 0;
+ p_db_hosts.get(str2.c_str(),j,&other_i);
+ p_db_hosts.get(str.c_str(),&c);
+ if (c == 0) // first warning in this node group
+ node_group_warning.appfmt(" Node group %d", group);
+ c|= 1 << j;
+ p_db_hosts.put(str.c_str(),c);
+ node_group_warning.appfmt(",\n db node with id %d and id %d "
+ "on same host %s", other_i, i, host);
+ }
+ }
+ i_group++;
+ DBUG_ASSERT(i_group <= replicas);
+ if (i_group == replicas)
+ {
+ unsigned c= 0;
+ p_db_hosts.get(str.c_str(),&c);
+ if (c+1 == (1u << (replicas-1))) // all nodes on same machine
+ node_group_warning.append(".\n Host failure will "
+ "cause complete cluster shutdown.");
+ else if (c > 0)
+ node_group_warning.append(".\n Host failure may "
+ "cause complete cluster shutdown.");
+ group++;
+ i_group= 0;
+ }
+ }
}
else if (strcmp(type,API_TOKEN) == 0 ||
strcmp(type,MGM_TOKEN) == 0)
- {
- Uint32 rank;
- if(tmp->get("ArbitrationRank", &rank) && rank > 0)
- {
- if(host && host[0] != 0)
- {
- Uint32 ii;
- p_arbitrators.put(host,i);
- if (p_db_hosts.get(host,&ii))
- {
- arbitration_warning.appfmt(arbit_warn_fmt, i, ii, host);
- }
- }
- else
- {
- arbitration_warning.appfmt(arbit_warn_fmt2, i);
- }
- }
+ {
+ Uint32 rank;
+ if(tmp->get("ArbitrationRank", &rank) && rank > 0)
+ {
+ with_arbitration_rank = true; //check whether MGM or API node configured with
rank >0
+ if(host && host[0] != 0)
+ {
+ Uint32 ii;
+ p_arbitrators.put(host,i);
+ if (p_db_hosts.get(host,&ii))
+ {
+ arbitration_warning.appfmt(arbit_warn_fmt, i, ii, host);
+ }
+ }
+ else
+ {
+ arbitration_warning.appfmt(arbit_warn_fmt2, i);
+ }
+ }
}
}
if (db_host_count > 1 && node_group_warning.length() > 0)
ndbout_c("Cluster configuration warning:\n%s",node_group_warning.c_str());
+ if (!with_arbitration_rank)
+ {
+ ndbout_c("Cluster configuration warning:"
+ "\n Neither %s nor %s nodes are configured with arbitrator,"
+ "\n may cause complete cluster shutdown in case of host failure.",
+ MGM_TOKEN, API_TOKEN);
+ }
if (db_host_count > 1 && arbitration_warning.length() > 0)
ndbout_c("Cluster configuration warning:%s%s",arbitration_warning.c_str(),
"\n Running arbitrator on the same host as a database node may"
| Thread |
|---|
| • bk commit into 5.1 tree (Justin.He:1.2440) | justin.he | 5 Mar |