Commit 99a371f6 authored by unknown's avatar unknown

ndb cluster config fixes, se respective files


mysql-test/ndb/ndb_config_2_node.ini:
  added new config parameter datadir
ndb/include/mgmapi/mgmapi_config_parameters.h:
  added new config parameter datadir and backup data dir
ndb/include/mgmcommon/ConfigRetriever.hpp:
  changed verify config so that it can be used by mgmt srvr
ndb/include/mgmcommon/NdbConfig.h:
  added option to set path for ndb files
ndb/src/common/mgmcommon/ConfigInfo.cpp:
  changed token names for DB, MGM and API
  added config parametsers for datadir and backup data dir
ndb/src/common/mgmcommon/ConfigRetriever.cpp:
  changed verify config so that it can be used by mgmt srvr
ndb/src/common/mgmcommon/InitConfigFileParser.cpp:
  no need anymore to make uppercase
ndb/src/common/mgmcommon/NdbConfig.c:
  bugfix+
  added method to set datadir
ndb/src/kernel/Makefile.am:
  added debug libs to ndbd
ndb/src/kernel/vm/Configuration.cpp:
  added debug libs to ndbd
ndb/src/mgmsrv/MgmtSrvr.cpp:
  added verify config to mgmt srvr
ndb/src/mgmsrv/main.cpp:
  .
