4316 Magnus Blåudd 2011-04-18
Bug #58758 Ndb Internal : Defaults for enum type config values not supported
- Convert the default value given as string to Uint32 before storing it
internally.
- Make Arbitration and DefaultOperationRedoProblemAction use a string
as default value instead of int as before.
- Fix DBUG crash when retrieving the internal value for ENUM as string
instead of int
modified:
storage/ndb/src/mgmsrv/ConfigInfo.cpp
4315 jonas oreland 2011-04-15
ndb - bug#59213 / bug#11766167
Add better support for nodes configured with Nodegroup=65536
(i.e added to config to later be added)
Add new config variable StartNoNodegroupTimeout(default=15s)
which determines to to wait for node wo/ nodegroup,
before treating them as if they had been added to "nowait-nodes"
E.g 1) initial start will wait this amout of time, before doing a start
Note: in an initial start, the values from config.ini is used to
determine that nodes have no nodegroup
2) system restart will wait this amout of time, before continueing
with other timeouts (such as StartPartial/StartPartitioned-timeout)
Note: in an system restart, the values read from disk is used to
determine that nodes have nodegroup (since they can have been
added to a nodegroup after initial start)
added:
storage/ndb/include/kernel/signaldata/DihRestart.hpp
modified:
storage/ndb/include/mgmapi/mgmapi_config_parameters.h
storage/ndb/src/common/debugger/EventLogger.cpp
storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
storage/ndb/src/kernel/blocks/qmgr/Qmgr.hpp
storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
storage/ndb/src/mgmsrv/ConfigInfo.cpp
=== modified file 'storage/ndb/src/mgmsrv/ConfigInfo.cpp'
--- a/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2011-04-15 13:52:53 +0000
+++ b/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2011-04-18 11:00:45 +0000
@@ -1307,7 +1307,7 @@ const ConfigInfo::ParamInfo ConfigInfo::
ConfigInfo::CI_USED,
false,
ConfigInfo::CI_ENUM,
- 0,
+ "Default", /* Default value */
(const char*)arbit_method_typelib,
0
},
@@ -2183,12 +2183,13 @@ const ConfigInfo::ParamInfo ConfigInfo::
CFG_DEFAULT_OPERATION_REDO_PROBLEM_ACTION,
"DefaultOperationRedoProblemAction",
API_TOKEN,
- "If Redo-log is having problem, should operation default (unless overridden on transaction/operation level) abort or be put on queue"
- " in a row times, transactions will be aborted",
+ "If Redo-log is having problem, should operation default "
+ "(unless overridden on transaction/operation level) abort "
+ "or be put on queue",
ConfigInfo::CI_USED,
false,
ConfigInfo::CI_ENUM,
- 0, /* default for ENUM doesnt seem to work... */
+ "abort", /* Default value */
(const char*)default_operation_redo_problem_action_typelib,
0
},
@@ -3164,11 +3165,23 @@ ConfigInfo::ConfigInfo()
entry->name != 0; entry++)
values.put(entry->name, entry->value);
require(pinfo.put("values", &values));
- // fallthrough
+
+ if(param._default == MANDATORY)
+ pinfo.put("Mandatory", (Uint32)1);
+ else if(param._default)
+ {
+ /*
+ Map default value of enum from string to int since
+ enum is stored as int internally
+ */
+ Uint32 default_value;
+ require(values.get(param._default, &default_value));
+ require(pinfo.put("Default", default_value));
+ }
+ break;
}
case CI_STRING:
- assert(param._type == CI_ENUM || // Allow fallthrough from enum
- param._min == 0); // String can't have min value
+ assert(param._min == 0); // String can't have min value
assert(param._max == 0); // String can't have max value
if(param._default == MANDATORY)
@@ -3218,7 +3231,6 @@ ConfigInfo::ConfigInfo()
{
case CI_SECTION:
break;
- case CI_ENUM:
case CI_STRING:
case CI_BITMASK:
require(p->put(param._fname, param._default));
@@ -3237,6 +3249,20 @@ ConfigInfo::ConfigInfo()
require(p->put64(param._fname, Uint64(default_uint64)));
break;
}
+ case CI_ENUM:
+ {
+ /*
+ Map default value of enum from string to int since
+ enum is stored as int internally
+ */
+ Uint32 default_value;
+ require(verify_enum(getInfo(param._section),
+ param._fname, param._default,
+ default_value));
+ require(p->put(param._fname, default_value));
+ break;
+ }
+
}
}
require(m_systemDefaults.put(param._section, p, true));
@@ -4155,6 +4181,7 @@ applyDefaultValues(InitConfigFileParser:
else
{
switch (ctx.m_info->getType(ctx.m_currentInfo, name)){
+ case ConfigInfo::CI_ENUM:
case ConfigInfo::CI_INT:
case ConfigInfo::CI_BOOL:{
Uint32 val = 0;
@@ -4169,7 +4196,6 @@ applyDefaultValues(InitConfigFileParser:
break;
}
case ConfigInfo::CI_BITMASK:
- case ConfigInfo::CI_ENUM:
case ConfigInfo::CI_STRING:{
const char * val;
require(ctx.m_currentSection->get(name, &val));
No bundle (reason: useless for push emails).| Thread |
|---|
| • bzr push into mysql-5.1-telco-7.0 branch (magnus.blaudd:4315 to 4316)Bug#58758 | Magnus Blåudd | 18 Apr |