parent 50c1e189
...@@ -5,15 +5,16 @@ DataMemory= CHOOSE_DataMemory ...@@ -5,15 +5,16 @@ DataMemory= CHOOSE_DataMemory
IndexMemory= CHOOSE_IndexMemory IndexMemory= CHOOSE_IndexMemory
Diskless= CHOOSE_Diskless Diskless= CHOOSE_Diskless
TimeBetweenWatchDogCheck= 30000 TimeBetweenWatchDogCheck= 30000
FileSystemPath= CHOOSE_FILESYSTEM DataDir= CHOOSE_FILESYSTEM
[ndbd] [ndbd]
HostName: CHOOSE_HOSTNAME_1 HostName= CHOOSE_HOSTNAME_1
[ndbd] [ndbd]
HostName: CHOOSE_HOSTNAME_2 HostName= CHOOSE_HOSTNAME_2
[ndb_mgmd] [ndb_mgmd]
DataDir= CHOOSE_FILESYSTEM
PortNumber= CHOOSE_PORT_MGM PortNumber= CHOOSE_PORT_MGM
[mysqld] [mysqld]
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#define CFG_NODE_BYTE_ORDER 4 #define CFG_NODE_BYTE_ORDER 4
#define CFG_NODE_HOST 5 #define CFG_NODE_HOST 5
#define CFG_NODE_SYSTEM 6 #define CFG_NODE_SYSTEM 6
#define CFG_NODE_DATADIR 7
/** /**
* DB config parameters * DB config parameters
...@@ -89,6 +90,8 @@ ...@@ -89,6 +90,8 @@
#define CFG_DB_LONG_SIGNAL_BUFFER 157 #define CFG_DB_LONG_SIGNAL_BUFFER 157
#define CFG_DB_BACKUP_DATA_PATH 158
#define CFG_NODE_ARBIT_RANK 200 #define CFG_NODE_ARBIT_RANK 200
#define CFG_NODE_ARBIT_DELAY 201 #define CFG_NODE_ARBIT_DELAY 201
......
...@@ -78,6 +78,11 @@ public: ...@@ -78,6 +78,11 @@ public:
* Get config from file * Get config from file
*/ */
struct ndb_mgm_configuration * getConfig(const char * file); struct ndb_mgm_configuration * getConfig(const char * file);
/**
* Verify config
*/
bool verifyConfig(const struct ndb_mgm_configuration *, Uint32 nodeid);
private: private:
BaseString errorString; BaseString errorString;
enum ErrorType { enum ErrorType {
...@@ -97,11 +102,6 @@ private: ...@@ -97,11 +102,6 @@ private:
Uint32 m_version; Uint32 m_version;
Uint32 m_node_type; Uint32 m_node_type;
NdbMgmHandle m_handle; NdbMgmHandle m_handle;
/**
* Verify config
*/
bool verifyConfig(const struct ndb_mgm_configuration *);
}; };
#endif #endif
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
extern "C" { extern "C" {
#endif #endif
void NdbConfig_SetPath(const char *path);
char* NdbConfig_NdbCfgName(int with_ndb_home); char* NdbConfig_NdbCfgName(int with_ndb_home);
char* NdbConfig_ErrorFileName(int node_id); char* NdbConfig_ErrorFileName(int node_id);
char* NdbConfig_ClusterLogFileName(int node_id); char* NdbConfig_ClusterLogFileName(int node_id);
......
...@@ -33,11 +33,15 @@ ...@@ -33,11 +33,15 @@
* Section names * Section names
****************************************************************************/ ****************************************************************************/
#define DB_TOKEN "NDBD"
#define MGM_TOKEN "NDB_MGMD"
#define API_TOKEN "MYSQLD"
const ConfigInfo::AliasPair const ConfigInfo::AliasPair
ConfigInfo::m_sectionNameAliases[]={ ConfigInfo::m_sectionNameAliases[]={
{"API", "MYSQLD"}, {API_TOKEN, "API"},
{"DB", "NDBD"}, {DB_TOKEN, "DB"},
{"MGM", "NDB_MGMD"}, {MGM_TOKEN, "MGM"},
{0, 0} {0, 0}
}; };
...@@ -47,9 +51,9 @@ ConfigInfo::m_sectionNames[]={ ...@@ -47,9 +51,9 @@ ConfigInfo::m_sectionNames[]={
"EXTERNAL SYSTEM", "EXTERNAL SYSTEM",
"COMPUTER", "COMPUTER",
"DB", DB_TOKEN,
"MGM", MGM_TOKEN,
"API", API_TOKEN,
"REP", "REP",
"EXTERNAL REP", "EXTERNAL REP",
...@@ -84,6 +88,8 @@ static bool fixNodeId(InitConfigFileParser::Context & ctx, const char * data); ...@@ -84,6 +88,8 @@ static bool fixNodeId(InitConfigFileParser::Context & ctx, const char * data);
static bool fixExtConnection(InitConfigFileParser::Context & ctx, const char * data); static bool fixExtConnection(InitConfigFileParser::Context & ctx, const char * data);
static bool fixDepricated(InitConfigFileParser::Context & ctx, const char *); static bool fixDepricated(InitConfigFileParser::Context & ctx, const char *);
static bool saveInConfigValues(InitConfigFileParser::Context & ctx, const char *); static bool saveInConfigValues(InitConfigFileParser::Context & ctx, const char *);
static bool fixFileSystemPath(InitConfigFileParser::Context & ctx, const char * data);
static bool fixBackupDataPath(InitConfigFileParser::Context & ctx, const char * data);
const ConfigInfo::SectionRule const ConfigInfo::SectionRule
ConfigInfo::m_SectionRules[] = { ConfigInfo::m_SectionRules[] = {
...@@ -91,9 +97,9 @@ ConfigInfo::m_SectionRules[] = { ...@@ -91,9 +97,9 @@ ConfigInfo::m_SectionRules[] = {
{ "EXTERNAL SYSTEM", transformExternalSystem, 0 }, { "EXTERNAL SYSTEM", transformExternalSystem, 0 },
{ "COMPUTER", transformComputer, 0 }, { "COMPUTER", transformComputer, 0 },
{ "DB", transformNode, 0 }, { DB_TOKEN, transformNode, 0 },
{ "API", transformNode, 0 }, { API_TOKEN, transformNode, 0 },
{ "MGM", transformNode, 0 }, { MGM_TOKEN, transformNode, 0 },
{ "REP", transformNode, 0 }, { "REP", transformNode, 0 },
{ "EXTERNAL REP", transformExtNode, 0 }, { "EXTERNAL REP", transformExtNode, 0 },
...@@ -102,9 +108,9 @@ ConfigInfo::m_SectionRules[] = { ...@@ -102,9 +108,9 @@ ConfigInfo::m_SectionRules[] = {
{ "SCI", transformConnection, 0 }, { "SCI", transformConnection, 0 },
{ "OSE", transformConnection, 0 }, { "OSE", transformConnection, 0 },
{ "DB", fixNodeHostname, 0 }, { DB_TOKEN, fixNodeHostname, 0 },
{ "API", fixNodeHostname, 0 }, { API_TOKEN, fixNodeHostname, 0 },
{ "MGM", fixNodeHostname, 0 }, { MGM_TOKEN, fixNodeHostname, 0 },
{ "REP", fixNodeHostname, 0 }, { "REP", fixNodeHostname, 0 },
//{ "EXTERNAL REP", fixNodeHostname, 0 }, //{ "EXTERNAL REP", fixNodeHostname, 0 },
...@@ -138,7 +144,10 @@ ConfigInfo::m_SectionRules[] = { ...@@ -138,7 +144,10 @@ ConfigInfo::m_SectionRules[] = {
{ "*", fixDepricated, 0 }, { "*", fixDepricated, 0 },
{ "*", applyDefaultValues, "system" }, { "*", applyDefaultValues, "system" },
{ "DB", checkDbConstraints, 0 }, { DB_TOKEN, fixFileSystemPath, 0 },
{ DB_TOKEN, fixBackupDataPath, 0 },
{ DB_TOKEN, checkDbConstraints, 0 },
/** /**
* checkConnectionConstraints must be after fixExtConnection * checkConnectionConstraints must be after fixExtConnection
...@@ -153,9 +162,9 @@ ConfigInfo::m_SectionRules[] = { ...@@ -153,9 +162,9 @@ ConfigInfo::m_SectionRules[] = {
{ "*", checkMandatory, 0 }, { "*", checkMandatory, 0 },
{ "DB", saveInConfigValues, 0 }, { DB_TOKEN, saveInConfigValues, 0 },
{ "API", saveInConfigValues, 0 }, { API_TOKEN, saveInConfigValues, 0 },
{ "MGM", saveInConfigValues, 0 }, { MGM_TOKEN, saveInConfigValues, 0 },
{ "REP", saveInConfigValues, 0 }, { "REP", saveInConfigValues, 0 },
{ "TCP", saveInConfigValues, 0 }, { "TCP", saveInConfigValues, 0 },
...@@ -196,7 +205,7 @@ struct DepricationTransform { ...@@ -196,7 +205,7 @@ struct DepricationTransform {
static static
const DepricationTransform f_deprication[] = { const DepricationTransform f_deprication[] = {
{ "DB", "Discless", "Diskless", 0, 1 }, { DB_TOKEN, "Discless", "Diskless", 0, 1 },
{ 0, 0, 0, 0, 0} { 0, 0, 0, 0, 0}
}; };
...@@ -302,7 +311,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -302,7 +311,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
CFG_SYS_PRIMARY_MGM_NODE, CFG_SYS_PRIMARY_MGM_NODE,
"PrimaryMGMNode", "PrimaryMGMNode",
"SYSTEM", "SYSTEM",
"Node id of Primary MGM node", "Node id of Primary "MGM_TOKEN" node",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::INT, ConfigInfo::INT,
...@@ -327,8 +336,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -327,8 +336,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
***************************************************************************/ ***************************************************************************/
{ {
CFG_SECTION_NODE, CFG_SECTION_NODE,
"DB", DB_TOKEN,
"DB", DB_TOKEN,
"Node section", "Node section",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -340,7 +349,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -340,7 +349,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_NODE_HOST, CFG_NODE_HOST,
"HostName", "HostName",
"DB", DB_TOKEN,
"Name of computer for this node", "Name of computer for this node",
ConfigInfo::INTERNAL, ConfigInfo::INTERNAL,
false, false,
...@@ -351,7 +360,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -351,7 +360,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_NODE_SYSTEM, CFG_NODE_SYSTEM,
"System", "System",
"DB", DB_TOKEN,
"Name of system for this node", "Name of system for this node",
ConfigInfo::INTERNAL, ConfigInfo::INTERNAL,
false, false,
...@@ -362,8 +371,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -362,8 +371,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_NODE_ID, CFG_NODE_ID,
"Id", "Id",
"DB", DB_TOKEN,
"Number identifying the database node (DB)", "Number identifying the database node ("DB_TOKEN")",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::INT, ConfigInfo::INT,
...@@ -374,7 +383,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -374,7 +383,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
KEY_INTERNAL, KEY_INTERNAL,
"ServerPort", "ServerPort",
"DB", DB_TOKEN,
"Port used to setup transporter", "Port used to setup transporter",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -386,7 +395,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -386,7 +395,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_NO_REPLICAS, CFG_DB_NO_REPLICAS,
"NoOfReplicas", "NoOfReplicas",
"DB", DB_TOKEN,
"Number of copies of all data in the database (1-4)", "Number of copies of all data in the database (1-4)",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -398,7 +407,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -398,7 +407,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_NO_ATTRIBUTES, CFG_DB_NO_ATTRIBUTES,
"MaxNoOfAttributes", "MaxNoOfAttributes",
"DB", DB_TOKEN,
"Total number of attributes stored in database. I.e. sum over all tables", "Total number of attributes stored in database. I.e. sum over all tables",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -410,7 +419,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -410,7 +419,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_NO_TABLES, CFG_DB_NO_TABLES,
"MaxNoOfTables", "MaxNoOfTables",
"DB", DB_TOKEN,
"Total number of tables stored in the database", "Total number of tables stored in the database",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -422,7 +431,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -422,7 +431,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_NO_ORDERED_INDEXES, CFG_DB_NO_ORDERED_INDEXES,
"MaxNoOfOrderedIndexes", "MaxNoOfOrderedIndexes",
"DB", DB_TOKEN,
"Total number of ordered indexes that can be defined in the system", "Total number of ordered indexes that can be defined in the system",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -434,7 +443,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -434,7 +443,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_NO_UNIQUE_HASH_INDEXES, CFG_DB_NO_UNIQUE_HASH_INDEXES,
"MaxNoOfUniqueHashIndexes", "MaxNoOfUniqueHashIndexes",
"DB", DB_TOKEN,
"Total number of unique hash indexes that can be defined in the system", "Total number of unique hash indexes that can be defined in the system",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -446,7 +455,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -446,7 +455,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_NO_INDEXES, CFG_DB_NO_INDEXES,
"MaxNoOfIndexes", "MaxNoOfIndexes",
"DB", DB_TOKEN,
"Total number of indexes that can be defined in the system", "Total number of indexes that can be defined in the system",
ConfigInfo::DEPRICATED, ConfigInfo::DEPRICATED,
false, false,
...@@ -458,8 +467,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -458,8 +467,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_NO_INDEX_OPS, CFG_DB_NO_INDEX_OPS,
"MaxNoOfConcurrentIndexOperations", "MaxNoOfConcurrentIndexOperations",
"DB", DB_TOKEN,
"Total number of index operations that can execute simultaneously on one DB node", "Total number of index operations that can execute simultaneously on one "DB_TOKEN" node",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::INT, ConfigInfo::INT,
...@@ -471,7 +480,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -471,7 +480,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_NO_TRIGGERS, CFG_DB_NO_TRIGGERS,
"MaxNoOfTriggers", "MaxNoOfTriggers",
"DB", DB_TOKEN,
"Total number of triggers that can be defined in the system", "Total number of triggers that can be defined in the system",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -483,8 +492,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -483,8 +492,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_NO_TRIGGER_OPS, CFG_DB_NO_TRIGGER_OPS,
"MaxNoOfFiredTriggers", "MaxNoOfFiredTriggers",
"DB", DB_TOKEN,
"Total number of triggers that can fire simultaneously in one DB node", "Total number of triggers that can fire simultaneously in one "DB_TOKEN" node",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::INT, ConfigInfo::INT,
...@@ -495,7 +504,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -495,7 +504,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
KEY_INTERNAL, KEY_INTERNAL,
"ExecuteOnComputer", "ExecuteOnComputer",
"DB", DB_TOKEN,
"String referencing an earlier defined COMPUTER", "String referencing an earlier defined COMPUTER",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -506,7 +515,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -506,7 +515,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_NO_SAVE_MSGS, CFG_DB_NO_SAVE_MSGS,
"MaxNoOfSavedMessages", "MaxNoOfSavedMessages",
"DB", DB_TOKEN,
"Max number of error messages in error log and max number of trace files", "Max number of error messages in error log and max number of trace files",
ConfigInfo::USED, ConfigInfo::USED,
true, true,
...@@ -518,7 +527,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -518,7 +527,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_MEMLOCK, CFG_DB_MEMLOCK,
"LockPagesInMainMemory", "LockPagesInMainMemory",
"DB", DB_TOKEN,
"If set to yes, then NDB Cluster data will not be swapped out to disk", "If set to yes, then NDB Cluster data will not be swapped out to disk",
ConfigInfo::USED, ConfigInfo::USED,
true, true,
...@@ -530,7 +539,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -530,7 +539,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_WATCHDOG_INTERVAL, CFG_DB_WATCHDOG_INTERVAL,
"TimeBetweenWatchDogCheck", "TimeBetweenWatchDogCheck",
"DB", DB_TOKEN,
"Time between execution checks inside a database node", "Time between execution checks inside a database node",
ConfigInfo::USED, ConfigInfo::USED,
true, true,
...@@ -542,8 +551,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -542,8 +551,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_STOP_ON_ERROR, CFG_DB_STOP_ON_ERROR,
"StopOnError", "StopOnError",
"DB", DB_TOKEN,
"If set to N, the DB automatically restarts/recovers in case of node failure", "If set to N, "DB_TOKEN" automatically restarts/recovers in case of node failure",
ConfigInfo::USED, ConfigInfo::USED,
true, true,
ConfigInfo::BOOL, ConfigInfo::BOOL,
...@@ -554,7 +563,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -554,7 +563,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_STOP_ON_ERROR_INSERT, CFG_DB_STOP_ON_ERROR_INSERT,
"RestartOnErrorInsert", "RestartOnErrorInsert",
"DB", DB_TOKEN,
"See src/kernel/vm/Emulator.hpp NdbRestartType for details", "See src/kernel/vm/Emulator.hpp NdbRestartType for details",
ConfigInfo::INTERNAL, ConfigInfo::INTERNAL,
true, true,
...@@ -566,7 +575,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -566,7 +575,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_NO_OPS, CFG_DB_NO_OPS,
"MaxNoOfConcurrentOperations", "MaxNoOfConcurrentOperations",
"DB", DB_TOKEN,
"Max number of operation records in transaction coordinator", "Max number of operation records in transaction coordinator",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -578,7 +587,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -578,7 +587,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_NO_LOCAL_OPS, CFG_DB_NO_LOCAL_OPS,
"MaxNoOfLocalOperations", "MaxNoOfLocalOperations",
"DB", DB_TOKEN,
"Max number of operation records defined in the local storage node", "Max number of operation records defined in the local storage node",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -590,7 +599,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -590,7 +599,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_NO_LOCAL_SCANS, CFG_DB_NO_LOCAL_SCANS,
"MaxNoOfLocalScans", "MaxNoOfLocalScans",
"DB", DB_TOKEN,
"Max number of fragment scans in parallel in the local storage node", "Max number of fragment scans in parallel in the local storage node",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -602,7 +611,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -602,7 +611,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_BATCH_SIZE, CFG_DB_BATCH_SIZE,
"BatchSizePerLocalScan", "BatchSizePerLocalScan",
"DB", DB_TOKEN,
"Used to calculate the number of lock records for scan with hold lock", "Used to calculate the number of lock records for scan with hold lock",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -614,8 +623,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -614,8 +623,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_NO_TRANSACTIONS, CFG_DB_NO_TRANSACTIONS,
"MaxNoOfConcurrentTransactions", "MaxNoOfConcurrentTransactions",
"DB", DB_TOKEN,
"Max number of transaction executing concurrently on the DB node", "Max number of transaction executing concurrently on the "DB_TOKEN" node",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::INT, ConfigInfo::INT,
...@@ -626,8 +635,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -626,8 +635,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_NO_SCANS, CFG_DB_NO_SCANS,
"MaxNoOfConcurrentScans", "MaxNoOfConcurrentScans",
"DB", DB_TOKEN,
"Max number of scans executing concurrently on the DB node", "Max number of scans executing concurrently on the "DB_TOKEN" node",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::INT, ConfigInfo::INT,
...@@ -638,8 +647,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -638,8 +647,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_TRANS_BUFFER_MEM, CFG_DB_TRANS_BUFFER_MEM,
"TransactionBufferMemory", "TransactionBufferMemory",
"DB", DB_TOKEN,
"Dynamic buffer space (in bytes) for key and attribute data allocated for each DB node", "Dynamic buffer space (in bytes) for key and attribute data allocated for each "DB_TOKEN" node",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::INT, ConfigInfo::INT,
...@@ -650,8 +659,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -650,8 +659,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_INDEX_MEM, CFG_DB_INDEX_MEM,
"IndexMemory", "IndexMemory",
"DB", DB_TOKEN,
"Number bytes on each DB node allocated for storing indexes", "Number bytes on each "DB_TOKEN" node allocated for storing indexes",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::INT64, ConfigInfo::INT64,
...@@ -662,8 +671,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -662,8 +671,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_DATA_MEM, CFG_DB_DATA_MEM,
"DataMemory", "DataMemory",
"DB", DB_TOKEN,
"Number bytes on each DB node allocated for storing data", "Number bytes on each "DB_TOKEN" node allocated for storing data",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::INT64, ConfigInfo::INT64,
...@@ -674,8 +683,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -674,8 +683,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_UNDO_INDEX_BUFFER, CFG_DB_UNDO_INDEX_BUFFER,
"UndoIndexBuffer", "UndoIndexBuffer",
"DB", DB_TOKEN,
"Number bytes on each DB node allocated for writing UNDO logs for index part", "Number bytes on each "DB_TOKEN" node allocated for writing UNDO logs for index part",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::INT, ConfigInfo::INT,
...@@ -686,8 +695,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -686,8 +695,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_UNDO_DATA_BUFFER, CFG_DB_UNDO_DATA_BUFFER,
"UndoDataBuffer", "UndoDataBuffer",
"DB", DB_TOKEN,
"Number bytes on each DB node allocated for writing UNDO logs for data part", "Number bytes on each "DB_TOKEN" node allocated for writing UNDO logs for data part",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::INT, ConfigInfo::INT,
...@@ -698,8 +707,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -698,8 +707,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_REDO_BUFFER, CFG_DB_REDO_BUFFER,
"RedoBuffer", "RedoBuffer",
"DB", DB_TOKEN,
"Number bytes on each DB node allocated for writing REDO logs", "Number bytes on each "DB_TOKEN" node allocated for writing REDO logs",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::INT, ConfigInfo::INT,
...@@ -710,8 +719,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -710,8 +719,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_LONG_SIGNAL_BUFFER, CFG_DB_LONG_SIGNAL_BUFFER,
"LongMessageBuffer", "LongMessageBuffer",
"DB", DB_TOKEN,
"Number bytes on each DB node allocated for internal long messages", "Number bytes on each "DB_TOKEN" node allocated for internal long messages",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::INT, ConfigInfo::INT,
...@@ -722,7 +731,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -722,7 +731,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_START_PARTIAL_TIMEOUT, CFG_DB_START_PARTIAL_TIMEOUT,
"StartPartialTimeout", "StartPartialTimeout",
"DB", DB_TOKEN,
"Time to wait before trying to start wo/ all nodes. 0=Wait forever", "Time to wait before trying to start wo/ all nodes. 0=Wait forever",
ConfigInfo::USED, ConfigInfo::USED,
true, true,
...@@ -734,7 +743,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -734,7 +743,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_START_PARTITION_TIMEOUT, CFG_DB_START_PARTITION_TIMEOUT,
"StartPartitionedTimeout", "StartPartitionedTimeout",
"DB", DB_TOKEN,
"Time to wait before trying to start partitioned. 0=Wait forever", "Time to wait before trying to start partitioned. 0=Wait forever",
ConfigInfo::USED, ConfigInfo::USED,
true, true,
...@@ -746,7 +755,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -746,7 +755,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_START_FAILURE_TIMEOUT, CFG_DB_START_FAILURE_TIMEOUT,
"StartFailureTimeout", "StartFailureTimeout",
"DB", DB_TOKEN,
"Time to wait before terminating. 0=Wait forever", "Time to wait before terminating. 0=Wait forever",
ConfigInfo::USED, ConfigInfo::USED,
true, true,
...@@ -758,8 +767,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -758,8 +767,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_HEARTBEAT_INTERVAL, CFG_DB_HEARTBEAT_INTERVAL,
"HeartbeatIntervalDbDb", "HeartbeatIntervalDbDb",
"DB", DB_TOKEN,
"Time between DB-DB heartbeats. DB considered dead after 3 missed HBs", "Time between "DB_TOKEN"-"DB_TOKEN" heartbeats. "DB_TOKEN" considered dead after 3 missed HBs",
ConfigInfo::USED, ConfigInfo::USED,
true, true,
ConfigInfo::INT, ConfigInfo::INT,
...@@ -770,8 +779,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -770,8 +779,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_API_HEARTBEAT_INTERVAL, CFG_DB_API_HEARTBEAT_INTERVAL,
"HeartbeatIntervalDbApi", "HeartbeatIntervalDbApi",
"DB", DB_TOKEN,
"Time between API-DB heartbeats. API connection closed after 3 missed HBs", "Time between "API_TOKEN"-"DB_TOKEN" heartbeats. "API_TOKEN" connection closed after 3 missed HBs",
ConfigInfo::USED, ConfigInfo::USED,
true, true,
ConfigInfo::INT, ConfigInfo::INT,
...@@ -782,7 +791,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -782,7 +791,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_LCP_INTERVAL, CFG_DB_LCP_INTERVAL,
"TimeBetweenLocalCheckpoints", "TimeBetweenLocalCheckpoints",
"DB", DB_TOKEN,
"Time between taking snapshots of the database (expressed in 2log of bytes)", "Time between taking snapshots of the database (expressed in 2log of bytes)",
ConfigInfo::USED, ConfigInfo::USED,
true, true,
...@@ -794,7 +803,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -794,7 +803,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_GCP_INTERVAL, CFG_DB_GCP_INTERVAL,
"TimeBetweenGlobalCheckpoints", "TimeBetweenGlobalCheckpoints",
"DB", DB_TOKEN,
"Time between doing group commit of transactions to disk", "Time between doing group commit of transactions to disk",
ConfigInfo::USED, ConfigInfo::USED,
true, true,
...@@ -806,8 +815,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -806,8 +815,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_NO_REDOLOG_FILES, CFG_DB_NO_REDOLOG_FILES,
"NoOfFragmentLogFiles", "NoOfFragmentLogFiles",
"DB", DB_TOKEN,
"No of 16 Mbyte Redo log files in each of 4 file sets belonging to DB node", "No of 16 Mbyte Redo log files in each of 4 file sets belonging to "DB_TOKEN" node",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::INT, ConfigInfo::INT,
...@@ -818,8 +827,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -818,8 +827,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
KEY_INTERNAL, KEY_INTERNAL,
"MaxNoOfOpenFiles", "MaxNoOfOpenFiles",
"DB", DB_TOKEN,
"Max number of files open per DB node.(One thread is created per file)", "Max number of files open per "DB_TOKEN" node.(One thread is created per file)",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::INT, ConfigInfo::INT,
...@@ -831,7 +840,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -831,7 +840,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_TRANSACTION_CHECK_INTERVAL, CFG_DB_TRANSACTION_CHECK_INTERVAL,
"TimeBetweenInactiveTransactionAbortCheck", "TimeBetweenInactiveTransactionAbortCheck",
"DB", DB_TOKEN,
"Time between inactive transaction checks", "Time between inactive transaction checks",
ConfigInfo::USED, ConfigInfo::USED,
true, true,
...@@ -843,7 +852,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -843,7 +852,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_TRANSACTION_INACTIVE_TIMEOUT, CFG_DB_TRANSACTION_INACTIVE_TIMEOUT,
"TransactionInactiveTimeout", "TransactionInactiveTimeout",
"DB", DB_TOKEN,
"Time application can wait before executing another transaction part (ms).\n" "Time application can wait before executing another transaction part (ms).\n"
"This is the time the transaction coordinator waits for the application\n" "This is the time the transaction coordinator waits for the application\n"
"to execute or send another part (query, statement) of the transaction.\n" "to execute or send another part (query, statement) of the transaction.\n"
...@@ -859,7 +868,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -859,7 +868,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_TRANSACTION_DEADLOCK_TIMEOUT, CFG_DB_TRANSACTION_DEADLOCK_TIMEOUT,
"TransactionDeadlockDetectionTimeout", "TransactionDeadlockDetectionTimeout",
"DB", DB_TOKEN,
"Time transaction can be executing in a DB node (ms).\n" "Time transaction can be executing in a DB node (ms).\n"
"This is the time the transaction coordinator waits for each database node\n" "This is the time the transaction coordinator waits for each database node\n"
"of the transaction to execute a request. If the database node takes too\n" "of the transaction to execute a request. If the database node takes too\n"
...@@ -874,7 +883,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -874,7 +883,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
KEY_INTERNAL, KEY_INTERNAL,
"NoOfDiskPagesToDiskDuringRestartTUP", "NoOfDiskPagesToDiskDuringRestartTUP",
"DB", DB_TOKEN,
"?", "?",
ConfigInfo::USED, ConfigInfo::USED,
true, true,
...@@ -886,7 +895,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -886,7 +895,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
KEY_INTERNAL, KEY_INTERNAL,
"NoOfDiskPagesToDiskAfterRestartTUP", "NoOfDiskPagesToDiskAfterRestartTUP",
"DB", DB_TOKEN,
"?", "?",
ConfigInfo::USED, ConfigInfo::USED,
true, true,
...@@ -898,7 +907,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -898,7 +907,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
KEY_INTERNAL, KEY_INTERNAL,
"NoOfDiskPagesToDiskDuringRestartACC", "NoOfDiskPagesToDiskDuringRestartACC",
"DB", DB_TOKEN,
"?", "?",
ConfigInfo::USED, ConfigInfo::USED,
true, true,
...@@ -910,7 +919,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -910,7 +919,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
KEY_INTERNAL, KEY_INTERNAL,
"NoOfDiskPagesToDiskAfterRestartACC", "NoOfDiskPagesToDiskAfterRestartACC",
"DB", DB_TOKEN,
"?", "?",
ConfigInfo::USED, ConfigInfo::USED,
true, true,
...@@ -923,7 +932,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -923,7 +932,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_DISCLESS, CFG_DB_DISCLESS,
"Diskless", "Diskless",
"DB", DB_TOKEN,
"Run wo/ disk", "Run wo/ disk",
ConfigInfo::USED, ConfigInfo::USED,
true, true,
...@@ -935,7 +944,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -935,7 +944,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
KEY_INTERNAL, KEY_INTERNAL,
"Discless", "Discless",
"DB", DB_TOKEN,
"Diskless", "Diskless",
ConfigInfo::DEPRICATED, ConfigInfo::DEPRICATED,
true, true,
...@@ -949,7 +958,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -949,7 +958,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_ARBIT_TIMEOUT, CFG_DB_ARBIT_TIMEOUT,
"ArbitrationTimeout", "ArbitrationTimeout",
"DB", DB_TOKEN,
"Max time (milliseconds) database partion waits for arbitration signal", "Max time (milliseconds) database partion waits for arbitration signal",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -958,21 +967,32 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -958,21 +967,32 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"10", "10",
MAX_INT_RNIL_STRING }, MAX_INT_RNIL_STRING },
{
CFG_NODE_DATADIR,
"DataDir",
DB_TOKEN,
"Data directory for this node",
ConfigInfo::USED,
false,
ConfigInfo::STRING,
DATADIR,
0, 0 },
{ {
CFG_DB_FILESYSTEM_PATH, CFG_DB_FILESYSTEM_PATH,
"FileSystemPath", "FileSystemPath",
"DB", DB_TOKEN,
"Path to directory where the DB node stores its data (directory must exist)", "Path to directory where the "DB_TOKEN" node stores its data (directory must exist)",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::STRING, ConfigInfo::STRING,
DATADIR, UNDEFINED,
0, 0 }, 0, 0 },
{ {
CFG_LOGLEVEL_STARTUP, CFG_LOGLEVEL_STARTUP,
"LogLevelStartup", "LogLevelStartup",
"DB", DB_TOKEN,
"Node startup info printed on stdout", "Node startup info printed on stdout",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -984,7 +1004,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -984,7 +1004,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_LOGLEVEL_SHUTDOWN, CFG_LOGLEVEL_SHUTDOWN,
"LogLevelShutdown", "LogLevelShutdown",
"DB", DB_TOKEN,
"Node shutdown info printed on stdout", "Node shutdown info printed on stdout",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -996,7 +1016,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -996,7 +1016,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_LOGLEVEL_STATISTICS, CFG_LOGLEVEL_STATISTICS,
"LogLevelStatistic", "LogLevelStatistic",
"DB", DB_TOKEN,
"Transaction, operation, transporter info printed on stdout", "Transaction, operation, transporter info printed on stdout",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -1008,7 +1028,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1008,7 +1028,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_LOGLEVEL_CHECKPOINT, CFG_LOGLEVEL_CHECKPOINT,
"LogLevelCheckpoint", "LogLevelCheckpoint",
"DB", DB_TOKEN,
"Local and Global checkpoint info printed on stdout", "Local and Global checkpoint info printed on stdout",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -1020,7 +1040,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1020,7 +1040,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_LOGLEVEL_NODERESTART, CFG_LOGLEVEL_NODERESTART,
"LogLevelNodeRestart", "LogLevelNodeRestart",
"DB", DB_TOKEN,
"Node restart, node failure info printed on stdout", "Node restart, node failure info printed on stdout",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -1032,7 +1052,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1032,7 +1052,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_LOGLEVEL_CONNECTION, CFG_LOGLEVEL_CONNECTION,
"LogLevelConnection", "LogLevelConnection",
"DB", DB_TOKEN,
"Node connect/disconnect info printed on stdout", "Node connect/disconnect info printed on stdout",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -1044,7 +1064,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1044,7 +1064,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_LOGLEVEL_ERROR, CFG_LOGLEVEL_ERROR,
"LogLevelError", "LogLevelError",
"DB", DB_TOKEN,
"Transporter, heartbeat errors printed on stdout", "Transporter, heartbeat errors printed on stdout",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -1056,7 +1076,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1056,7 +1076,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_LOGLEVEL_INFO, CFG_LOGLEVEL_INFO,
"LogLevelInfo", "LogLevelInfo",
"DB", DB_TOKEN,
"Heartbeat and log info printed on stdout", "Heartbeat and log info printed on stdout",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -1071,7 +1091,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1071,7 +1091,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_PARALLEL_BACKUPS, CFG_DB_PARALLEL_BACKUPS,
"ParallelBackups", "ParallelBackups",
"DB", DB_TOKEN,
"Maximum number of parallel backups", "Maximum number of parallel backups",
ConfigInfo::NOTIMPLEMENTED, ConfigInfo::NOTIMPLEMENTED,
false, false,
...@@ -1080,10 +1100,21 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1080,10 +1100,21 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"1", "1",
"1" }, "1" },
{
CFG_DB_BACKUP_DATA_PATH,
"BackupDataPath",
DB_TOKEN,
"Path to where to store backups",
ConfigInfo::USED,
false,
ConfigInfo::STRING,
UNDEFINED,
0, 0 },
{ {
CFG_DB_BACKUP_MEM, CFG_DB_BACKUP_MEM,
"BackupMemory", "BackupMemory",
"DB", DB_TOKEN,
"Total memory allocated for backups per node (in bytes)", "Total memory allocated for backups per node (in bytes)",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -1095,7 +1126,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1095,7 +1126,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_BACKUP_DATA_BUFFER_MEM, CFG_DB_BACKUP_DATA_BUFFER_MEM,
"BackupDataBufferSize", "BackupDataBufferSize",
"DB", DB_TOKEN,
"Default size of databuffer for a backup (in bytes)", "Default size of databuffer for a backup (in bytes)",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -1107,7 +1138,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1107,7 +1138,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_BACKUP_LOG_BUFFER_MEM, CFG_DB_BACKUP_LOG_BUFFER_MEM,
"BackupLogBufferSize", "BackupLogBufferSize",
"DB", DB_TOKEN,
"Default size of logbuffer for a backup (in bytes)", "Default size of logbuffer for a backup (in bytes)",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -1119,7 +1150,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1119,7 +1150,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_DB_BACKUP_WRITE_SIZE, CFG_DB_BACKUP_WRITE_SIZE,
"BackupWriteSize", "BackupWriteSize",
"DB", DB_TOKEN,
"Default size of filesystem writes made by backup (in bytes)", "Default size of filesystem writes made by backup (in bytes)",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -1205,8 +1236,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1205,8 +1236,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
***************************************************************************/ ***************************************************************************/
{ {
CFG_SECTION_NODE, CFG_SECTION_NODE,
"API", API_TOKEN,
"API", API_TOKEN,
"Node section", "Node section",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -1218,7 +1249,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1218,7 +1249,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_NODE_HOST, CFG_NODE_HOST,
"HostName", "HostName",
"API", API_TOKEN,
"Name of computer for this node", "Name of computer for this node",
ConfigInfo::INTERNAL, ConfigInfo::INTERNAL,
false, false,
...@@ -1229,7 +1260,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1229,7 +1260,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_NODE_SYSTEM, CFG_NODE_SYSTEM,
"System", "System",
"API", API_TOKEN,
"Name of system for this node", "Name of system for this node",
ConfigInfo::INTERNAL, ConfigInfo::INTERNAL,
false, false,
...@@ -1240,8 +1271,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1240,8 +1271,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_NODE_ID, CFG_NODE_ID,
"Id", "Id",
"API", API_TOKEN,
"Number identifying application node (API)", "Number identifying application node ("API_TOKEN")",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::INT, ConfigInfo::INT,
...@@ -1252,7 +1283,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1252,7 +1283,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
KEY_INTERNAL, KEY_INTERNAL,
"ExecuteOnComputer", "ExecuteOnComputer",
"API", API_TOKEN,
"String referencing an earlier defined COMPUTER", "String referencing an earlier defined COMPUTER",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -1263,8 +1294,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1263,8 +1294,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_NODE_ARBIT_RANK, CFG_NODE_ARBIT_RANK,
"ArbitrationRank", "ArbitrationRank",
"API", API_TOKEN,
"If 0, then API is not arbitrator. Kernel selects arbitrators in order 1, 2", "If 0, then "API_TOKEN" is not arbitrator. Kernel selects arbitrators in order 1, 2",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::INT, ConfigInfo::INT,
...@@ -1275,7 +1306,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1275,7 +1306,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_NODE_ARBIT_DELAY, CFG_NODE_ARBIT_DELAY,
"ArbitrationDelay", "ArbitrationDelay",
"API", API_TOKEN,
"When asked to arbitrate, arbitrator waits this long before voting (msec)", "When asked to arbitrate, arbitrator waits this long before voting (msec)",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -1289,8 +1320,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1289,8 +1320,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
***************************************************************************/ ***************************************************************************/
{ {
CFG_SECTION_NODE, CFG_SECTION_NODE,
"MGM", MGM_TOKEN,
"MGM", MGM_TOKEN,
"Node section", "Node section",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -1302,7 +1333,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1302,7 +1333,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_NODE_HOST, CFG_NODE_HOST,
"HostName", "HostName",
"MGM", MGM_TOKEN,
"Name of computer for this node", "Name of computer for this node",
ConfigInfo::INTERNAL, ConfigInfo::INTERNAL,
false, false,
...@@ -1310,10 +1341,21 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1310,10 +1341,21 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
UNDEFINED, UNDEFINED,
0, 0 }, 0, 0 },
{
CFG_NODE_DATADIR,
"DataDir",
MGM_TOKEN,
"Data directory for this node",
ConfigInfo::USED,
false,
ConfigInfo::STRING,
DATADIR,
0, 0 },
{ {
CFG_NODE_SYSTEM, CFG_NODE_SYSTEM,
"System", "System",
"MGM", MGM_TOKEN,
"Name of system for this node", "Name of system for this node",
ConfigInfo::INTERNAL, ConfigInfo::INTERNAL,
false, false,
...@@ -1324,8 +1366,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1324,8 +1366,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_NODE_ID, CFG_NODE_ID,
"Id", "Id",
"MGM", MGM_TOKEN,
"Number identifying the management server node (MGM)", "Number identifying the management server node ("MGM_TOKEN")",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::INT, ConfigInfo::INT,
...@@ -1336,7 +1378,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1336,7 +1378,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_LOG_DESTINATION, CFG_LOG_DESTINATION,
"LogDestination", "LogDestination",
"MGM", MGM_TOKEN,
"String describing where logmessages are sent", "String describing where logmessages are sent",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -1347,7 +1389,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1347,7 +1389,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
KEY_INTERNAL, KEY_INTERNAL,
"ExecuteOnComputer", "ExecuteOnComputer",
"MGM", MGM_TOKEN,
"String referencing an earlier defined COMPUTER", "String referencing an earlier defined COMPUTER",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -1358,7 +1400,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1358,7 +1400,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
KEY_INTERNAL, KEY_INTERNAL,
"MaxNoOfSavedEvents", "MaxNoOfSavedEvents",
"MGM", MGM_TOKEN,
"", "",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -1370,7 +1412,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1370,7 +1412,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_MGM_PORT, CFG_MGM_PORT,
"PortNumber", "PortNumber",
"MGM", MGM_TOKEN,
"Port number to give commands to/fetch configurations from management server", "Port number to give commands to/fetch configurations from management server",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -1382,7 +1424,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1382,7 +1424,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
KEY_INTERNAL, KEY_INTERNAL,
"PortNumberStats", "PortNumberStats",
"MGM", MGM_TOKEN,
"Port number used to get statistical information from a management server", "Port number used to get statistical information from a management server",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -1394,8 +1436,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1394,8 +1436,8 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_NODE_ARBIT_RANK, CFG_NODE_ARBIT_RANK,
"ArbitrationRank", "ArbitrationRank",
"MGM", MGM_TOKEN,
"If 0, then MGM is not arbitrator. Kernel selects arbitrators in order 1, 2", "If 0, then "MGM_TOKEN" is not arbitrator. Kernel selects arbitrators in order 1, 2",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::INT, ConfigInfo::INT,
...@@ -1406,7 +1448,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1406,7 +1448,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{ {
CFG_NODE_ARBIT_DELAY, CFG_NODE_ARBIT_DELAY,
"ArbitrationDelay", "ArbitrationDelay",
"MGM", MGM_TOKEN,
"", "",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
...@@ -1456,7 +1498,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1456,7 +1498,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
CFG_CONNECTION_NODE_1, CFG_CONNECTION_NODE_1,
"NodeId1", "NodeId1",
"TCP", "TCP",
"Id of node (DB, API or MGM) on one side of the connection", "Id of node ("DB_TOKEN", "API_TOKEN" or "MGM_TOKEN") on one side of the connection",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::STRING, ConfigInfo::STRING,
...@@ -1467,7 +1509,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1467,7 +1509,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
CFG_CONNECTION_NODE_2, CFG_CONNECTION_NODE_2,
"NodeId2", "NodeId2",
"TCP", "TCP",
"Id of node (DB, API or MGM) on one side of the connection", "Id of node ("DB_TOKEN", "API_TOKEN" or "MGM_TOKEN") on one side of the connection",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::STRING, ConfigInfo::STRING,
...@@ -1587,7 +1629,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1587,7 +1629,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
CFG_CONNECTION_NODE_1, CFG_CONNECTION_NODE_1,
"NodeId1", "NodeId1",
"SHM", "SHM",
"Id of node (DB, API or MGM) on one side of the connection", "Id of node ("DB_TOKEN", "API_TOKEN" or "MGM_TOKEN") on one side of the connection",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::STRING, ConfigInfo::STRING,
...@@ -1610,7 +1652,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1610,7 +1652,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
CFG_CONNECTION_NODE_2, CFG_CONNECTION_NODE_2,
"NodeId2", "NodeId2",
"SHM", "SHM",
"Id of node (DB, API or MGM) on one side of the connection", "Id of node ("DB_TOKEN", "API_TOKEN" or "MGM_TOKEN") on one side of the connection",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::STRING, ConfigInfo::STRING,
...@@ -1707,7 +1749,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1707,7 +1749,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
CFG_CONNECTION_NODE_1, CFG_CONNECTION_NODE_1,
"NodeId1", "NodeId1",
"SCI", "SCI",
"Id of node (DB, API or MGM) on one side of the connection", "Id of node ("DB_TOKEN", "API_TOKEN" or "MGM_TOKEN") on one side of the connection",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::INT, ConfigInfo::INT,
...@@ -1719,7 +1761,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1719,7 +1761,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
CFG_CONNECTION_NODE_2, CFG_CONNECTION_NODE_2,
"NodeId2", "NodeId2",
"SCI", "SCI",
"Id of node (DB, API or MGM) on one side of the connection", "Id of node ("DB_TOKEN", "API_TOKEN" or "MGM_TOKEN") on one side of the connection",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::INT, ConfigInfo::INT,
...@@ -1862,7 +1904,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1862,7 +1904,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
CFG_CONNECTION_NODE_1, CFG_CONNECTION_NODE_1,
"NodeId1", "NodeId1",
"OSE", "OSE",
"Id of node (DB, API or MGM) on one side of the connection", "Id of node ("DB_TOKEN", "API_TOKEN" or "MGM_TOKEN") on one side of the connection",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::INT, ConfigInfo::INT,
...@@ -1874,7 +1916,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ...@@ -1874,7 +1916,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
CFG_CONNECTION_NODE_2, CFG_CONNECTION_NODE_2,
"NodeId2", "NodeId2",
"OSE", "OSE",
"Id of node (DB, API or MGM) on one side of the connection", "Id of node ("DB_TOKEN", "API_TOKEN" or "MGM_TOKEN") on one side of the connection",
ConfigInfo::USED, ConfigInfo::USED,
false, false,
ConfigInfo::INT, ConfigInfo::INT,
...@@ -2206,7 +2248,7 @@ ConfigInfo::getDescription(const Properties * section, ...@@ -2206,7 +2248,7 @@ ConfigInfo::getDescription(const Properties * section,
bool bool
ConfigInfo::isSection(const char * section) const { ConfigInfo::isSection(const char * section) const {
for (int i = 0; i<m_noOfSectionNames; i++) { for (int i = 0; i<m_noOfSectionNames; i++) {
if(!strcmp(section, m_sectionNames[i])) return true; if(!strcasecmp(section, m_sectionNames[i])) return true;
} }
return false; return false;
} }
...@@ -2409,7 +2451,7 @@ fixNodeHostname(InitConfigFileParser::Context & ctx, const char * data){ ...@@ -2409,7 +2451,7 @@ fixNodeHostname(InitConfigFileParser::Context & ctx, const char * data){
const char * compId; const char * compId;
if(!ctx.m_currentSection->get("ExecuteOnComputer", &compId)){ if(!ctx.m_currentSection->get("ExecuteOnComputer", &compId)){
const char * type; const char * type;
if(ctx.m_currentSection->get("Type", &type) && strcmp(type,"DB") == 0) if(ctx.m_currentSection->get("Type", &type) && strcmp(type,DB_TOKEN) == 0)
require(ctx.m_currentSection->put("HostName", "localhost")); require(ctx.m_currentSection->put("HostName", "localhost"));
else else
require(ctx.m_currentSection->put("HostName", "")); require(ctx.m_currentSection->put("HostName", ""));
...@@ -2437,6 +2479,39 @@ fixNodeHostname(InitConfigFileParser::Context & ctx, const char * data){ ...@@ -2437,6 +2479,39 @@ fixNodeHostname(InitConfigFileParser::Context & ctx, const char * data){
return checkLocalhostHostnameMix(ctx); return checkLocalhostHostnameMix(ctx);
} }
bool
fixFileSystemPath(InitConfigFileParser::Context & ctx, const char * data){
DBUG_ENTER("fixFileSystemPath");
const char * path;
if (ctx.m_currentSection->get("FileSystemPath", &path))
DBUG_RETURN(true);
if (ctx.m_currentSection->get("DataDir", &path)) {
require(ctx.m_currentSection->put("FileSystemPath", path));
DBUG_RETURN(true);
}
require(false);
DBUG_RETURN(false);
}
bool
fixBackupDataPath(InitConfigFileParser::Context & ctx, const char * data){
const char * path;
if (ctx.m_currentSection->get("BackupDataPath", &path))
return true;
if (ctx.m_currentSection->get("FileSystemPath", &path)) {
require(ctx.m_currentSection->put("BackupDataPath", path));
return true;
}
require(false);
return false;
}
bool bool
transformExtNode(InitConfigFileParser::Context & ctx, const char * data){ transformExtNode(InitConfigFileParser::Context & ctx, const char * data){
...@@ -2778,10 +2853,16 @@ fixHostname(InitConfigFileParser::Context & ctx, const char * data){ ...@@ -2778,10 +2853,16 @@ fixHostname(InitConfigFileParser::Context & ctx, const char * data){
static bool static bool
fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){
DBUG_ENTER("fixPortNumber");
Uint32 id1= 0, id2= 0; Uint32 id1= 0, id2= 0;
require(ctx.m_currentSection->get("NodeId1", &id1)); require(ctx.m_currentSection->get("NodeId1", &id1));
require(ctx.m_currentSection->get("NodeId2", &id2)); require(ctx.m_currentSection->get("NodeId2", &id2));
id1 = id1 < id2 ? id1 : id2; if (id1 > id2) {
Uint32 tmp= id1;
id1= id2;
id2= tmp;
}
const Properties * node; const Properties * node;
require(ctx.m_config->get("Node", id1, &node)); require(ctx.m_config->get("Node", id1, &node));
...@@ -2790,7 +2871,7 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){ ...@@ -2790,7 +2871,7 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){
if (hostname.c_str()[0] == 0) { if (hostname.c_str()[0] == 0) {
ctx.reportError("Hostname required on nodeid %d since it will act as server.", id1); ctx.reportError("Hostname required on nodeid %d since it will act as server.", id1);
return false; DBUG_RETURN(false);
} }
Uint32 port= 0; Uint32 port= 0;
...@@ -2823,7 +2904,9 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){ ...@@ -2823,7 +2904,9 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){
} else } else
ctx.m_currentSection->put("PortNumber", port); ctx.m_currentSection->put("PortNumber", port);
return true; DBUG_PRINT("info", ("connection %d-%d port %d host %s", id1, id2, port, hostname.c_str()));
DBUG_RETURN(true);
} }
/** /**
...@@ -2908,8 +2991,8 @@ checkConnectionConstraints(InitConfigFileParser::Context & ctx, const char *){ ...@@ -2908,8 +2991,8 @@ checkConnectionConstraints(InitConfigFileParser::Context & ctx, const char *){
* -# Not both of them are MGMs * -# Not both of them are MGMs
* -# None of them contain a "SystemX" name * -# None of them contain a "SystemX" name
*/ */
if((strcmp(type1, "DB") != 0 && strcmp(type2, "DB") != 0) && if((strcmp(type1, DB_TOKEN) != 0 && strcmp(type2, DB_TOKEN) != 0) &&
!(strcmp(type1, "MGM") == 0 && strcmp(type2, "MGM") == 0) && !(strcmp(type1, MGM_TOKEN) == 0 && strcmp(type2, MGM_TOKEN) == 0) &&
!ctx.m_currentSection->contains("System1") && !ctx.m_currentSection->contains("System1") &&
!ctx.m_currentSection->contains("System2")){ !ctx.m_currentSection->contains("System2")){
ctx.reportError("Invalid connection between node %d (%s) and node %d (%s)" ctx.reportError("Invalid connection between node %d (%s) and node %d (%s)"
...@@ -3157,10 +3240,10 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>&sections, ...@@ -3157,10 +3240,10 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>&sections,
const char * type; const char * type;
if(!tmp->get("Type", &type)) continue; if(!tmp->get("Type", &type)) continue;
if (strcmp(type,"DB") == 0) if (strcmp(type,DB_TOKEN) == 0)
p_db_nodes.put("", i_db++, i); p_db_nodes.put("", i_db++, i);
else if (strcmp(type,"API") == 0 || else if (strcmp(type,API_TOKEN) == 0 ||
strcmp(type,"MGM") == 0) strcmp(type,MGM_TOKEN) == 0)
p_api_mgm_nodes.put("", i_api_mgm++, i); p_api_mgm_nodes.put("", i_api_mgm++, i);
} }
...@@ -3233,7 +3316,7 @@ static bool add_server_ports(Vector<ConfigInfo::ConfigRuleSection>&sections, ...@@ -3233,7 +3316,7 @@ static bool add_server_ports(Vector<ConfigInfo::ConfigRuleSection>&sections,
Uint32 adder= 0; Uint32 adder= 0;
computers.get("",computer, &adder); computers.get("",computer, &adder);
if (strcmp(type,"DB") == 0) { if (strcmp(type,DB_TOKEN) == 0) {
adder++; adder++;
tmp->put("ServerPort", port_base+adder); tmp->put("ServerPort", port_base+adder);
computers.put("",computer, adder); computers.put("",computer, adder);
...@@ -3250,7 +3333,7 @@ check_node_vs_replicas(Vector<ConfigInfo::ConfigRuleSection>&sections, ...@@ -3250,7 +3333,7 @@ check_node_vs_replicas(Vector<ConfigInfo::ConfigRuleSection>&sections,
{ {
Uint32 db_nodes = 0; Uint32 db_nodes = 0;
Uint32 replicas = 0; Uint32 replicas = 0;
ctx.m_userProperties.get("DB", &db_nodes); ctx.m_userProperties.get(DB_TOKEN, &db_nodes);
ctx.m_userProperties.get("NoOfReplicas", &replicas); ctx.m_userProperties.get("NoOfReplicas", &replicas);
if((db_nodes % replicas) != 0){ if((db_nodes % replicas) != 0){
ctx.reportError("Invalid no of db nodes wrt no of replicas.\n" ctx.reportError("Invalid no of db nodes wrt no of replicas.\n"
......
...@@ -154,7 +154,7 @@ ConfigRetriever::getConfig() { ...@@ -154,7 +154,7 @@ ConfigRetriever::getConfig() {
if(p == 0) if(p == 0)
return 0; return 0;
if(!verifyConfig(p)){ if(!verifyConfig(p, _ownNodeId)){
free(p); free(p);
p= 0; p= 0;
} }
...@@ -239,7 +239,7 @@ ConfigRetriever::setConnectString(const char * connectString) { ...@@ -239,7 +239,7 @@ ConfigRetriever::setConnectString(const char * connectString) {
} }
bool bool
ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf){ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf, Uint32 nodeid){
char buf[255]; char buf[255];
ndb_mgm_configuration_iterator * it; ndb_mgm_configuration_iterator * it;
...@@ -253,8 +253,8 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf){ ...@@ -253,8 +253,8 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf){
} }
NdbAutoPtr<ndb_mgm_configuration_iterator> ptr(it); NdbAutoPtr<ndb_mgm_configuration_iterator> ptr(it);
if(ndb_mgm_find(it, CFG_NODE_ID, _ownNodeId) != 0){ if(ndb_mgm_find(it, CFG_NODE_ID, nodeid) != 0){
snprintf(buf, 255, "Unable to find node with id: %d", _ownNodeId); snprintf(buf, 255, "Unable to find node with id: %d", nodeid);
setError(CR_ERROR, buf); setError(CR_ERROR, buf);
return false; return false;
} }
...@@ -266,6 +266,11 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf){ ...@@ -266,6 +266,11 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf){
return false; return false;
} }
const char * datadir;
if(!ndb_mgm_get_string_parameter(it, CFG_NODE_DATADIR, &datadir)){
NdbConfig_SetPath(datadir);
}
char localhost[MAXHOSTNAMELEN]; char localhost[MAXHOSTNAMELEN];
if(NdbHost_GetHostName(localhost) != 0){ if(NdbHost_GetHostName(localhost) != 0){
snprintf(buf, 255, "Unable to get own hostname"); snprintf(buf, 255, "Unable to get own hostname");
...@@ -332,8 +337,8 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf){ ...@@ -332,8 +337,8 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf){
if(iter.get(CFG_CONNECTION_NODE_1, &nodeId1)) continue; if(iter.get(CFG_CONNECTION_NODE_1, &nodeId1)) continue;
if(iter.get(CFG_CONNECTION_NODE_2, &nodeId2)) continue; if(iter.get(CFG_CONNECTION_NODE_2, &nodeId2)) continue;
if(nodeId1 != _ownNodeId && nodeId2 != _ownNodeId) continue; if(nodeId1 != nodeid && nodeId2 != nodeid) continue;
remoteNodeId = (_ownNodeId == nodeId1 ? nodeId2 : nodeId1); remoteNodeId = (nodeid == nodeId1 ? nodeId2 : nodeId1);
const char * name; const char * name;
struct in_addr addr; struct in_addr addr;
...@@ -342,7 +347,7 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf){ ...@@ -342,7 +347,7 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf){
if(Ndb_getInAddr(&addr, name) != 0){ if(Ndb_getInAddr(&addr, name) != 0){
tmp.assfmt("Unable to lookup/illegal hostname %s, " tmp.assfmt("Unable to lookup/illegal hostname %s, "
"connection from node %d to node %d", "connection from node %d to node %d",
name, _ownNodeId, remoteNodeId); name, nodeid, remoteNodeId);
setError(CR_ERROR, tmp.c_str()); setError(CR_ERROR, tmp.c_str());
return false; return false;
} }
...@@ -352,7 +357,7 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf){ ...@@ -352,7 +357,7 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf){
if(Ndb_getInAddr(&addr, name) != 0){ if(Ndb_getInAddr(&addr, name) != 0){
tmp.assfmt("Unable to lookup/illegal hostname %s, " tmp.assfmt("Unable to lookup/illegal hostname %s, "
"connection from node %d to node %d", "connection from node %d to node %d",
name, _ownNodeId, remoteNodeId); name, nodeid, remoteNodeId);
setError(CR_ERROR, tmp.c_str()); setError(CR_ERROR, tmp.c_str());
return false; return false;
} }
......
...@@ -480,10 +480,6 @@ InitConfigFileParser::parseSectionHeader(const char* line) const { ...@@ -480,10 +480,6 @@ InitConfigFileParser::parseSectionHeader(const char* line) const {
tmp[0] = ' '; tmp[0] = ' ';
trim(tmp); trim(tmp);
// Convert section header to upper
for(int i= strlen(tmp)-1; i >= 0; i--)
tmp[i]= toupper(tmp[i]);
// Get the correct header name if an alias // Get the correct header name if an alias
{ {
const char *tmp_alias= m_info->getAlias(tmp); const char *tmp_alias= m_info->getAlias(tmp);
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#include <NdbEnv.h> #include <NdbEnv.h>
#include <NdbMem.h> #include <NdbMem.h>
static char *datadir_path= 0;
static char* static char*
NdbConfig_AllocHomePath(int _len) NdbConfig_AllocHomePath(int _len)
{ {
...@@ -27,19 +29,27 @@ NdbConfig_AllocHomePath(int _len) ...@@ -27,19 +29,27 @@ NdbConfig_AllocHomePath(int _len)
int path_len= 0; int path_len= 0;
char *buf; char *buf;
if (path == 0)
path= datadir_path;
if (path) if (path)
path_len= strlen(path); path_len= strlen(path);
len+= path_len; len+= path_len;
buf= NdbMem_Allocate(len); buf= NdbMem_Allocate(len);
if (path_len > 0) if (path_len > 0)
snprintf(buf, len, "%s%c", path, DIR_SEPARATOR); snprintf(buf, len, "%s%s", path, DIR_SEPARATOR);
else else
buf[0]= 0; buf[0]= 0;
return buf; return buf;
} }
void
NdbConfig_SetPath(const char* path){
datadir_path= path;
}
char* char*
NdbConfig_NdbCfgName(int with_ndb_home){ NdbConfig_NdbCfgName(int with_ndb_home){
char *buf; char *buf;
......
...@@ -52,7 +52,10 @@ LDADD += \ ...@@ -52,7 +52,10 @@ LDADD += \
$(top_builddir)/ndb/src/common/mgmcommon/libmgmsrvcommon.la \ $(top_builddir)/ndb/src/common/mgmcommon/libmgmsrvcommon.la \
$(top_builddir)/ndb/src/mgmapi/libmgmapi.la \ $(top_builddir)/ndb/src/mgmapi/libmgmapi.la \
$(top_builddir)/ndb/src/common/portlib/libportlib.la \ $(top_builddir)/ndb/src/common/portlib/libportlib.la \
$(top_builddir)/ndb/src/common/util/libgeneral.la $(top_builddir)/ndb/src/common/util/libgeneral.la \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/strings/libmystrings.a
# Don't update the files from bitkeeper # Don't update the files from bitkeeper
%::SCCS/s.% %::SCCS/s.%
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <ndb_global.h>
#include <my_sys.h>
#include "Configuration.hpp" #include "Configuration.hpp"
#include <ErrorHandlingMacros.hpp> #include <ErrorHandlingMacros.hpp>
#include "GlobalData.hpp" #include "GlobalData.hpp"
...@@ -56,6 +59,9 @@ Configuration::init(int argc, const char** argv){ ...@@ -56,6 +59,9 @@ Configuration::init(int argc, const char** argv){
int _deamon = 0; int _deamon = 0;
int _help = 0; int _help = 0;
int _print_version = 0; int _print_version = 0;
#ifndef DBUG_OFF
const char *debug_option= 0;
#endif
/** /**
* Arguments to NDB process * Arguments to NDB process
...@@ -66,6 +72,10 @@ Configuration::init(int argc, const char** argv){ ...@@ -66,6 +72,10 @@ Configuration::init(int argc, const char** argv){
{ "nostart", 'n', arg_flag, &_no_start, { "nostart", 'n', arg_flag, &_no_start,
"Don't start ndbd immediately. Ndbd will await command from ndb_mgmd", "" }, "Don't start ndbd immediately. Ndbd will await command from ndb_mgmd", "" },
{ "daemon", 'd', arg_flag, &_deamon, "Start ndbd as daemon", "" }, { "daemon", 'd', arg_flag, &_deamon, "Start ndbd as daemon", "" },
#ifndef DBUG_OFF
{ "debug", 0, arg_string, &debug_option,
"Specify debug options e.g. d:t:i:o,out.trace", "options" },
#endif
{ "initial", 'i', arg_flag, &_initial, { "initial", 'i', arg_flag, &_initial,
"Perform initial start of ndbd, including cleaning the file system. Consult documentation before using this", "" }, "Perform initial start of ndbd, including cleaning the file system. Consult documentation before using this", "" },
...@@ -84,15 +94,17 @@ Configuration::init(int argc, const char** argv){ ...@@ -84,15 +94,17 @@ Configuration::init(int argc, const char** argv){
return false; return false;
} }
#if 0 #ifndef DBUG_OFF
ndbout << "no_start=" <<_no_start<< endl; my_init();
ndbout << "initial=" <<_initial<< endl; if (debug_option)
ndbout << "deamon=" <<_deamon<< endl; DBUG_PUSH(debug_option);
ndbout << "connect_str="<<_connect_str<<endl;
arg_printusage(args, num_args, argv[0], desc);
return false;
#endif #endif
DBUG_PRINT("info", ("no_start=%d", _no_start));
DBUG_PRINT("info", ("initial=%d", _initial));
DBUG_PRINT("info", ("deamon=%d", _deamon));
DBUG_PRINT("info", ("connect_str=%s", _connect_str));
ndbSetOwnVersion(); ndbSetOwnVersion();
if (_print_version) { if (_print_version) {
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "MgmtSrvr.hpp" #include "MgmtSrvr.hpp"
#include "MgmtErrorReporter.hpp" #include "MgmtErrorReporter.hpp"
#include <ConfigRetriever.hpp>
#include <NdbOut.hpp> #include <NdbOut.hpp>
#include <NdbApiSignal.hpp> #include <NdbApiSignal.hpp>
...@@ -512,6 +513,8 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId, ...@@ -512,6 +513,8 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId,
theConfCount(0), theConfCount(0),
m_allocated_resources(*this) { m_allocated_resources(*this) {
DBUG_ENTER("MgmtSrvr::MgmtSrvr");
_config = NULL; _config = NULL;
_isStatPortActive = false; _isStatPortActive = false;
_isClusterLogStatActive = false; _isClusterLogStatActive = false;
...@@ -543,37 +546,39 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId, ...@@ -543,37 +546,39 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId,
for(Uint32 i = 0; i<MAX_NODES; i++) for(Uint32 i = 0; i<MAX_NODES; i++)
nodeTypes[i] = (enum ndb_mgm_node_type)-1; nodeTypes[i] = (enum ndb_mgm_node_type)-1;
ndb_mgm_configuration_iterator * iter = ndb_mgm_create_configuration_iterator {
(config->m_configValues, CFG_SECTION_NODE); ndb_mgm_configuration_iterator * iter = ndb_mgm_create_configuration_iterator
for(ndb_mgm_first(iter); ndb_mgm_valid(iter); ndb_mgm_next(iter)){ (config->m_configValues, CFG_SECTION_NODE);
unsigned type, id; for(ndb_mgm_first(iter); ndb_mgm_valid(iter); ndb_mgm_next(iter)){
if(ndb_mgm_get_int_parameter(iter, CFG_TYPE_OF_SECTION, &type) != 0) unsigned type, id;
continue; if(ndb_mgm_get_int_parameter(iter, CFG_TYPE_OF_SECTION, &type) != 0)
continue;
if(ndb_mgm_get_int_parameter(iter, CFG_NODE_ID, &id) != 0)
continue;
MGM_REQUIRE(id < MAX_NODES);
switch(type){ if(ndb_mgm_get_int_parameter(iter, CFG_NODE_ID, &id) != 0)
case NODE_TYPE_DB: continue;
nodeTypes[id] = NDB_MGM_NODE_TYPE_NDB;
break; MGM_REQUIRE(id < MAX_NODES);
case NODE_TYPE_API:
nodeTypes[id] = NDB_MGM_NODE_TYPE_API; switch(type){
break; case NODE_TYPE_DB:
case NODE_TYPE_MGM: nodeTypes[id] = NDB_MGM_NODE_TYPE_NDB;
nodeTypes[id] = NDB_MGM_NODE_TYPE_MGM; break;
break; case NODE_TYPE_API:
case NODE_TYPE_REP: nodeTypes[id] = NDB_MGM_NODE_TYPE_API;
nodeTypes[id] = NDB_MGM_NODE_TYPE_REP; break;
break; case NODE_TYPE_MGM:
case NODE_TYPE_EXT_REP: nodeTypes[id] = NDB_MGM_NODE_TYPE_MGM;
default: break;
break; case NODE_TYPE_REP:
nodeTypes[id] = NDB_MGM_NODE_TYPE_REP;
break;
case NODE_TYPE_EXT_REP:
default:
break;
}
} }
ndb_mgm_destroy_iterator(iter);
} }
ndb_mgm_destroy_iterator(iter);
m_statisticsListner = NULL; m_statisticsListner = NULL;
...@@ -589,6 +594,18 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId, ...@@ -589,6 +594,18 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId,
exit(-1); exit(-1);
} }
_ownNodeId = tmp; _ownNodeId = tmp;
{
DBUG_PRINT("info", ("verifyConfig"));
ConfigRetriever cr(NDB_VERSION, NDB_MGM_NODE_TYPE_MGM);
if (!cr.verifyConfig(config->m_configValues, _ownNodeId)) {
ndbout << cr.getErrorString() << endl;
exit(-1);
}
}
DBUG_VOID_RETURN;
} }
......
...@@ -109,7 +109,7 @@ struct getargs args[] = { ...@@ -109,7 +109,7 @@ struct getargs args[] = {
"Specify cluster configuration file", "filename" }, "Specify cluster configuration file", "filename" },
#ifndef DBUG_OFF #ifndef DBUG_OFF
{ "debug", 0, arg_string, &debug_option, { "debug", 0, arg_string, &debug_option,
"Specify debug option e.d. d:t:i:o,out.trace", "options" }, "Specify debug options e.g. d:t:i:o,out.trace", "options" },
#endif #endif
{ "daemon", 'd', arg_flag, &glob.daemon, { "daemon", 'd', arg_flag, &glob.daemon,
"Run ndb_mgmd in daemon mode" }, "Run ndb_mgmd in daemon mode" },
...@@ -143,8 +143,8 @@ NDB_MAIN(mgmsrv){ ...@@ -143,8 +143,8 @@ NDB_MAIN(mgmsrv){
exit(1); exit(1);
} }
my_init();
#ifndef DBUG_OFF #ifndef DBUG_OFF
my_init();
if (debug_option) if (debug_option)
DBUG_PUSH(debug_option); DBUG_PUSH(debug_option);
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment