Commit 889cb7db authored by joreland@mysql.com's avatar joreland@mysql.com

Merge mysql.com:/home/jonas/src/mysql-4.1-ndb

into mysql.com:/home/jonas/src/mysql-4.1-ndb-jonas
parents 9fb4e4b3 05b304d0
......@@ -90,6 +90,7 @@ CCFLAGS_LOC += \
-I$(call fixpath,$(NDB_TOP)/include/transporter) \
-I$(call fixpath,$(NDB_TOP)/include/debugger) \
-I$(call fixpath,$(NDB_TOP)/include/mgmcommon) \
-I$(call fixpath,$(NDB_TOP)/include/mgmapi) \
-I$(call fixpath,$(NDB_TOP)/include/ndbapi) \
-I$(call fixpath,$(NDB_TOP)/include/util) \
-I$(call fixpath,$(NDB_TOP)/include/portlib) \
......@@ -105,6 +106,7 @@ CCFLAGS_LOC += \
-I$(call fixpath,$(NDB_TOP)/include/transporter) \
-I$(call fixpath,$(NDB_TOP)/include/debugger) \
-I$(call fixpath,$(NDB_TOP)/include/mgmcommon) \
-I$(call fixpath,$(NDB_TOP)/include/mgmapi) \
-I$(call fixpath,$(NDB_TOP)/include/ndbapi) \
-I$(call fixpath,$(NDB_TOP)/include/util) \
-I$(call fixpath,$(NDB_TOP)/include/portlib) \
......
......@@ -37,6 +37,7 @@
#define DBTUP 0xF9
#define DBDICT 0xFA
#define NDBCNTR 0xFB
#define CNTR 0xFB
#define QMGR 0xFC
#define NDBFS 0xFD
#define CMVMI 0xFE
......
......@@ -177,43 +177,43 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
#define GSN_API_FAILCONF 113
#define GSN_API_FAILREQ 114
#define GSN_APPL_CHANGEREP 115
#define GSN_CNTR_START_REQ 115
// 116 not unused
#define GSN_APPL_HB 117
#define GSN_APPL_HBREQ 118
#define GSN_APPL_REGCONF 119
#define GSN_APPL_REGREF 120
#define GSN_APPL_REGREQ 121
#define GSN_APPL_RUN 122
#define GSN_APPL_STARTCONF 123
#define GSN_APPL_STARTREG 124
#define GSN_CNTR_START_REF 117
#define GSN_CNTR_START_CONF 118
#define GSN_CNTR_START_REP 119
// 120 unused
// 121 unused
// 122 unused
// 123 unused
// 124 unused
#define GSN_CHECK_LCP_STOP 125
#define GSN_CLOSE_COMCONF 126
#define GSN_CLOSE_COMREQ 127
#define GSN_CM_ACKADD 128
#define GSN_CM_ACKALARM 129
#define GSN_CM_ADD 130
#define GSN_CM_APPCHG 131
#define GSN_CLOSE_COMCONF 126 // local
#define GSN_CLOSE_COMREQ 127 // local
#define GSN_CM_ACKADD 128 // distr.
// 129 unused
#define GSN_CM_ADD 130 // distr.
// 131 unused
// 132 not unused
// 133 not unused
#define GSN_CM_HEARTBEAT 134
#define GSN_CM_INFOCONF 135
#define GSN_CM_INFOREQ 136
#define GSN_CM_INIT 137
#define GSN_CM_NODEINFOCONF 138
#define GSN_CM_NODEINFOREF 139
#define GSN_CM_NODEINFOREQ 140
#define GSN_CM_REGCONF 141
#define GSN_CM_REGREF 142
#define GSN_CM_REGREQ 143
#define GSN_CM_RUN 144
#define GSN_CMVMI_CFGCONF 145
#define GSN_CMVMI_CFGREQ 146
#define GSN_CNTR_CHANGEREP 147
#define GSN_CNTR_MASTERCONF 148
#define GSN_CNTR_MASTERREF 149
#define GSN_CNTR_MASTERREQ 150
#define GSN_CNTR_WAITREP 151
#define GSN_CM_HEARTBEAT 134 // distr.
// 135 unused
// 136 unused
// 137 unused
#define GSN_CM_NODEINFOCONF 138 // distr.
#define GSN_CM_NODEINFOREF 139 // distr.
#define GSN_CM_NODEINFOREQ 140 // distr.
#define GSN_CM_REGCONF 141 // distr.
#define GSN_CM_REGREF 142 // distr.
#define GSN_CM_REGREQ 143 // distr.
// 144 unused
// 145 unused
// 146 unused
#define GSN_CM_ADD_REP 147 // local
// 148 unused
// 149 unused
// 150 unused
#define GSN_CNTR_WAITREP 151 // distr.
#define GSN_COMMIT 152
#define GSN_COMMIT_FAILCONF 153
#define GSN_COMMIT_FAILREQ 154
......@@ -426,11 +426,13 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
#define GSN_NEXT_SCANREF 331
#define GSN_NEXT_SCANREQ 332
#define GSN_NEXTOPERATION 333
#define GSN_SIZEALT_ACK 334
#define GSN_SIZEALT_REP 335
#define GSN_NODE_STATESCONF 336
#define GSN_NODE_STATESREF 337
#define GSN_NODE_STATESREQ 338
#define GSN_READ_CONFIG_REQ 334 // new name for sizealt, local
#define GSN_READ_CONFIG_CONF 335 // new name for sizealt, local
// 336 unused
// 337 unused
// 338 unused
#define GSN_OPEN_COMCONF 339
#define GSN_OPEN_COMREF 340
#define GSN_OPEN_COMREQ 341
......@@ -511,8 +513,8 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
#define GSN_TEST_ORD 407
#define GSN_TESTSIG 408
#define GSN_TIME_SIGNAL 409
#define GSN_VOTE_MASTERORD 410
// 411 unused
// 410 unused
// 411 unused
// 412 unused
#define GSN_TUP_ABORTREQ 414
#define GSN_TUP_ADD_ATTCONF 415
......@@ -580,7 +582,7 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
#define GSN_CHECKNODEGROUPSREQ 471
#define GSN_CHECKNODEGROUPSCONF 472
#define GSN_ARBIT_CFG 473
// 473 unused
#define GSN_ARBIT_PREPREQ 474
#define GSN_ARBIT_PREPCONF 475
#define GSN_ARBIT_PREPREF 476
......
......@@ -18,6 +18,7 @@
#define _LOG_LEVEL_HPP
#include <ndb_global.h>
#include <mgmapi_config_parameters.h>
/**
*
......@@ -45,53 +46,60 @@ public:
*/
LogLevel & operator= (const LogLevel &);
static const Uint32 MIN_LOGLEVEL_ID = CFG_LOGLEVEL_STARTUP;
enum EventCategory {
/**
* Events during all kind of startups
*/
llStartUp = 0,
llStartUp = CFG_LOGLEVEL_STARTUP - MIN_LOGLEVEL_ID,
/**
* Events during shutdown
*/
llShutdown = 1,
llShutdown = CFG_LOGLEVEL_SHUTDOWN - MIN_LOGLEVEL_ID,
/**
* Transaction statistics
* Job level
* TCP/IP speed
*/
llStatistic = 2,
llStatistic = CFG_LOGLEVEL_STATISTICS - MIN_LOGLEVEL_ID,
/**
* Checkpoints
*/
llCheckpoint = 3,
llCheckpoint = CFG_LOGLEVEL_CHECKPOINT - MIN_LOGLEVEL_ID,
/**
* Events during node restart
*/
llNodeRestart = 4,
llNodeRestart = CFG_LOGLEVEL_NODERESTART - MIN_LOGLEVEL_ID,
/**
* Events related to connection / communication
*/
llConnection = 5,
llConnection = CFG_LOGLEVEL_CONNECTION - MIN_LOGLEVEL_ID,
/**
* Assorted event w.r.t unexpected happenings
*/
llError = 6,
llError = CFG_LOGLEVEL_ERROR - MIN_LOGLEVEL_ID,
/**
* Assorted event w.r.t warning
*/
llWarning = CFG_LOGLEVEL_WARNING - MIN_LOGLEVEL_ID,
/**
* Assorted event w.r.t information
*/
llInfo = 7,
llInfo = CFG_LOGLEVEL_INFO - MIN_LOGLEVEL_ID,
/**
* Events related to global replication
*/
llGrep = 8
llGrep = CFG_LOGLEVEL_GREP - MIN_LOGLEVEL_ID
};
struct LogLevelCategoryName {
......@@ -107,7 +115,7 @@ public:
/**
* No of categories
*/
#define _LOGLEVEL_CATEGORIES 9
#define _LOGLEVEL_CATEGORIES 10
static const Uint32 LOGLEVEL_CATEGORIES = _LOGLEVEL_CATEGORIES;
void clear();
......
#ifndef DB_CONFIG_PARAMTERS_H
#define DB_CONFIG_PARAMTERS_H
#define PRIVATE_BASE 14000
#define CFG_ACC_DIR_RANGE (PRIVATE_BASE + 1)
#define CFG_ACC_DIR_ARRAY (PRIVATE_BASE + 2)
#define CFG_ACC_FRAGMENT (PRIVATE_BASE + 3)
#define CFG_ACC_OP_RECS (PRIVATE_BASE + 4)
#define CFG_ACC_OVERFLOW_RECS (PRIVATE_BASE + 5)
#define CFG_ACC_PAGE8 (PRIVATE_BASE + 6)
#define CFG_ACC_ROOT_FRAG (PRIVATE_BASE + 7)
#define CFG_ACC_TABLE (PRIVATE_BASE + 8)
#define CFG_ACC_SCAN (PRIVATE_BASE + 9)
#define CFG_DICT_ATTRIBUTE (PRIVATE_BASE + 10)
#define CFG_DICT_CONNECT (PRIVATE_BASE + 11)
#define CFG_DICT_FRAG_CONNECT (PRIVATE_BASE + 12)
#define CFG_DICT_TABLE (PRIVATE_BASE + 13)
#define CFG_DICT_TC_CONNECT (PRIVATE_BASE + 14)
#define CFG_DIH_API_CONNECT (PRIVATE_BASE + 15)
#define CFG_DIH_CONNECT (PRIVATE_BASE + 16)
#define CFG_DIH_FRAG_CONNECT (PRIVATE_BASE + 17)
#define CFG_DIH_MORE_NODES (PRIVATE_BASE + 18)
#define CFG_DIH_REPLICAS (PRIVATE_BASE + 19)
#define CFG_DIH_TABLE (PRIVATE_BASE + 20)
#define CFG_LQH_FRAG (PRIVATE_BASE + 21)
#define CFG_LQH_CONNECT (PRIVATE_BASE + 22)
#define CFG_LQH_TABLE (PRIVATE_BASE + 23)
#define CFG_LQH_TC_CONNECT (PRIVATE_BASE + 24)
#define CFG_LQH_REPLICAS (PRIVATE_BASE + 25)
#define CFG_LQH_LOG_FILES (PRIVATE_BASE + 26)
#define CFG_LQH_SCAN (PRIVATE_BASE + 27)
#define CFG_TC_API_CONNECT (PRIVATE_BASE + 28)
#define CFG_TC_TC_CONNECT (PRIVATE_BASE + 29)
#define CFG_TC_TABLE (PRIVATE_BASE + 30)
#define CFG_TC_SCAN (PRIVATE_BASE + 31)
#define CFG_TC_LOCAL_SCAN (PRIVATE_BASE + 32)
#define CFG_TUP_FRAG (PRIVATE_BASE + 33)
#define CFG_TUP_OP_RECS (PRIVATE_BASE + 34)
#define CFG_TUP_PAGE (PRIVATE_BASE + 35)
#define CFG_TUP_PAGE_RANGE (PRIVATE_BASE + 36)
#define CFG_TUP_TABLE (PRIVATE_BASE + 37)
#define CFG_TUP_TABLE_DESC (PRIVATE_BASE + 38)
#define CFG_TUP_STORED_PROC (PRIVATE_BASE + 39)
#define CFG_TUX_INDEX (PRIVATE_BASE + 40)
#define CFG_TUX_FRAGMENT (PRIVATE_BASE + 41)
#define CFG_TUX_ATTRIBUTE (PRIVATE_BASE + 42)
#define CFG_TUX_SCAN_OP (PRIVATE_BASE + 43)
#endif
......@@ -37,13 +37,11 @@ public:
Uint32 requestType; // direct flag, output code
Uint32 output;
};
union {
Uint32 nodeId; // nodeId input for GetNodeGroupMembers
NodeBitmask mask; /* set of NDB nodes, input for ArbitCheck,
* output for GetNodeGroupMembers
*/
};
Uint32 nodeId; // nodeId input for GetNodeGroupMembers
NodeBitmask mask; /* set of NDB nodes, input for ArbitCheck,
* output for GetNodeGroupMembers
*/
enum RequestType {
Direct = 0x1,
ArbitCheck = 0x2,
......@@ -57,7 +55,7 @@ public:
Partitioning = 3 // possible network partitioning
};
STATIC_CONST( SignalLength = 2 + NodeBitmask::Size );
STATIC_CONST( SignalLength = 3 + NodeBitmask::Size );
};
#endif
#ifndef CNTR_START_HPP
#define CNTR_START_HPP
#include <NodeBitmask.hpp>
/**
*
*/
class CntrStartReq {
/**
* Sender(s) / Reciver(s)
*/
friend class Ndbcntr;
friend bool printCNTR_START_REQ(FILE*, const Uint32 *, Uint32, Uint16);
public:
STATIC_CONST( SignalLength = 3 );
private:
Uint32 nodeId;
Uint32 startType;
Uint32 lastGci;
};
class CntrStartRef {
/**
* Sender(s) / Reciver(s)
*/
friend class Ndbcntr;
friend bool printCNTR_START_REF(FILE*, const Uint32 *, Uint32, Uint16);
public:
STATIC_CONST( SignalLength = 2 );
enum ErrorCode {
OK = 0,
NotMaster = 1,
StopInProgress = 2
};
private:
Uint32 errorCode;
Uint32 masterNodeId;
};
class CntrStartConf {
/**
* Sender(s) / Reciver(s)
*/
friend class Ndbcntr;
friend struct UpgradeStartup;
friend bool printCNTR_START_CONF(FILE*, const Uint32 *, Uint32, Uint16);
public:
STATIC_CONST( SignalLength = 4 + 2 * NdbNodeBitmask::Size );
private:
Uint32 startType;
Uint32 startGci;
Uint32 masterNodeId;
Uint32 noStartNodes;
Uint32 startedNodes[NdbNodeBitmask::Size];
Uint32 startingNodes[NdbNodeBitmask::Size];
};
#endif
......@@ -39,7 +39,7 @@ class EventSubscribeReq {
friend class MgmtSrvr;
public:
STATIC_CONST( SignalLength = 14 );
STATIC_CONST( SignalLength = 22 );
private:
/**
* Note: If you use the same blockRef as you have used earlier,
......@@ -53,8 +53,8 @@ private:
*/
Uint32 noOfEntries;
Uint32 theCategories[6];
Uint32 theLevels[6];
Uint32 theCategories[10];
Uint32 theLevels[10];
};
#endif
......@@ -39,6 +39,7 @@ class FsOpenReq {
friend class Backup;
friend class Dbdict;
friend class Ndbcntr; // For initial start...
friend class Dbdih;
/**
* For printing
......
#ifndef READ_CONFIG_HPP
#define READ_CONFIG_HPP
/**
*/
class ReadConfigReq {
public:
STATIC_CONST( SignalLength = 3 );
Uint32 senderRef;
Uint32 senderData;
Uint32 noOfParameters; // 0 Means read all relevant for block
Uint32 parameters[1]; // see mgmapi_config_parameters.h
};
class ReadConfigConf {
public:
STATIC_CONST( SignalLength = 2 );
Uint32 senderRef;
Uint32 senderData;
};
#endif
......@@ -48,11 +48,13 @@ class ReadNodesConf {
friend class Suma;
friend class Grep;
friend bool printREAD_NODES_CONF(FILE*, const Uint32 *, Uint32, Uint16);
public:
STATIC_CONST( SignalLength = 2 + 6*NodeBitmask::Size );
STATIC_CONST( SignalLength = 3 + 5*NdbNodeBitmask::Size );
private:
Uint32 noOfNodes;
Uint32 ndynamicId;
/**
*
......@@ -63,47 +65,21 @@ private:
/**
* This array defines all the ndb nodes in the system
*/
Uint32 allNodes[NodeBitmask::Size];
/**
* This array describes wheather the nodes are currently active
*
* NOTE Not valid when send from Qmgr
*/
Uint32 inactiveNodes[NodeBitmask::Size];
union {
Uint32 allNodes[NdbNodeBitmask::Size];
Uint32 definedNodes[NdbNodeBitmask::Size];
};
/**
* This array describes the version id of the nodes
* The version id is a 4 bit number
* This array describes wheather the nodes are currently active
*
* NOTE Not valid when send from Qmgr
*/
Uint32 theVersionIds[4*NodeBitmask::Size];
Uint32 inactiveNodes[NdbNodeBitmask::Size];
static void setVersionId(NodeId, Uint8 versionId, Uint32 theVersionIds[]);
static Uint8 getVersionId(NodeId, const Uint32 theVersionIds[]);
Uint32 clusterNodes[NdbNodeBitmask::Size]; // From Qmgr
Uint32 startingNodes[NdbNodeBitmask::Size]; // From Cntr
Uint32 startedNodes[NdbNodeBitmask::Size]; // From Cntr
};
inline
void
ReadNodesConf::setVersionId(NodeId nodeId, Uint8 versionId,
Uint32 theVersionIds[]){
const int word = nodeId >> 3;
const int shift = (nodeId & 7) << 2;
const Uint32 mask = ~(((Uint32)15) << shift);
const Uint32 tmp = theVersionIds[word];
theVersionIds[word] = (tmp & mask) | ((((Uint32)versionId) & 15) << shift);
}
inline
Uint8
ReadNodesConf::getVersionId(NodeId nodeId, const Uint32 theVersionIds[]){
const int word = nodeId >> 3;
const int shift = (nodeId & 7) << 2;
return (theVersionIds[word] >> shift) & 15;
}
#endif
......@@ -18,6 +18,7 @@
#define SET_LOGLEVEL_ORD_HPP
#include <LogLevel.hpp>
#include "SignalData.hpp"
/**
*
......
#ifndef NDB_UPGRADE_STARTUP
#define NDB_UPGRADE_STARTUP
struct UpgradeStartup {
static void installEXEC(SimulatedBlock*);
static const Uint32 GSN_CM_APPCHG = 131;
static const Uint32 GSN_CNTR_MASTERCONF = 148;
static const Uint32 GSN_CNTR_MASTERREF = 149;
static const Uint32 GSN_CNTR_MASTERREQ = 150;
static void sendCmAppChg(Ndbcntr&, Signal *, Uint32 startLevel);
static void execCM_APPCHG(SimulatedBlock& block, Signal*);
static void sendCntrMasterReq(Ndbcntr& cntr, Signal* signal, Uint32 n);
static void execCNTR_MASTER_REPLY(SimulatedBlock & block, Signal* signal);
struct CntrMasterReq {
STATIC_CONST( SignalLength = 4 + NdbNodeBitmask::Size );
Uint32 userBlockRef;
Uint32 userNodeId;
Uint32 typeOfStart;
Uint32 noRestartNodes;
Uint32 theNodes[NdbNodeBitmask::Size];
};
struct CntrMasterConf {
STATIC_CONST( SignalLength = 1 + NdbNodeBitmask::Size );
Uint32 noStartNodes;
Uint32 theNodes[NdbNodeBitmask::Size];
};
};
#endif
......@@ -84,9 +84,10 @@ extern "C" {
NDB_MGM_NODE_TYPE_API = 0, /*/< An application node (API)*/
NDB_MGM_NODE_TYPE_NDB = 1, /*/< A database node (DB)*/
NDB_MGM_NODE_TYPE_MGM = 2, /*/< A management server node (MGM)*/
NDB_MGM_NODE_TYPE_REP = 3, ///< A replication node
NDB_MGM_NODE_TYPE_MIN = 0, /*/< Min valid value*/
NDB_MGM_NODE_TYPE_MAX = 2 /*/< Max valid value*/
NDB_MGM_NODE_TYPE_MAX = 3 /*/< Max valid value*/
};
/**
......@@ -199,6 +200,8 @@ extern "C" {
int node_group; ///< Node group of node
///< (only valid for DB nodes)
int version; ///< Internal version number
int connect_count; ///< No of times node has connected
///< or disconnected to the mgm srv
};
/**
......@@ -654,6 +657,36 @@ extern "C" {
int ndb_mgm_exit_single_user(NdbMgmHandle handle,
struct ndb_mgm_reply* reply);
/**
* Get configuration
* @param handle NDB management handle.
* @param version Version of configuration, 0 means latest
* @see MAKE_VERSION
* @Note the caller must free the pointer returned.
*/
struct ndb_mgm_configuration * ndb_mgm_get_configuration(NdbMgmHandle handle,
unsigned version);
/**
* Config iterator
*/
typedef struct ndb_mgm_configuration_iterator ndb_mgm_configuration_iterator;
ndb_mgm_configuration_iterator* ndb_mgm_create_configuration_iterator
(struct ndb_mgm_configuration *, unsigned type_of_section);
void ndb_mgm_destroy_iterator(ndb_mgm_configuration_iterator*);
int ndb_mgm_first(ndb_mgm_configuration_iterator*);
int ndb_mgm_next(ndb_mgm_configuration_iterator*);
int ndb_mgm_valid(const ndb_mgm_configuration_iterator*);
int ndb_mgm_find(ndb_mgm_configuration_iterator*,
int param, unsigned value);
int ndb_mgm_get_int_parameter(const ndb_mgm_configuration_iterator*,
int param, unsigned * value);
int ndb_mgm_get_int64_parameter(const ndb_mgm_configuration_iterator*,
int param, unsigned long long * value);
int ndb_mgm_get_string_parameter(const ndb_mgm_configuration_iterator*,
int param, const char ** value);
#ifdef __cplusplus
}
#endif
......
#ifndef MGMAPI_CONFIG_PARAMTERS_H
#define MGMAPI_CONFIG_PARAMTERS_H
#define CFG_SYS_NAME 3
#define CFG_SYS_PRIMARY_MGM_NODE 1
#define CFG_SYS_CONFIG_GENERATION 2
#define CFG_SYS_REPLICATION_ROLE 7
#define CFG_NODE_ID 3
#define CFG_NODE_BYTE_ORDER 4
#define CFG_NODE_HOST 5
#define CFG_NODE_SYSTEM 6
/**
* DB config parameters
*/
#define CFG_DB_NO_SAVE_MSGS 100
#define CFG_DB_NO_REPLICAS 101
#define CFG_DB_NO_TABLES 102
#define CFG_DB_NO_ATTRIBUTES 103
#define CFG_DB_NO_INDEXES 104
#define CFG_DB_NO_TRIGGERS 105
#define CFG_DB_NO_TRANSACTIONS 106
#define CFG_DB_NO_OPS 107
#define CFG_DB_NO_SCANS 108
#define CFG_DB_NO_TRIGGER_OPS 109
#define CFG_DB_NO_INDEX_OPS 110
#define CFG_DB_TRANS_BUFFER_MEM 111
#define CFG_DB_DATA_MEM 112
#define CFG_DB_INDEX_MEM 113
#define CFG_DB_MEMLOCK 114
#define CFG_DB_START_PARTIAL_TIMEOUT 115
#define CFG_DB_START_PARTITION_TIMEOUT 116
#define CFG_DB_START_FAILURE_TIMEOUT 117
#define CFG_DB_HEARTBEAT_INTERVAL 118
#define CFG_DB_API_HEARTBEAT_INTERVAL 119
#define CFG_DB_LCP_INTERVAL 120
#define CFG_DB_GCP_INTERVAL 121
#define CFG_DB_ARBIT_TIMEOUT 122
#define CFG_DB_WATCHDOG_INTERVAL 123
#define CFG_DB_STOP_ON_ERROR 124
#define CFG_DB_FILESYSTEM_PATH 125
#define CFG_DB_NO_REDOLOG_FILES 126
#define CFG_DB_DISC_BANDWIDTH 127
#define CFG_DB_SR_DISC_BANDWITH 128
#define CFG_DB_TRANSACTION_CHECK_INTERVAL 129
#define CFG_DB_TRANSACTION_INACTIVE_TIMEOUT 130
#define CFG_DB_TRANSACTION_DEADLOCK_TIMEOUT 131
#define CFG_DB_PARALLEL_BACKUPS 132
#define CFG_DB_BACKUP_MEM 133
#define CFG_DB_BACKUP_DATA_BUFFER_MEM 134
#define CFG_DB_BACKUP_LOG_BUFFER_MEM 135
#define CFG_DB_BACKUP_WRITE_SIZE 136
#define CFG_LOGLEVEL_STARTUP 137
#define CFG_LOGLEVEL_SHUTDOWN 138
#define CFG_LOGLEVEL_STATISTICS 139
#define CFG_LOGLEVEL_CHECKPOINT 140
#define CFG_LOGLEVEL_NODERESTART 141
#define CFG_LOGLEVEL_CONNECTION 142
#define CFG_LOGLEVEL_INFO 143
#define CFG_LOGLEVEL_WARNING 144
#define CFG_LOGLEVEL_ERROR 145
#define CFG_LOGLEVEL_GREP 146
#define CFG_LOG_DESTINATION 147
#define CFG_NODE_ARBIT_RANK 200
#define CFG_NODE_ARBIT_DELAY 201
#define CFG_MGM_PORT 300
#define CFG_CONNECTION_NODE_1 400
#define CFG_CONNECTION_NODE_2 401
#define CFG_CONNECTION_SEND_SIGNAL_ID 402
#define CFG_CONNECTION_CHECKSUM 403
#define CFG_CONNECTION_NODE_1_SYSTEM 404
#define CFG_CONNECTION_NODE_2_SYSTEM 405
#define CFG_TCP_HOSTNAME_1 450
#define CFG_TCP_HOSTNAME_2 451
#define CFG_TCP_SERVER 452
#define CFG_TCP_SERVER_PORT 453
#define CFG_TCP_SEND_BUFFER_SIZE 454
#define CFG_TCP_RECEIVE_BUFFER_SIZE 455
#define CFG_TCP_PROXY 456
#define CFG_SHM_SEND_SIGNAL_ID 500
#define CFG_SHM_CHECKSUM 501
#define CFG_SHM_KEY 502
#define CFG_SHM_BUFFER_MEM 503
#define CFG_SCI_ID_0 550
#define CFG_SCI_ID_1 551
#define CFG_SCI_SEND_LIMIT 552
#define CFG_SCI_BUFFER_MEM 553
#define CFG_SCI_NODE1_ADAPTERS 554
#define CFG_SCI_NODE1_ADAPTER0 555
#define CFG_SCI_NODE1_ADAPTER1 556
#define CFG_SCI_NODE2_ADAPTERS 554
#define CFG_SCI_NODE2_ADAPTER0 555
#define CFG_SCI_NODE2_ADAPTER1 556
#define CFG_OSE_HOSTNAME_1 600
#define CFG_OSE_HOSTNAME_2 601
#define CFG_OSE_PRIO_A_SIZE 602
#define CFG_OSE_PRIO_B_SIZE 603
#define CFG_OSE_RECEIVE_ARRAY_SIZE 604
#define CFG_REP_HEARTBEAT_INTERVAL 700
/**
* Internal
*/
#define CFG_DB_STOP_ON_ERROR_INSERT 1
#define CFG_TYPE_OF_SECTION 999
#define CFG_SECTION_SYSTEM 1000
#define CFG_SECTION_NODE 2000
#define CFG_SECTION_CONNECTION 3000
#define NODE_TYPE_DB 0
#define NODE_TYPE_API 1
#define NODE_TYPE_MGM 2
#define NODE_TYPE_REP 3
#define NODE_TYPE_EXT_REP 4
#define CONNECTION_TYPE_TCP 0
#define CONNECTION_TYPE_SHM 1
#define CONNECTION_TYPE_SCI 2
#define CONNECTION_TYPE_OSE 3
#endif
#ifndef MGMAPI_CONFIG_PARAMTERS_DEBUG_H
#define MGMAPI_CONFIG_PARAMTERS_DEBUG_H
#include "mgmapi_config_parameters.h"
#define CFG_DB_STOP_ON_ERROR_INSERT 1
#endif
......@@ -18,7 +18,7 @@
#define ConfigRetriever_H
#include <ndb_types.h>
#include <Properties.hpp>
#include <mgmapi.h>
/**
* @class ConfigRetriever
......@@ -44,11 +44,11 @@ public:
* to establish a connection. This is repeated until a connection is
* established, so the function hangs until a connection is established.
*
* @return Properties object if succeeded,
* @return ndb_mgm_configuration object if succeeded,
* NULL if erroneous local config file or configuration error.
*/
class Properties * getConfig(const char * nodeType, int versionId);
struct ndb_mgm_configuration * getConfig(int versionId, int nodeType);
const char * getErrorString();
/**
......@@ -71,22 +71,17 @@ public:
* @return Node id of this node (as stated in local config or connectString)
*/
inline Uint32 getOwnNodeId() { return _ownNodeId; }
/**
* Get configuration object
*/
class Properties * getConfig(int versionId);
/**
* Get config using socket
*/
class Properties * getConfig(const char * mgmhost, unsigned int port,
Uint32 nodeId, int versionId);
struct ndb_mgm_configuration * getConfig(const char * mgmhost, short port,
int versionId);
/**
* Get config from file
*/
class Properties * getConfig(const char * filename, Uint32 nodeId,
int versionId);
struct ndb_mgm_configuration * getConfig(const char * file, int versionId);
private:
char * errorString;
enum ErrorType {
......@@ -97,18 +92,17 @@ private:
void setError(ErrorType, const char * errorMsg);
/**
* Verifies that received configuration is correct
*/
bool verifyProperties(const char* nodeType, Properties *p,
Uint32 nodeId, int versionId);
char * _localConfigFileName;
struct LocalConfig * _localConfig;
int _ownNodeId;
char * m_connectString;
char * m_defaultConnectString;
/**
* Verify config
*/
bool verifyConfig(const struct ndb_mgm_configuration *, int type);
};
#endif
......
......@@ -58,6 +58,10 @@ public:
void print() const { props->print(); }
static Uint32 configureTransporters(Uint32 nodeId,
const class ndb_mgm_configuration &,
class TransporterRegistry &);
private:
NodeId the_ownId;
Properties * props;
......
......@@ -20,7 +20,8 @@
#include <UtilBuffer.hpp>
#include <BaseString.hpp>
int base64_encode(UtilBuffer &src, BaseString &dst);
int base64_decode(BaseString &src, UtilBuffer &dst);
int base64_encode(const UtilBuffer &src, BaseString &dst);
int base64_decode(const BaseString &src, UtilBuffer &dst);
int base64_decode(const char * s, size_t len, UtilBuffer &dst);
#endif /* !__BASE64_HPP_INCLUDED__ */
......@@ -134,7 +134,7 @@ public:
/**
* getText - Return as hex-digits (only for debug routines).
*/
static void getText(unsigned size, const Uint32 data[], char* buf);
static char* getText(unsigned size, const Uint32 data[], char* buf);
};
inline bool
......@@ -302,9 +302,10 @@ BitmaskImpl::setField(unsigned size, Uint32 data[],
set(size, data, pos + i, val & (1 << i));
}
inline void
inline char *
BitmaskImpl::getText(unsigned size, const Uint32 data[], char* buf)
{
char * org = buf;
const char* const hex = "0123456789abcdef";
for (int i = (size-1); i >= 0; i--) {
Uint32 x = data[i];
......@@ -315,6 +316,7 @@ BitmaskImpl::getText(unsigned size, const Uint32 data[], char* buf)
buf += 8;
}
*buf = 0;
return org;
}
/**
......@@ -333,7 +335,7 @@ public:
Uint32 data[size];
#if 0
Data & operator=(const Bitmask<size> & src) {
src.assign(size, data);
src.copyto(size, data);
return *this;
}
#endif
......@@ -346,6 +348,8 @@ public:
STATIC_CONST( NotFound = BitmaskImpl::NotFound );
STATIC_CONST( TextLength = size * 8 );
Bitmask() { clear();}
/**
* assign - Set all bits in <em>dst</em> to corresponding in <em>src/<em>
*/
......@@ -359,9 +363,9 @@ public:
void assign(const Bitmask<size> & src);
/**
* assign <em>dst</em> of size <em>sz</em> to <em>this</em>
* copy this to <em>dst</em>
*/
void assign(unsigned sz, Uint32 dst[]) const;
void copyto(unsigned sz, Uint32 dst[]) const;
/**
* assign <em>this</em> according to <em>src/em>
......@@ -469,7 +473,7 @@ public:
/**
* getText - Return as hex-digits (only for debug routines).
*/
static void getText(const Uint32 data[], char* buf);
static char* getText(const Uint32 data[], char* buf);
char* getText(char* buf) const;
};
......@@ -498,12 +502,12 @@ template <unsigned size>
inline void
Bitmask<size>::assign(const Bitmask<size> & src)
{
assign(rep.data, src);
assign(rep.data, src.rep.data);
}
template <unsigned size>
inline void
Bitmask<size>::assign(unsigned sz, Uint32 dst[]) const
Bitmask<size>::copyto(unsigned sz, Uint32 dst[]) const
{
BitmaskImpl::assign(sz, dst, rep.data);
}
......@@ -716,18 +720,17 @@ Bitmask<size>::bitXOR(const Bitmask<size>& mask2)
}
template <unsigned size>
void
char *
Bitmask<size>::getText(const Uint32 data[], char* buf)
{
BitmaskImpl::getText(size, data, buf);
return BitmaskImpl::getText(size, data, buf);
}
template <unsigned size>
inline char *
Bitmask<size>::getText(char* buf) const
{
getText(rep.data, buf);
return buf;
return getText(rep.data, buf);
}
template <unsigned size>
......
#ifndef __CONFIG_VALUES_HPP
#define __CONFIG_VALUES_HPP
#include <ndb_types.h>
#include <UtilBuffer.hpp>
class ConfigValues {
friend class ConfigValuesFactory;
ConfigValues(Uint32 sz, Uint32 data);
public:
~ConfigValues();
enum ValueType {
InvalidType = 0,
IntType = 1,
StringType = 2,
SectionType = 3,
Int64Type = 4
};
struct Entry {
Uint32 m_key;
ValueType m_type;
union {
Uint32 m_int;
const char * m_string;
Uint64 m_int64;
};
};
class ConstIterator {
friend class ConfigValuesFactory;
const ConfigValues & m_cfg;
protected:
Uint32 m_currentSection;
public:
ConstIterator(const ConfigValues&c) : m_cfg(c) { m_currentSection = 0;}
bool openSection(Uint32 key, Uint32 no);
bool closeSection();
bool get(Uint32 key, Entry *) const;
bool get(Uint32 key, Uint32 * value) const;
bool get(Uint32 key, Uint64 * value) const;
bool get(Uint32 key, const char ** value) const;
bool getTypeOf(Uint32 key, ValueType * type) const;
Uint32 get(Uint32 key, Uint32 notFound) const;
Uint64 get64(Uint32 key, Uint64 notFound) const;
const char * get(Uint32 key, const char * notFound) const;
ValueType getTypeOf(Uint32 key) const;
};
class Iterator : public ConstIterator {
ConfigValues & m_cfg;
public:
Iterator(ConfigValues&c) : ConstIterator(c), m_cfg(c) {}
bool set(Uint32 key, Uint32 value);
bool set(Uint32 key, Uint64 value);
bool set(Uint32 key, const char * value);
};
Uint32 getPackedSize() const; // get size in bytes needed to pack
Uint32 pack(UtilBuffer&) const;
Uint32 pack(void * dst, Uint32 len) const;// pack into dst(of len %d);
private:
friend class Iterator;
friend class ConstIterator;
bool getByPos(Uint32 pos, Entry *) const;
Uint64 & get64(Uint32 index) const;
char * & getString(Uint32 index) const;
Uint32 m_size;
Uint32 m_dataSize;
Uint32 m_stringCount;
Uint32 m_int64Count;
Uint32 m_values[1];
void * m_data[1];
};
class ConfigValuesFactory {
Uint32 m_currentSection;
public:
Uint32 m_sectionCounter;
Uint32 m_freeKeys;
Uint32 m_freeData;
public:
ConfigValuesFactory(Uint32 keys = 50, Uint32 data = 10); // Initial
ConfigValuesFactory(ConfigValues * m_cfg); //
ConfigValues * m_cfg;
ConfigValues * getConfigValues();
bool openSection(Uint32 key, Uint32 no);
bool put(const ConfigValues::Entry & );
bool put(Uint32 key, Uint32 value);
bool put64(Uint32 key, Uint64 value);
bool put(Uint32 key, const char * value);
bool closeSection();
void expand(Uint32 freeKeys, Uint32 freeData);
void shrink();
bool unpack(const UtilBuffer&);
bool unpack(const void * src, Uint32 len);
static ConfigValues * extractCurrentSection(const ConfigValues::ConstIterator &);
private:
static ConfigValues * create(Uint32 keys, Uint32 data);
void put(const ConfigValues & src);
};
inline
bool
ConfigValues::ConstIterator::get(Uint32 key, Uint32 * value) const {
Entry tmp;
if(get(key, &tmp) && tmp.m_type == IntType){
* value = tmp.m_int;
return true;
}
return false;
}
inline
bool
ConfigValues::ConstIterator::get(Uint32 key, Uint64 * value) const {
Entry tmp;
if(get(key, &tmp) && tmp.m_type == Int64Type){
* value = tmp.m_int64;
return true;
}
return false;
}
inline
bool
ConfigValues::ConstIterator::get(Uint32 key, const char ** value) const {
Entry tmp;
if(get(key, &tmp) && tmp.m_type == StringType){
* value = tmp.m_string;
return true;
}
return false;
}
inline
bool
ConfigValues::ConstIterator::getTypeOf(Uint32 key, ValueType * type) const{
Entry tmp;
if(get(key, &tmp)){
* type = tmp.m_type;
return true;
}
return false;
}
inline
Uint32
ConfigValues::ConstIterator::get(Uint32 key, Uint32 notFound) const {
Entry tmp;
if(get(key, &tmp) && tmp.m_type == IntType){
return tmp.m_int;
}
return notFound;
}
inline
Uint64
ConfigValues::ConstIterator::get64(Uint32 key, Uint64 notFound) const {
Entry tmp;
if(get(key, &tmp) && tmp.m_type == Int64Type){
return tmp.m_int64;
}
return notFound;
}
inline
const char *
ConfigValues::ConstIterator::get(Uint32 key, const char * notFound) const {
Entry tmp;
if(get(key, &tmp) && tmp.m_type == StringType){
return tmp.m_string;
}
return notFound;
}
inline
ConfigValues::ValueType
ConfigValues::ConstIterator::getTypeOf(Uint32 key) const{
Entry tmp;
if(get(key, &tmp)){
return tmp.m_type;
}
return ConfigValues::InvalidType;
}
inline
bool
ConfigValuesFactory::put(Uint32 key, Uint32 val){
ConfigValues::Entry tmp;
tmp.m_key = key;
tmp.m_type = ConfigValues::IntType;
tmp.m_int = val;
return put(tmp);
}
inline
bool
ConfigValuesFactory::put64(Uint32 key, Uint64 val){
ConfigValues::Entry tmp;
tmp.m_key = key;
tmp.m_type = ConfigValues::Int64Type;
tmp.m_int64 = val;
return put(tmp);
}
inline
bool
ConfigValuesFactory::put(Uint32 key, const char * val){
ConfigValues::Entry tmp;
tmp.m_key = key;
tmp.m_type = ConfigValues::StringType;
tmp.m_string = val;
return put(tmp);
}
inline
Uint32
ConfigValues::pack(UtilBuffer& buf) const {
Uint32 len = getPackedSize();
void * tmp = buf.append(len);
if(tmp == 0){
return 0;
}
return pack(tmp, len);
}
inline
bool
ConfigValuesFactory::unpack(const UtilBuffer& buf){
return unpack(buf.get_data(), buf.length());
}
#endif
......@@ -22,9 +22,10 @@
#include <UtilBuffer.hpp>
enum PropertiesType {
PropertiesType_Uint32,
PropertiesType_char,
PropertiesType_Properties
PropertiesType_Uint32 = 0,
PropertiesType_char = 1,
PropertiesType_Properties = 2,
PropertiesType_Uint64 = 3
};
/**
......@@ -36,6 +37,7 @@ enum PropertiesType {
*/
struct Property {
Property(const char* name, Uint32 val);
Property(const char* name, Uint64 val);
Property(const char* name, const char * value);
Property(const char* name, const class Properties * value);
~Property();
......@@ -75,6 +77,7 @@ public:
void put(const Property *, int len);
bool put(const char * name, Uint32 value, bool replace = false);
bool put64(const char * name, Uint64 value, bool replace = false);
bool put(const char * name, const char * value, bool replace = false);
bool put(const char * name, const Properties * value, bool replace = false);
......@@ -84,6 +87,7 @@ public:
* Compare get(name, no)
*/
bool put(const char *, Uint32 no, Uint32, bool replace = false);
bool put64(const char *, Uint32 no, Uint64, bool replace = false);
bool put(const char *, Uint32 no, const char *, bool replace = false);
bool put(const char *, Uint32 no, const Properties *, bool replace = false);
......@@ -94,6 +98,7 @@ public:
bool contains(const char * name) const;
bool get(const char * name, Uint32 * value) const;
bool get(const char * name, Uint64 * value) const;
bool get(const char * name, const char ** value) const;
bool get(const char * name, BaseString & value) const;
bool get(const char * name, const Properties ** value) const;
......@@ -109,6 +114,7 @@ public:
bool contains(const char * name, Uint32 no) const;
bool get(const char * name, Uint32 no, Uint32 * value) const;
bool get(const char * name, Uint32 no, Uint64 * value) const;
bool get(const char * name, Uint32 no, const char ** value) const;
bool get(const char * name, Uint32 no, const Properties ** value) const;
......@@ -230,11 +236,12 @@ Properties::unpack(UtilBuffer &buf) {
inline bool
Properties::pack(UtilBuffer &buf) const {
Uint32 size = getPackedSize();
char *tmp_buf = new char[size];
void *tmp_buf = buf.append(size);
if(tmp_buf == 0)
return false;
bool ret = pack((Uint32 *)tmp_buf);
if(ret == false)
return false;
buf.append(tmp_buf, size);
return true;
}
......
......@@ -63,6 +63,15 @@ public:
return 0;
};
void * append(size_t l){
if(grow(len+l) != 0)
return 0;
void * ret = (char*)data+len;
len += l;
return ret;
}
int assign(const void * d, size_t l) {
if (data) free(data);
data = NULL;
......
......@@ -17,13 +17,14 @@
#include <LogLevel.hpp>
const LogLevel::LogLevelCategoryName LogLevel::LOGLEVEL_CATEGORY_NAME[] = {
{"LogLevelStartup"},
{"LogLevelShutdown"},
{"LogLevelStatistic"},
{"LogLevelCheckpoint"},
{"LogLevelNodeRestart"},
{"LogLevelConnection"},
{"LogLevelError"},
{"LogLevelInfo"},
{"LogLevelGrep"}
{ "LogLevelStartup" },
{ "LogLevelShutdown" },
{ "LogLevelStatistic" },
{ "LogLevelCheckpoint" },
{ "LogLevelNodeRestart" },
{ "LogLevelConnection" },
{ "LogLevelError" },
{ "LogLevelWarning" },
{ "LogLevelInfo" },
{ "LogLevelGrep" }
};
#include <signaldata/CntrStart.hpp>
bool
printCNTR_START_REQ(FILE * output, const Uint32 * theData,
Uint32 len, Uint16 receiverBlockNo) {
const CntrStartReq * const sig = (CntrStartReq *)theData;
fprintf(output, " nodeId: %x\n", sig->nodeId);
fprintf(output, " startType: %x\n", sig->startType);
fprintf(output, " lastGci: %x\n", sig->lastGci);
return true;
}
bool
printCNTR_START_REF(FILE * output, const Uint32 * theData,
Uint32 len, Uint16 receiverBlockNo) {
const CntrStartRef * const sig = (CntrStartRef *)theData;
fprintf(output, " errorCode: %x\n", sig->errorCode);
fprintf(output, " masterNodeId: %x\n", sig->masterNodeId);
return true;
}
bool
printCNTR_START_CONF(FILE * output, const Uint32 * theData,
Uint32 len, Uint16 receiverBlockNo) {
const CntrStartConf * const sig = (CntrStartConf *)theData;
fprintf(output, " startType: %x\n", sig->startType);
fprintf(output, " startGci: %x\n", sig->startGci);
fprintf(output, " masterNodeId: %x\n", sig->masterNodeId);
fprintf(output, " noStartNodes: %x\n", sig->noStartNodes);
char buf[32*NdbNodeBitmask::Size+1];
fprintf(output, " startedNodes: %s\n",
BitmaskImpl::getText(NdbNodeBitmask::Size, sig->startedNodes, buf));
fprintf(output, " startingNodes: %s\n",
BitmaskImpl::getText(NdbNodeBitmask::Size, sig->startingNodes, buf));
return true;
}
......@@ -25,6 +25,7 @@ SOURCES = TcKeyReq.cpp TcKeyConf.cpp TcKeyRef.cpp \
CopyGCI.cpp SystemError.cpp StartRec.cpp NFCompleteRep.cpp \
FailRep.cpp DisconnectRep.cpp SignalDroppedRep.cpp \
SumaImpl.cpp NdbSttor.cpp CreateFragmentation.cpp \
CntrStart.cpp ReadNodesConf.cpp \
UtilLock.cpp TuxMaint.cpp TupAccess.cpp AccLock.cpp \
LqhTrans.cpp
......
#include <signaldata/ReadNodesConf.hpp>
bool
printREAD_NODES_CONF(FILE * output, const Uint32 * theData,
Uint32 len, Uint16 receiverBlockNo) {
const ReadNodesConf * const sig = (ReadNodesConf *)theData;
fprintf(output, " noOfNodes: %x\n", sig->noOfNodes);
fprintf(output, " ndynamicId: %x\n", sig->ndynamicId);
fprintf(output, " masterNodeId: %x\n", sig->masterNodeId);
char buf[32*NdbNodeBitmask::Size+1];
fprintf(output, " allNodes(defined): %s\n",
BitmaskImpl::getText(NdbNodeBitmask::Size, sig->allNodes, buf));
fprintf(output, " inactiveNodes: %s\n",
BitmaskImpl::getText(NdbNodeBitmask::Size, sig->inactiveNodes, buf));
fprintf(output, " clusterNodes: %s\n",
BitmaskImpl::getText(NdbNodeBitmask::Size, sig->clusterNodes, buf));
fprintf(output, " startedNodes: %s\n",
BitmaskImpl::getText(NdbNodeBitmask::Size, sig->startedNodes, buf));
fprintf(output, " startingNodes: %s\n",
BitmaskImpl::getText(NdbNodeBitmask::Size, sig->startingNodes, buf));
return true;
}
......@@ -70,6 +70,8 @@
#include <signaldata/NdbSttor.hpp>
#include <signaldata/CreateFragmentation.hpp>
#include <signaldata/UtilLock.hpp>
#include <signaldata/CntrStart.hpp>
#include <signaldata/ReadNodesConf.hpp>
#include <signaldata/TuxMaint.hpp>
#include <signaldata/TupAccess.hpp>
#include <signaldata/AccLock.hpp>
......@@ -240,6 +242,12 @@ SignalDataPrintFunctions[] = {
,{ GSN_UTIL_UNLOCK_REQ, printUTIL_UNLOCK_REQ }
,{ GSN_UTIL_UNLOCK_REF, printUTIL_UNLOCK_REF }
,{ GSN_UTIL_UNLOCK_CONF, printUTIL_UNLOCK_CONF }
,{ GSN_CNTR_START_REQ, printCNTR_START_REQ }
,{ GSN_CNTR_START_REF, printCNTR_START_REF }
,{ GSN_CNTR_START_CONF, printCNTR_START_CONF }
,{ GSN_READ_NODESCONF, printREAD_NODES_CONF }
,{ GSN_TUX_MAINT_REQ, printTUX_MAINT_REQ }
,{ GSN_TUP_READ_ATTRS, printTUP_READ_ATTRS }
,{ GSN_TUP_QUERY_TH, printTUP_QUERY_TH }
......
......@@ -101,40 +101,23 @@ const GsnName SignalNames [] = {
,{ GSN_ADD_FRAGREQ, "ADD_FRAGREQ" }
,{ GSN_API_FAILCONF, "API_FAILCONF" }
,{ GSN_API_FAILREQ, "API_FAILREQ" }
,{ GSN_APPL_CHANGEREP, "APPL_CHANGEREP" }
// ,{ GSN_APPL_ERROR, "APPL_ERROR" }
,{ GSN_APPL_HB, "APPL_HB" }
,{ GSN_APPL_HBREQ, "APPL_HBREQ" }
,{ GSN_APPL_REGCONF, "APPL_REGCONF" }
,{ GSN_APPL_REGREF, "APPL_REGREF" }
,{ GSN_APPL_REGREQ, "APPL_REGREQ" }
,{ GSN_APPL_RUN, "APPL_RUN" }
,{ GSN_APPL_STARTCONF, "APPL_STARTCONF" }
,{ GSN_APPL_STARTREG, "APPL_STARTREG" }
,{ GSN_CHECK_LCP_STOP, "CHECK_LCP_STOP" }
,{ GSN_CLOSE_COMCONF, "CLOSE_COMCONF" }
,{ GSN_CLOSE_COMREQ, "CLOSE_COMREQ" }
,{ GSN_CM_ACKADD, "CM_ACKADD" }
,{ GSN_CM_ACKALARM, "CM_ACKALARM" }
,{ GSN_CM_ADD, "CM_ADD" }
,{ GSN_CM_APPCHG, "CM_APPCHG" }
,{ GSN_CM_ADD_REP, "CM_ADD_REP" }
,{ GSN_CM_HEARTBEAT, "CM_HEARTBEAT" }
,{ GSN_CM_INFOCONF, "CM_INFOCONF" }
,{ GSN_CM_INFOREQ, "CM_INFOREQ" }
,{ GSN_CM_INIT, "CM_INIT" }
,{ GSN_CM_NODEINFOCONF, "CM_NODEINFOCONF" }
,{ GSN_CM_NODEINFOREF, "CM_NODEINFOREF" }
,{ GSN_CM_NODEINFOREQ, "CM_NODEINFOREQ" }
,{ GSN_CM_REGCONF, "CM_REGCONF" }
,{ GSN_CM_REGREF, "CM_REGREF" }
,{ GSN_CM_REGREQ, "CM_REGREQ" }
,{ GSN_CM_RUN, "CM_RUN" }
,{ GSN_CMVMI_CFGCONF, "CMVMI_CFGCONF" }
,{ GSN_CMVMI_CFGREQ, "CMVMI_CFGREQ" }
,{ GSN_CNTR_CHANGEREP, "CNTR_CHANGEREP" }
,{ GSN_CNTR_MASTERCONF, "CNTR_MASTERCONF" }
,{ GSN_CNTR_MASTERREF, "CNTR_MASTERREF" }
,{ GSN_CNTR_MASTERREQ, "CNTR_MASTERREQ" }
,{ GSN_CNTR_START_REQ, "CNTR_START_REQ" }
,{ GSN_CNTR_START_REF, "CNTR_START_REF" }
,{ GSN_CNTR_START_CONF, "CNTR_START_CONF" }
,{ GSN_CNTR_START_REP, "CNTR_START_REP" }
,{ GSN_CNTR_WAITREP, "CNTR_WAITREP" }
,{ GSN_COMMIT, "COMMIT" }
,{ GSN_COMMIT_FAILCONF, "COMMIT_FAILCONF" }
......@@ -294,9 +277,6 @@ const GsnName SignalNames [] = {
,{ GSN_NEXT_SCANREQ, "NEXT_SCANREQ" }
,{ GSN_NEXTOPERATION, "NEXTOPERATION" }
,{ GSN_NF_COMPLETEREP, "NF_COMPLETEREP" }
,{ GSN_NODE_STATESCONF, "NODE_STATESCONF" }
,{ GSN_NODE_STATESREF, "NODE_STATESREF" }
,{ GSN_NODE_STATESREQ, "NODE_STATESREQ" }
,{ GSN_OPEN_COMCONF, "OPEN_COMCONF" }
,{ GSN_OPEN_COMREF, "OPEN_COMREF" }
,{ GSN_OPEN_COMREQ, "OPEN_COMREQ" }
......@@ -318,8 +298,8 @@ const GsnName SignalNames [] = {
,{ GSN_SEND_PACKED, "SEND_PACKED" }
,{ GSN_SET_LOGLEVELORD, "SET_LOGLEVELORD" }
,{ GSN_SHRINKCHECK2, "SHRINKCHECK2" }
,{ GSN_SIZEALT_ACK, "SIZEALT_ACK" }
,{ GSN_SIZEALT_REP, "SIZEALT_REP" }
,{ GSN_READ_CONFIG_REQ, "READ_CONFIG_REQ" }
,{ GSN_READ_CONFIG_CONF, "READ_CONFIG_CONF" }
,{ GSN_SR_FRAGIDCONF, "SR_FRAGIDCONF" }
,{ GSN_SR_FRAGIDREF, "SR_FRAGIDREF" }
,{ GSN_SR_FRAGIDREQ, "SR_FRAGIDREQ" }
......@@ -396,7 +376,6 @@ const GsnName SignalNames [] = {
,{ GSN_UPDATE_TOCONF, "UPDATE_TOCONF" }
,{ GSN_UPDATE_TOREF, "UPDATE_TOREF" }
,{ GSN_UPDATE_TOREQ, "UPDATE_TOREQ" }
,{ GSN_VOTE_MASTERORD, "VOTE_MASTERORD" }
,{ GSN_TUP_ALLOCREQ, "TUP_ALLOCREQ" }
,{ GSN_LQH_ALLOCREQ, "LQH_ALLOCREQ" }
,{ GSN_TUP_DEALLOCREQ, "TUP_DEALLOCREQ" }
......@@ -428,7 +407,6 @@ const GsnName SignalNames [] = {
,{ GSN_CHECKNODEGROUPSREQ, "CHECKNODEGROUPSREQ" }
,{ GSN_CHECKNODEGROUPSCONF, "CHECKNODEGROUPSCONF" }
,{ GSN_ARBIT_CFG, "ARBIT_CFG" }
,{ GSN_ARBIT_PREPREQ, "ARBIT_PREPREQ" }
,{ GSN_ARBIT_PREPCONF, "ARBIT_PREPCONF" }
,{ GSN_ARBIT_PREPREF, "ARBIT_PREPREF" }
......
......@@ -26,23 +26,17 @@
//*****************************************************************************
Config::Config() {
m_info = new ConfigInfo();
}
Config::Config(const Config & org) :
Properties(org) {
m_info = new ConfigInfo();
}
Config::Config(const Properties & org) :
Properties(org) {
m_info = new ConfigInfo();
m_oldConfig = 0;
m_configValues = 0;
}
Config::~Config() {
delete m_info;
if(m_configValues != 0){
free(m_configValues);
}
if(m_oldConfig != 0)
delete m_oldConfig;
}
/*****************************************************************************/
......@@ -52,25 +46,33 @@ Config::printAllNameValuePairs(NdbOut &out,
const Properties *prop,
const char* s) const {
Properties::Iterator it(prop);
const Properties * section = m_info->getInfo(s);
const Properties * section = m_info.getInfo(s);
for (const char* n = it.first(); n != NULL; n = it.next()) {
Uint32 int_value;
const char* str_value;
Uint64 int_64;
if (m_info->getStatus(section, n) == ConfigInfo::INTERNAL)
if(!section->contains(n))
continue;
if (m_info->getStatus(section, n) == ConfigInfo::DEPRICATED)
if (m_info.getStatus(section, n) == ConfigInfo::INTERNAL)
continue;
if (m_info->getStatus(section, n) == ConfigInfo::NOTIMPLEMENTED)
if (m_info.getStatus(section, n) == ConfigInfo::DEPRICATED)
continue;
if (m_info.getStatus(section, n) == ConfigInfo::NOTIMPLEMENTED)
continue;
out << n << ": ";
switch (m_info->getType(section, n)) {
switch (m_info.getType(section, n)) {
case ConfigInfo::INT:
MGM_REQUIRE(prop->get(n, &int_value));
out << int_value;
break;
case ConfigInfo::INT64:
MGM_REQUIRE(prop->get(n, &int_64));
out << int_64;
break;
case ConfigInfo::BOOL:
MGM_REQUIRE(prop->get(n, &int_value));
......@@ -92,6 +94,7 @@ Config::printAllNameValuePairs(NdbOut &out,
/*****************************************************************************/
void Config::printConfigFile(NdbOut &out) const {
#if 0
Uint32 noOfNodes, noOfConnections, noOfComputers;
MGM_REQUIRE(get("NoOfNodes", &noOfNodes));
MGM_REQUIRE(get("NoOfConnections", &noOfConnections));
......@@ -172,15 +175,12 @@ void Config::printConfigFile(NdbOut &out) const {
endl;
}
}
}
const
ConfigInfo* Config::getConfigInfo() const {
return m_info;
#endif
}
Uint32
Config::getGenerationNumber() const {
#if 0
Uint32 ret;
const Properties *prop = NULL;
......@@ -191,10 +191,14 @@ Config::getGenerationNumber() const {
return ret;
return 0;
#else
return 0;
#endif
}
int
Config::setGenerationNumber(Uint32 gen) {
#if 0
Properties *prop = NULL;
getCopy("SYSTEM", &prop);
......@@ -205,12 +209,16 @@ Config::setGenerationNumber(Uint32 gen) {
return 0;
}
return -1;
#else
return -1;
#endif
}
bool
Config::change(const BaseString &section,
const BaseString &param,
const BaseString &value) {
#if 0
const char *name;
Properties::Iterator it(this);
......@@ -252,4 +260,7 @@ Config::change(const BaseString &section,
}
}
return true;
#else
return false;
#endif
}
......@@ -17,7 +17,6 @@
#ifndef Config_H
#define Config_H
#include <signaldata/ConfigParamId.hpp>
#include <LogLevel.hpp>
#include <kernel_types.h>
......@@ -25,6 +24,9 @@
#include <NdbOut.hpp>
#include <ndb_limits.h>
#include <Properties.hpp>
#include "ConfigInfo.hpp"
class ConfigInfo;
/**
* @class Config
......@@ -38,14 +40,14 @@
*
* The following categories (sections) of configuration parameters exists:
* - COMPUTER, DB, MGM, API, TCP, SCI, SHM, OSE
*
*/
class Config : public Properties {
class Config {
public:
/**
* Constructor which loads the object with an Properties object
*/
Config(const Config & org);
Config(const Properties & org);
Config();
virtual ~Config();
......@@ -58,8 +60,6 @@ public:
printConfigFile(ndb);
}
const class ConfigInfo* getConfigInfo() const;
Uint32 getGenerationNumber() const;
int setGenerationNumber(Uint32);
......@@ -69,7 +69,13 @@ public:
const BaseString &param,
const BaseString &value);
/**
* Info
*/
const ConfigInfo * getConfigInfo() const { return &m_info;}
private:
ConfigInfo m_info;
void printAllNameValuePairs(NdbOut &out,
const Properties *prop,
......@@ -78,7 +84,9 @@ private:
/**
* Information about parameters (min, max values etc)
*/
const class ConfigInfo* m_info;
public:
Properties * m_oldConfig;
struct ndb_mgm_configuration * m_configValues;
};
#endif // Config_H
This diff is collapsed.
......@@ -27,8 +27,8 @@
* A MANDATORY parameters must be specified in the config file
* An UNDEFINED parameter may or may not be specified in the config file
*/
static const Uint32 MANDATORY = ~0; // Default value for mandatory params.
static const Uint32 UNDEFINED = (~0)-1; // Default value for undefined params.
static const Uint64 MANDATORY = ~0; // Default value for mandatory params.
static const Uint64 UNDEFINED = (~0)-1; // Default value for undefined params.
/**
* @class ConfigInfo
......@@ -38,27 +38,27 @@ static const Uint32 UNDEFINED = (~0)-1; // Default value for undefined params.
*/
class ConfigInfo {
public:
enum Type {BOOL, INT, STRING};
enum Status {USED, ///< Active
DEPRICATED, ///< Can be, but should not be used anymore
NOTIMPLEMENTED, ///< Can not be used currently. Is ignored.
INTERNAL ///< Not configurable by the user
enum Type { BOOL, INT, INT64, STRING, SECTION };
enum Status { USED, ///< Active
DEPRICATED, ///< Can be, but shouldn't
NOTIMPLEMENTED, ///< Is ignored.
INTERNAL ///< Not configurable by the user
};
/**
* Entry for one configuration parameter
*/
struct ParamInfo {
Uint32 _paramId;
const char* _fname;
const char* _pname;
const char* _section;
const char* _description;
Status _status;
bool _updateable;
Type _type;
Uint32 _default;
Uint32 _min;
Uint32 _max;
Uint64 _default;
Uint64 _min;
Uint64 _max;
};
/**
......@@ -84,16 +84,15 @@ public:
*
* @note Result is not defined if section/name are wrong!
*/
bool verify(const Properties* section, const char* fname, Uint32 value) const;
bool verify(const Properties* secti, const char* fname, Uint64 value) const;
bool isSection(const char*) const;
const char* getPName(const Properties * section, const char* fname) const;
const char* getDescription(const Properties * section, const char* fname) const;
const char* getDescription(const Properties * sec, const char* fname) const;
Type getType(const Properties * section, const char* fname) const;
Status getStatus(const Properties* section, const char* fname) const;
Uint32 getMin(const Properties * section, const char* fname) const;
Uint32 getMax(const Properties * section, const char* fname) const;
Uint32 getDefault(const Properties * section, const char* fname) const;
Uint64 getMin(const Properties * section, const char* fname) const;
Uint64 getMax(const Properties * section, const char* fname) const;
Uint64 getDefault(const Properties * section, const char* fname) const;
const Properties * getInfo(const char * section) const;
const Properties * getDefaults(const char * section) const;
......
......@@ -17,10 +17,14 @@
#include "IPCConfig.hpp"
#include <NdbOut.hpp>
#include <NdbHost.h>
#include <TransporterDefinitions.hpp>
#include <TransporterRegistry.hpp>
#include <Properties.hpp>
#include <mgmapi_configuration.hpp>
#include <mgmapi_config_parameters.h>
#if defined DEBUG_TRANSPORTER
#define DEBUG(t) ndbout << __FILE__ << ":" << __LINE__ << ":" << t << endl;
#else
......@@ -334,3 +338,158 @@ IPCConfig::getNodeType(NodeId id) const {
return out;
}
Uint32
IPCConfig::configureTransporters(Uint32 nodeId,
const class ndb_mgm_configuration & config,
class TransporterRegistry & tr){
Uint32 noOfTransportersCreated = 0;
ndb_mgm_configuration_iterator iter(config, CFG_SECTION_CONNECTION);
for(iter.first(); iter.valid(); iter.next()){
Uint32 nodeId1, nodeId2, remoteNodeId;
if(iter.get(CFG_CONNECTION_NODE_1, &nodeId1)) continue;
if(iter.get(CFG_CONNECTION_NODE_2, &nodeId2)) continue;
if(nodeId1 != nodeId && nodeId2 != nodeId) continue;
remoteNodeId = (nodeId == nodeId1 ? nodeId2 : nodeId1);
Uint32 sendSignalId = 1;
Uint32 checksum = 1;
if(iter.get(CFG_CONNECTION_SEND_SIGNAL_ID, &sendSignalId)) continue;
if(iter.get(CFG_CONNECTION_CHECKSUM, &checksum)) continue;
Uint32 type = ~0;
if(iter.get(CFG_TYPE_OF_SECTION, &type)) continue;
switch(type){
case CONNECTION_TYPE_SHM:{
SHM_TransporterConfiguration conf;
conf.localNodeId = nodeId;
conf.remoteNodeId = remoteNodeId;
conf.byteOrder = 0;
conf.compression = 0;
conf.checksum = checksum;
conf.signalId = sendSignalId;
if(iter.get(CFG_SHM_KEY, &conf.shmKey)) break;
if(iter.get(CFG_SHM_BUFFER_MEM, &conf.shmSize)) break;
if(!tr.createTransporter(&conf)){
ndbout << "Failed to create SHM Transporter from: "
<< conf.localNodeId << " to: " << conf.remoteNodeId << endl;
} else {
noOfTransportersCreated++;
}
break;
}
case CONNECTION_TYPE_SCI:{
SCI_TransporterConfiguration conf;
conf.localNodeId = nodeId;
conf.remoteNodeId = remoteNodeId;
conf.byteOrder = 0;
conf.compression = 0;
conf.checksum = checksum;
conf.signalId = sendSignalId;
if(iter.get(CFG_SCI_SEND_LIMIT, &conf.sendLimit)) break;
if(iter.get(CFG_SCI_BUFFER_MEM, &conf.bufferSize)) break;
if(nodeId == nodeId1){
if(iter.get(CFG_SCI_NODE1_ADAPTERS, &conf.nLocalAdapters)) break;
if(iter.get(CFG_SCI_NODE2_ADAPTERS, &conf.nRemoteAdapters)) break;
if(iter.get(CFG_SCI_NODE2_ADAPTER0, &conf.remoteSciNodeId0)) break;
if(conf.nRemoteAdapters > 1){
if(iter.get(CFG_SCI_NODE2_ADAPTER1, &conf.remoteSciNodeId1)) break;
}
} else {
if(iter.get(CFG_SCI_NODE2_ADAPTERS, &conf.nLocalAdapters)) break;
if(iter.get(CFG_SCI_NODE1_ADAPTERS, &conf.nRemoteAdapters)) break;
if(iter.get(CFG_SCI_NODE1_ADAPTER0, &conf.remoteSciNodeId0)) break;
if(conf.nRemoteAdapters > 1){
if(iter.get(CFG_SCI_NODE1_ADAPTER1, &conf.remoteSciNodeId1)) break;
}
}
if(!tr.createTransporter(&conf)){
ndbout << "Failed to create SCI Transporter from: "
<< conf.localNodeId << " to: " << conf.remoteNodeId << endl;
} else {
noOfTransportersCreated++;
continue;
}
}
case CONNECTION_TYPE_TCP:{
TCP_TransporterConfiguration conf;
const char * host1, * host2;
if(iter.get(CFG_TCP_HOSTNAME_1, &host1)) break;
if(iter.get(CFG_TCP_HOSTNAME_2, &host2)) break;
if(iter.get(CFG_TCP_SERVER_PORT, &conf.port)) break;
if(iter.get(CFG_TCP_SEND_BUFFER_SIZE, &conf.sendBufferSize)) break;
if(iter.get(CFG_TCP_RECEIVE_BUFFER_SIZE, &conf.maxReceiveSize)) break;
const char * proxy;
if (!iter.get(CFG_TCP_PROXY, &proxy)) {
if (strlen(proxy) > 0 && nodeId2 == nodeId) {
// TODO handle host:port
conf.port = atoi(proxy);
}
}
conf.localNodeId = nodeId;
conf.remoteNodeId = remoteNodeId;
conf.localHostName = (nodeId == nodeId1 ? host1 : host2);
conf.remoteHostName = (nodeId == nodeId1 ? host2 : host1);
conf.byteOrder = 0;
conf.compression = 0;
conf.checksum = checksum;
conf.signalId = sendSignalId;
if(!tr.createTransporter(&conf)){
ndbout << "Failed to create TCP Transporter from: "
<< nodeId << " to: " << remoteNodeId << endl;
} else {
noOfTransportersCreated++;
}
case CONNECTION_TYPE_OSE:{
OSE_TransporterConfiguration conf;
const char * host1, * host2;
if(iter.get(CFG_OSE_HOSTNAME_1, &host1)) break;
if(iter.get(CFG_OSE_HOSTNAME_2, &host2)) break;
if(iter.get(CFG_OSE_PRIO_A_SIZE, &conf.prioASignalSize)) break;
if(iter.get(CFG_OSE_PRIO_B_SIZE, &conf.prioBSignalSize)) break;
if(iter.get(CFG_OSE_RECEIVE_ARRAY_SIZE, &conf.receiveBufferSize)) break;
conf.localNodeId = nodeId;
conf.remoteNodeId = remoteNodeId;
conf.localHostName = (nodeId == nodeId1 ? host1 : host2);
conf.remoteHostName = (nodeId == nodeId1 ? host2 : host1);
conf.byteOrder = 0;
conf.compression = 0;
conf.checksum = checksum;
conf.signalId = sendSignalId;
if(!tr.createTransporter(&conf)){
ndbout << "Failed to create OSE Transporter from: "
<< nodeId << " to: " << remoteNodeId << endl;
} else {
noOfTransportersCreated++;
}
}
default:
ndbout << "Unknown transporter type from: " << nodeId <<
" to: " << remoteNodeId << endl;
break;
}
}
}
return noOfTransportersCreated;
}
......@@ -20,6 +20,7 @@
#include <ndb_global.h>
#include <Properties.hpp>
#include <ConfigValues.hpp>
class Config;
class ConfigInfo;
......@@ -28,18 +29,40 @@ class ConfigInfo;
* @class InitConfigFileParser
* @brief Reads initial config file and returns Config object
*
* This class contains one public method InitConfigFileParser::getConfig,
* This class contains one public method InitConfigFileParser::parseConfig,
* which reads an initial configuration file and returns a Config
* object if the config file has correct syntax and semantic.
*/
class InitConfigFileParser {
public:
/**
* Constructor
*/
InitConfigFileParser();
~InitConfigFileParser();
/**
* Reads the initial configuration file, checks syntax and semantic
* and stores internally the values of all parameters.
*
* @returns Config or NULL on failure
* @note must be freed by caller
*/
Config * parseConfig(FILE * file);
Config * parseConfig(const char * filename);
/**
* Parser context struct
*/
enum ContextSectionType { Undefined, Section, DefaultSection };
/**
* Context = Which section in init config file we are currently parsing
*/
struct Context {
Context(const ConfigInfo *);
~Context();
ContextSectionType type; ///< Section type (e.g. default section,section)
char fname[256]; ///< Section name occuring in init config file
char pname[256]; ///< Section name stored in properties object
......@@ -47,8 +70,8 @@ public:
Uint32 m_sectionLineno; ///< Where did current section start
const ConfigInfo * m_info; // The config info
const Properties * m_config; // The config object
const Properties * m_defaults; // The user defaults
Properties * m_config; // The config object
Properties * m_defaults; // The user defaults
Properties * m_currentSection; // The current section I'm in
const Properties * m_userDefaults; // The defaults of this section
......@@ -56,36 +79,13 @@ public:
const Properties * m_currentInfo; // The "info" for this section
Properties m_userProperties; // User properties (temporary values)
ConfigValuesFactory m_configValues; //
public:
void reportError(const char * msg, ...);
void reportWarning(const char * msg, ...);
};
/**
* Constructor
* @param initialConfigFileName: Name of the initial configuration file
*/
InitConfigFileParser(const char* initialConfigFileName);
~InitConfigFileParser();
/**
* Reads the initial configuration file, checks syntax and semantic
* and stores internally the values of all parameters.
*
* @returns true if succeeded, o/w false (e.g. incorrect config file)
*/
bool readConfigFile();
/**
* Get config. Must execute InitConfigFileParser::readConfigFile first.
*
* @returns Config if succeeded, o/w NULL
*/
const Config* getConfig();
private:
/**
* Check if line only contains space/comments
......@@ -111,33 +111,16 @@ private:
bool parseNameValuePair(Context&, const char* line);
bool storeNameValuePair(Context&, const char* fname, const char* value);
bool convertStringToUint32(const char* s, Uint32& val, Uint32 log10base = 0);
bool convertStringToUint64(const char* s, Uint64& val, Uint32 log10base = 0);
bool convertStringToBool(const char* s, bool& val);
bool storeSection(Context&);
const Properties* getSection(const char * name, const Properties* src);
/***************************************************************************
* VARIABLES
***************************************************************************/
FILE* m_initConfigStream;
/**
* Information about parameters (min, max values etc)
*/
const ConfigInfo* m_info;
/**
* Configuration from initial configuration file
* (returned by InitConfigFileParser::readConfigFile)
*/
Config* m_config;
/**
* Default values specified in default sections
*/
Properties* m_defaults;
bool storeSection(Context&);
ConfigInfo* m_info;
};
#endif // InitConfigFileParser_H
......@@ -5,6 +5,7 @@ TYPE := ndbapi mgmapiclient
PIC_ARCHIVE := Y
ARCHIVE_TARGET := mgmsrvcommon
# Removed temporary
DIRS := printConfig
SOURCES = \
......@@ -17,6 +18,8 @@ SOURCES = \
SOURCES.c = NdbConfig.c
CFLAGS_IPCConfig.cpp := -I$(call fixpath,$(NDB_TOP)/src/mgmapi)
include $(NDB_TOP)/Epilogue.mk
......
......@@ -7,8 +7,10 @@ BIN_TARGET_ARCHIVES := general portlib
CCFLAGS_LOC += -I..
SOURCES := printConfig.cpp
SOURCES := printConfig.cpp ../ConfigRetriever.cpp
SOURCES.c := ../ConfigRetriever.c ../NdbConfig.c ../LocalConfig.c
SOURCES.c := ../NdbConfig.c ../LocalConfig.c
CFLAGS_printConfig.cpp := -I$(call fixpath,$(NDB_TOP)/src/mgmapi)
include $(NDB_TOP)/Epilogue.mk
......@@ -18,6 +18,7 @@
#include <ndb_global.h>
#include <NdbMain.h>
#include <mgmapi.h>
#include <ConfigRetriever.hpp>
#include <Properties.hpp>
#include <NdbOut.hpp>
......@@ -50,9 +51,9 @@ NDB_COMMAND(printConfig,
return 0;
}
Properties * p = 0;
ConfigRetriever c;
struct ndb_mgm_configuration * p = 0;
if(strcmp("host", argv[1]) == 0){
int verId = 0;
if(argc > 5)
......@@ -64,7 +65,6 @@ NDB_COMMAND(printConfig,
p = c.getConfig(argv[2],
atoi(argv[3]),
atoi(argv[4]),
verId);
} else if (strcmp("file", argv[1]) == 0){
int verId = 0;
......@@ -79,12 +79,11 @@ NDB_COMMAND(printConfig,
}
if(p != 0){
p->print(stdout);
//
free(p);
} else {
ndbout << "Configuration not found: " << c.getErrorString() << endl;
}
delete p;
return 0;
}
......@@ -22,89 +22,186 @@ static char base64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"0123456789+/";
int
base64_encode(UtilBuffer &src, BaseString &dst) {
char *s = (char *)src.get_data();
int i = 0;
base64_encode(const UtilBuffer &src, BaseString &dst) {
const unsigned char *s = (const unsigned char *)src.get_data();
size_t i = 0;
size_t len = 0;
size_t src_len = src.length();
while(i < src_len) {
if(len == 76){
len = 0;
dst.append('\n');
}
while(i < src.length()) {
int c;
unsigned c;
c = s[i++];
c <<= 8;
if(i < src.length())
if(i < src_len)
c += s[i];
c <<= 8;
i++;
if(i < src.length())
if(i < src_len)
c += s[i];
i++;
dst.append(base64_table[(c >> 18) & 0x3f]);
dst.append(base64_table[(c >> 12) & 0x3f]);
if(i > (src.length() + 1))
if(i > (src_len + 1))
dst.append('=');
else
dst.append(base64_table[(c >> 6) & 0x3f]);
if(i > src.length())
if(i > src_len)
dst.append('=');
else
dst.append(base64_table[(c >> 0) & 0x3f]);
len += 4;
}
return 0;
}
static inline int
pos(char c) {
static inline unsigned
pos(unsigned char c) {
return strchr(base64_table, c) - base64_table;
}
int
base64_decode(BaseString &src, UtilBuffer &dst) {
size_t size;
size = (src.length() * 3) / 4;
base64_decode(const BaseString &src, UtilBuffer &dst) {
return base64_decode(src.c_str(), src.length(), dst);
}
#define SKIP_SPACE(src, i, size){ \
while(i < size && isspace(* src)){ \
i++; \
src++; \
} \
if(i == size){ \
i = size + 1; \
break; \
} \
}
int
base64_decode(const char * src, size_t size, UtilBuffer &dst) {
size_t i = 0;
const char *s = src.c_str();
while(i < size) {
int c = 0;
while(i < size){
unsigned c = 0;
int mark = 0;
c += pos(*s++);
SKIP_SPACE(src, i, size);
c += pos(*src++);
c <<= 6;
i++;
c += pos(*s++);
SKIP_SPACE(src, i, size);
c += pos(*src++);
c <<= 6;
i++;
if(*s != '=')
c += pos(*s++);
SKIP_SPACE(src, i, size);
if(* src != '=')
c += pos(*src++);
else {
size--;
mark++;
i = size;
mark = 2;
c <<= 6;
goto end;
}
c <<= 6;
i++;
if(*s != '=')
c += pos(*s++);
SKIP_SPACE(src, i, size);
if(*src != '=')
c += pos(*src++);
else {
size--;
mark++;
i = size;
mark = 1;
goto end;
}
/* c <<= 6; */
i++;
end:
char b[3];
b[0] = (c >> 16) & 0xff;
b[1] = (c >> 8) & 0xff;
b[2] = (c >> 0) & 0xff;
dst.append((void *)b, 3-mark);
}
if(i != size){
abort();
return -1;
}
return 0;
}
#ifdef __TEST__B64
/**
* USER_FLAGS="-D__TEST__B64" make Base64.o && g++ Base64.o BaseString.o
*/
inline
void
require(bool b){
if(!b)
abort();
}
int
main(void){
for(int i = 0; i < 500; i++){
const size_t len = rand() % 10000 + 1;
UtilBuffer src;
for(size_t j = 0; j<len; j++){
char c = rand();
src.append(&c, 1);
}
require(src.length() == len);
BaseString str;
require(base64_encode(src, str) == 0);
if(str.length() == 3850){
printf(">%s<\n", str.c_str());
}
UtilBuffer dst;
require(base64_decode(str, dst) == 0);
require(dst.length() == src.length());
const char * c_src = (char*)src.get_data();
const char * c_dst = (char*)dst.get_data();
if(memcmp(src.get_data(), dst.get_data(), src.length()) != 0){
printf("-- src --\n");
for(int i2 = 0; i2<len; i2++){
unsigned char c = c_src[i2];
printf("%.2x ", (unsigned)c);
if((i2 % 8) == 7)
printf("\n");
}
printf("\n");
printf("-- dst --\n");
for(int i2 = 0; i2<len; i2++){
unsigned char c = c_dst[i2];
printf("%.2x ", (unsigned)c);
if((i2 % 8) == 7)
printf("\n");
}
printf("\n");
abort();
}
}
return 0;
}
#endif
This diff is collapsed.
......@@ -8,7 +8,7 @@ ARCHIVE_TARGET := general
SOURCES = File.cpp md5_hash.cpp Properties.cpp socket_io.cpp \
SimpleProperties.cpp Parser.cpp InputStream.cpp SocketServer.cpp \
OutputStream.cpp NdbOut.cpp BaseString.cpp Base64.cpp \
NdbSqlUtil.cpp new.cpp
NdbSqlUtil.cpp ConfigValues.cpp new.cpp
SOURCES.c = uucode.c random.c getarg.c version.c
......@@ -20,7 +20,7 @@ ifeq ($(NDB_OS), OSE)
endif
SOURCES.c += strdup.c strlcat.c strlcpy.c
DIRS := testSimpleProperties
DIRS := testSimpleProperties testProperties testConfigValues
include $(NDB_TOP)/Epilogue.mk
......
......@@ -21,6 +21,12 @@
#include <NdbTCP.h>
#include <NdbOut.hpp>
static
char * f_strdup(const char * s){
if(!s) return 0;
return strdup(s);
}
/**
* Note has to be a multiple of 4 bytes
*/
......@@ -36,6 +42,7 @@ struct PropertyImpl{
~PropertyImpl();
PropertyImpl(const char * name, Uint32 value);
PropertyImpl(const char * name, Uint64 value);
PropertyImpl(const char * name, const char * value);
PropertyImpl(const char * name, const Properties * value);
......@@ -167,6 +174,11 @@ Properties::put(const char * name, Uint32 value, bool replace){
return ::put(impl, name, value, replace);
}
bool
Properties::put64(const char * name, Uint64 value, bool replace){
return ::put(impl, name, value, replace);
}
bool
Properties::put(const char * name, const char * value, bool replace){
return ::put(impl, name, value, replace);
......@@ -208,6 +220,40 @@ Properties::get(const char * name, Uint32 * value) const {
setErrno(E_PROPERTIES_OK);
return true;
}
if(nvp->valueType == PropertiesType_Uint64){
Uint64 tmp = * (Uint64 *)nvp->value;
Uint64 max = 1; max <<= 32;
if(tmp < max){
* value = (Uint32)tmp;
setErrno(E_PROPERTIES_OK);
return true;
}
}
setErrno(E_PROPERTIES_INVALID_TYPE);
return false;
}
bool
Properties::get(const char * name, Uint64 * value) const {
PropertyImpl * nvp = impl->get(name);
if(nvp == 0){
setErrno(E_PROPERTIES_NO_SUCH_ELEMENT);
return false;
}
if(nvp->valueType == PropertiesType_Uint32){
Uint32 tmp = * (Uint32 *)nvp->value;
* value = (Uint64)tmp;
setErrno(E_PROPERTIES_OK);
return true;
}
if(nvp->valueType == PropertiesType_Uint64){
* value = * (Uint64 *)nvp->value;
setErrno(E_PROPERTIES_OK);
return true;
}
setErrno(E_PROPERTIES_INVALID_TYPE);
return false;
}
......@@ -263,7 +309,7 @@ Properties::getCopy(const char * name, char ** value) const {
}
if(nvp->valueType == PropertiesType_char){
* value = strdup((const char *)nvp->value);
* value = f_strdup((const char *)nvp->value);
setErrno(E_PROPERTIES_OK);
return true;
}
......@@ -313,6 +359,10 @@ Properties::print(FILE * out, const char * prefix) const{
fprintf(out, "%s%s = (Uint32) %d\n", buf, impl->content[i]->name,
*(Uint32 *)impl->content[i]->value);
break;
case PropertiesType_Uint64:
fprintf(out, "%s%s = (Uint64) %lld\n", buf, impl->content[i]->name,
*(Uint64 *)impl->content[i]->value);
break;
case PropertiesType_char:
fprintf(out, "%s%s = (char*) \"%s\"\n", buf, impl->content[i]->name,
(char *)impl->content[i]->value);
......@@ -598,11 +648,18 @@ PropertiesImpl::getPackedSize(Uint32 pLen) const {
sz += 4; // Name Len
sz += 4; // Value Len
sz += mod4(pLen + strlen(content[i]->name)); // Name
if(content[i]->valueType == PropertiesType_char){
switch(content[i]->valueType){
case PropertiesType_char:
sz += mod4(strlen((char *)content[i]->value));
} else if(content[i]->valueType == PropertiesType_Uint32){
break;
case PropertiesType_Uint32:
sz += mod4(4);
} else {
break;
case PropertiesType_Uint64:
sz += mod4(8);
break;
case PropertiesType_Properties:
default:
assert(0);
}
}
......@@ -700,6 +757,9 @@ PropertiesImpl::pack(Uint32 *& buf, const char * prefix, Uint32 pLen) const {
case PropertiesType_Uint32:
valLenData = 4;
break;
case PropertiesType_Uint64:
valLenData = 8;
break;
case PropertiesType_char:
valLenData = strlen((char *)content[i]->value);
break;
......@@ -722,6 +782,14 @@ PropertiesImpl::pack(Uint32 *& buf, const char * prefix, Uint32 pLen) const {
case PropertiesType_Uint32:
* (Uint32 *)valBuf = htonl(* (Uint32 *)content[i]->value);
break;
case PropertiesType_Uint64:{
Uint64 val = * (Uint64 *)content[i]->value;
Uint32 hi = (val >> 32);
Uint32 lo = (val & 0xFFFFFFFF);
* (Uint32 *)valBuf = htonl(hi);
* (Uint32 *)(valBuf + 4) = htonl(lo);
}
break;
case PropertiesType_char:
memcpy(valBuf, content[i]->value, strlen((char*)content[i]->value));
break;
......@@ -788,6 +856,12 @@ PropertiesImpl::unpack(const Uint32 * buf, Uint32 &bufLen, Properties * top,
case PropertiesType_Uint32:
res3 = top->put(nameBuf, ntohl(* (Uint32 *)valBuf), true);
break;
case PropertiesType_Uint64:{
Uint64 hi = ntohl(* (Uint32 *)valBuf);
Uint64 lo = ntohl(* (Uint32 *)(valBuf + 4));
res3 = top->put64(nameBuf, (hi << 32) + lo, true);
}
break;
case PropertiesType_char:
res3 = top->put(nameBuf, valBuf, true);
break;
......@@ -808,6 +882,9 @@ PropertyImpl::~PropertyImpl(){
case PropertiesType_Uint32:
delete (Uint32 *)value;
break;
case PropertiesType_Uint64:
delete (Uint64 *)value;
break;
case PropertiesType_char:
free((char *)value);
break;
......@@ -822,6 +899,8 @@ PropertyImpl::copyPropertyImpl(const PropertyImpl & org){
switch(org.valueType){
case PropertiesType_Uint32:
return new PropertyImpl(org.name, * (Uint32 *)org.value);
case PropertiesType_Uint64:
return new PropertyImpl(org.name, * (Uint64 *)org.value);
break;
case PropertiesType_char:
return new PropertyImpl(org.name, (char *)org.value);
......@@ -836,21 +915,28 @@ PropertyImpl::copyPropertyImpl(const PropertyImpl & org){
}
PropertyImpl::PropertyImpl(const char * _name, Uint32 _value){
this->name = strdup(_name);
this->name = f_strdup(_name);
this->value = new Uint32;
* ((Uint32 *)this->value) = _value;
this->valueType = PropertiesType_Uint32;
}
PropertyImpl::PropertyImpl(const char * _name, Uint64 _value){
this->name = f_strdup(_name);
this->value = new Uint64;
* ((Uint64 *)this->value) = _value;
this->valueType = PropertiesType_Uint64;
}
PropertyImpl::PropertyImpl(const char * _name, const char * _value){
this->name = strdup(_name);
this->value = strdup(_value);
this->name = f_strdup(_name);
this->value = f_strdup(_value);
this->valueType = PropertiesType_char;
}
PropertyImpl::PropertyImpl(const char * _name, const Properties * _value){
this->name = strdup(_name);
this->name = f_strdup(_name);
this->value = new Properties(* _value);
this->valueType = PropertiesType_Properties;
}
......@@ -902,6 +988,16 @@ Properties::put(const char * name, Uint32 no, Uint32 val, bool replace){
return res;
}
bool
Properties::put64(const char * name, Uint32 no, Uint64 val, bool replace){
size_t tmp_len = strlen(name)+20;
char * tmp = (char*)malloc(tmp_len);
snprintf(tmp, tmp_len, "%s_%d", name, no);
bool res = put(tmp, val, replace);
free(tmp);
return res;
}
bool
Properties::put(const char * name, Uint32 no, const char * val, bool replace){
......@@ -957,6 +1053,16 @@ Properties::get(const char * name, Uint32 no, Uint32 * value) const{
return res;
}
bool
Properties::get(const char * name, Uint32 no, Uint64 * value) const{
size_t tmp_len = strlen(name)+20;
char * tmp = (char*)malloc(tmp_len);
snprintf(tmp, tmp_len, "%s_%d", name, no);
bool res = get(tmp, value);
free(tmp);
return res;
}
bool
Properties::get(const char * name, Uint32 no, const char ** value) const {
......
......@@ -202,13 +202,13 @@ vprintln_socket(NDB_SOCKET_TYPE socket, int timeout_millis,
size_t size = sizeof(buf);
if (fmt != 0) {
size = vsnprintf(buf, sizeof(buf)-1, fmt, ap);
size = vsnprintf(buf, sizeof(buf), fmt, ap);
/* Check if the output was truncated */
if(size >= sizeof(buf)) {
if(size >= sizeof(buf)-1) {
buf2 = (char *)malloc(size+2);
if(buf2 == NULL)
return -1;
vsnprintf(buf2, size, fmt, ap);
vsnprintf(buf2, size+1, fmt, ap);
} else
size = sizeof(buf);
} else
......
include .defs.mk
TYPE := util
BIN_TARGET := testConfigValues
BIN_TARGET_ARCHIVES := portlib general
SOURCES := testConfigValues.cpp
CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/util)
include $(NDB_TOP)/Epilogue.mk
#include <ConfigValues.hpp>
#include <NdbOut.hpp>
#include <stdlib.h>
#include <string.h>
#define CF_NODES 1
#define CF_LOG_PAGES 2
#define CF_MEM_PAGES 3
#define CF_START_TO 4
#define CF_STOP_TO 5
void print(Uint32 i, ConfigValues::ConstIterator & cf){
ndbout_c("---");
for(Uint32 j = 2; j<=7; j++){
switch(cf.getTypeOf(j)){
case ConfigValues::IntType:
ndbout_c("Node %d : CFG(%d) : %d",
i, j, cf.get(j, 999));
break;
case ConfigValues::Int64Type:
ndbout_c("Node %d : CFG(%d) : %lld (64)",
i, j, cf.get64(j, 999));
break;
case ConfigValues::StringType:
ndbout_c("Node %d : CFG(%d) : %s",
i, j, cf.get(j, "<NOT FOUND>"));
break;
default:
ndbout_c("Node %d : CFG(%d) : TYPE: %d",
i, j, cf.getTypeOf(j));
}
}
}
void print(Uint32 i, ConfigValues & _cf){
ConfigValues::ConstIterator cf(_cf);
print(i, cf);
}
void
print(ConfigValues & _cf){
ConfigValues::ConstIterator cf(_cf);
Uint32 i = 0;
while(cf.openSection(CF_NODES, i)){
print(i, cf);
cf.closeSection();
i++;
}
}
inline
void
require(bool b){
if(!b)
abort();
}
int
main(void){
{
ConfigValuesFactory cvf(10, 20);
cvf.openSection(1, 0);
cvf.put(2, 12);
cvf.put64(3, 13);
cvf.put(4, 14);
cvf.put64(5, 15);
cvf.put(6, "Keso");
cvf.put(7, "Kent");
cvf.closeSection();
cvf.openSection(1, 1);
cvf.put(2, 22);
cvf.put64(3, 23);
cvf.put(4, 24);
cvf.put64(5, 25);
cvf.put(6, "Kalle");
cvf.put(7, "Anka");
cvf.closeSection();
ndbout_c("-- print --");
print(* cvf.m_cfg);
cvf.shrink();
ndbout_c("shrink\n-- print --");
print(* cvf.m_cfg);
cvf.expand(10, 10);
ndbout_c("expand\n-- print --");
print(* cvf.m_cfg);
ndbout_c("packed size: %d", cvf.m_cfg->getPackedSize());
ConfigValues::ConstIterator iter(* cvf.m_cfg);
iter.openSection(CF_NODES, 0);
ConfigValues * cfg2 = ConfigValuesFactory::extractCurrentSection(iter);
print(99, * cfg2);
cvf.shrink();
ndbout_c("packed size: %d", cfg2->getPackedSize());
UtilBuffer buf;
Uint32 l1 = cvf.m_cfg->pack(buf);
Uint32 l2 = cvf.m_cfg->getPackedSize();
require(l1 == l2);
ConfigValuesFactory cvf2;
require(cvf2.unpack(buf));
UtilBuffer buf2;
cvf2.shrink();
Uint32 l3 = cvf2.m_cfg->pack(buf2);
require(l1 == l3);
ndbout_c("unpack\n-- print --");
print(* cvf2.m_cfg);
cfg2->~ConfigValues();;
cvf.m_cfg->~ConfigValues();
free(cfg2);
free(cvf.m_cfg);
}
return 0;
}
include .defs.mk
TYPE :=
TYPE := util
BIN_TARGET := keso
BIN_TARGET_ARCHIVES := portlib general
SOURCES := testProperties.cpp
CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/util)
include $(NDB_TOP)/Epilogue.mk
......@@ -63,12 +63,6 @@ readFromFile(Properties & p, const char *fname, bool uu = true){
return res;
}
Property defs[] = {
Property("Rolf", 123)
,Property("Keso", "Kent")
};
void putALot(Properties & tmp){
int i = 123;
tmp.put("LockPagesInMainMemory", i++);
......@@ -124,7 +118,6 @@ main(void){
p.put("Ank4", "anka");
putALot(p);
//p.put(defs, 2);
Properties tmp;
tmp.put("Type", "TCP");
tmp.put("OwnNodeId", 1);
......@@ -136,8 +129,8 @@ main(void){
tmp.put("Compression", (Uint32)false);
tmp.put("Checksum", 1);
tmp.put("SendBufferSize", 2000);
tmp.put("MaxReceiveSize", 1000);
tmp.put64("SendBufferSize", 2000);
tmp.put64("MaxReceiveSize", 1000);
tmp.put("PortNumber", 1233);
putALot(tmp);
......
include .defs.mk
DIRS := error blocks vm ndb-main
DIRS := error vm ndb-main blocks
include $(NDB_TOP)/Epilogue.mk
......@@ -4,7 +4,7 @@ Next NDBFS 2000
Next DBACC 3001
Next DBTUP 4007
Next DBLQH 5036
Next DBDICT 6003
Next DBDICT 6006
Next DBDIH 7173
Next DBTC 8035
Next CMVMI 9000
......@@ -12,7 +12,6 @@ Next BACKUP 10022
Next DBUTIL 11002
Next DBTUX 12001
Next SUMA 13001
Next DBDICT 14003
TESTING NODE FAILURE, ARBITRATION
---------------------------------
......@@ -425,6 +424,6 @@ Ordered index:
Dbdict:
-------
14000 Crash in participant @ CreateTabReq::Prepare
14001 Crash in participant @ CreateTabReq::Commit
14002 Crash in participant @ CreateTabReq::CreateDrop
6003 Crash in participant @ CreateTabReq::Prepare
6004 Crash in participant @ CreateTabReq::Commit
6005 Crash in participant @ CreateTabReq::CreateDrop
......@@ -60,8 +60,8 @@ Cluster participant -
including info in DIH_RESTART_REF/CONF
4) Wait until -
a) Receiving CNTR_MASTER_CONF -> continue
b) Receiving CNTR_MASTER_REF -> P = node specified in REF, goto 3
b) Receiving CNTR_START_CONF -> continue
b) Receiving CNTR_START_REF -> P = node specified in REF, goto 3
c) TimeToWaitAlive has passed -> Failure to start
4) Run ndb-startphase 1
......@@ -70,18 +70,23 @@ c) TimeToWaitAlive has passed -> Failure to start
Initial start/System restart NdbCntr (on qmgr president node)
1) Wait until -
a) Receiving all CNTR_MASTER_REQ (all = those in READ_NODES_CONF)
b) TimeToWaitAlive has passed -> Failure to start
a) Receiving CNTR_START_REQ with GCI > than own GCI
send CNTR_START_REF to all waiting nodes
b) Receiving all CNTR_START_REQ (for all defined nodes)
c) TimeToWait has passed and partition win
d) TimeToWait has passed and partitioning
and configuration "start with partition" = true
2) Wait until -
a) Enough nodes (at least 1 in each node group and 1 full node group)
has sent me CNTR_MASTER_REQ
b) TimeToWaitAlive has passed -> Failure to start
2) Send CNTR_START_CONF to all nodes "with filesystem"
3) Wait until -
Receiving CNTR_START_REP for all starting nodes
3) Decide what kind of start to perform (initial / system restart)
Decide who should be the master (the one with greatest GCI)
Send CNTR_MASTER_CONF(initial/system restart) to all nodes included in start
4) Start waiting nodes (if any)
NOTE:
1c) Partition win = 1 node in each node group and 1 full node group
1d) Pattitioning = at least 1 node in each node group
--
Running NdbCntr
......@@ -90,8 +95,3 @@ When receiving CNTR_MASTER_REQ
2) If I'm master
Coordinate parallell node restarts
send CNTR_MASTER_CONF (node restart)
NOTE:
2a Specified with a command line/config parameter the system could
start using only one node in each node group (if possible w.r.t LCP/GCP)
......@@ -38,14 +38,14 @@ Backup::Backup(const Configuration & conf) :
c_nodePool.setSize(MAX_NDB_NODES);
c_masterNodeId = getOwnNodeId();
const Properties * p = conf.getOwnProperties();
const ndb_mgm_configuration_iterator * p = conf.getOwnConfigIterator();
ndbrequire(p != 0);
Uint32 noBackups = 0, noTables = 0, noAttribs = 0;
p->get("ParallelBackups", &noBackups);
ndbrequire(p->get("MaxNoOfTables", &noTables));
ndbrequire(p->get("MaxNoOfAttributes", &noAttribs));
ndb_mgm_get_int_parameter(p, CFG_DB_PARALLEL_BACKUPS, &noBackups);
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_TABLES, &noTables));
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_ATTRIBUTES, &noAttribs));
// To allow for user tables AND SYSTAB
// See ClusterConfig
//TODO get this infor from NdbCntr
......@@ -65,7 +65,7 @@ Backup::Backup(const Configuration & conf) :
c_fragmentPool.setSize(noBackups * 2 * NO_OF_FRAG_PER_NODE * noTables);
Uint32 szMem = 0;
p->get("BackupMemory", &szMem);
ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_MEM, &szMem);
Uint32 noPages = (szMem + sizeof(Page32) - 1) / sizeof(Page32);
// We need to allocate an additional of 2 pages. 1 page because of a bug in
// ArrayPool and another one for DICTTAINFO.
......@@ -74,9 +74,9 @@ Backup::Backup(const Configuration & conf) :
Uint32 szDataBuf = (2 * 1024 * 1024);
Uint32 szLogBuf = (2 * 1024 * 1024);
Uint32 szWrite = 32768;
p->get("BackupDataBufferSize", &szDataBuf);
p->get("BackupLogBufferSize", &szLogBuf);
p->get("BackupWriteSize", &szWrite);
ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_DATA_BUFFER_MEM, &szDataBuf);
ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_LOG_BUFFER_MEM, &szLogBuf);
ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_WRITE_SIZE, &szWrite);
c_defaults.m_logBufferSize = szLogBuf;
c_defaults.m_dataBufferSize = szDataBuf;
......
This diff is collapsed.
......@@ -48,10 +48,7 @@ private:
void execNDB_TAMPER(Signal* signal);
void execSET_LOGLEVELORD(Signal* signal);
void execEVENT_REP(Signal* signal);
void execSTTOR_Local(Signal* signal);
void execCM_RUN(Signal* signal);
void execCM_INFOREQ(Signal* signal);
void execCMVMI_CFGREQ(Signal* signal);
void execSTTOR(Signal* signal);
void execCLOSE_COMREQ(Signal* signal);
void execENABLE_COMORD(Signal* signal);
void execOPEN_COMREQ(Signal* signal);
......@@ -75,17 +72,13 @@ private:
void execTESTSIG(Signal* signal);
int signalCount;
int theSignalKey;
int theStartPhase;
int theNumberOfNodes;
char theErrorMessage[256];
void sendSTTORRY(Signal* signal);
LogLevel clogLevel;
NdbNodeBitmask c_dbNodes;
class Configuration & theConfig;
const class ClusterConfiguration & theCConfig;
/**
* This struct defines the data needed for a EVENT_REP subscriber
......
......@@ -958,7 +958,7 @@ private:
void execDROP_TAB_REQ(Signal* signal);
void execFSREMOVECONF(Signal* signal);
void execFSREMOVEREF(Signal* signal);
void execSIZEALT_REP(Signal* signal);
void execREAD_CONFIG_REQ(Signal* signal);
void execSET_VAR_REQ(Signal* signal);
void execDUMP_STATE_ORD(Signal* signal);
......@@ -1000,7 +1000,6 @@ private:
void initScanFragmentPart(Signal* signal);
Uint32 checkScanExpand(Signal* signal);
Uint32 checkScanShrink(Signal* signal);
void sendInitialiseRecords(Signal* signal);
void initialiseDirRec(Signal* signal);
void initialiseDirRangeRec(Signal* signal);
void initialiseFragRec(Signal* signal);
......@@ -1174,7 +1173,7 @@ private:
void srReadPagesLab(Signal* signal);
void srDoUndoLab(Signal* signal);
void ndbrestart1Lab(Signal* signal);
void initialiseRecordsLab(Signal* signal);
void initialiseRecordsLab(Signal* signal, Uint32 returnRef, Uint32 retData);
void srReadPagesAllocLab(Signal* signal);
void checkNextBucketLab(Signal* signal);
void endsavepageLab(Signal* signal);
......
......@@ -179,7 +179,7 @@ Dbacc::Dbacc(const class Configuration & conf):
addRecSignal(GSN_DROP_TAB_REQ, &Dbacc::execDROP_TAB_REQ);
addRecSignal(GSN_FSREMOVECONF, &Dbacc::execFSREMOVECONF);
addRecSignal(GSN_FSREMOVEREF, &Dbacc::execFSREMOVEREF);
addRecSignal(GSN_SIZEALT_REP, &Dbacc::execSIZEALT_REP);
addRecSignal(GSN_READ_CONFIG_REQ, &Dbacc::execREAD_CONFIG_REQ, true);
addRecSignal(GSN_SET_VAR_REQ, &Dbacc::execSET_VAR_REQ);
initData();
......
This diff is collapsed.
This diff is collapsed.
......@@ -467,7 +467,7 @@ private:
void execFSWRITECONF(Signal* signal);
void execFSWRITEREF(Signal* signal);
void execNDB_STTOR(Signal* signal);
void execSIZEALT_REP(Signal* signal);
void execREAD_CONFIG_REQ(Signal* signal);
void execSTTOR(Signal* signal);
void execTC_SCHVERCONF(Signal* signal);
void execNODE_FAILREP(Signal* signal);
......
This diff is collapsed.
......@@ -179,7 +179,7 @@ Dbdih::Dbdih(const class Configuration & config):
addRecSignal(GSN_START_LCP_REQ, &Dbdih::execSTART_LCP_REQ);
addRecSignal(GSN_START_LCP_CONF, &Dbdih::execSTART_LCP_CONF);
addRecSignal(GSN_SIZEALT_REP, &Dbdih::execSIZEALT_REP);
addRecSignal(GSN_READ_CONFIG_REQ, &Dbdih::execREAD_CONFIG_REQ, true);
addRecSignal(GSN_UNBLO_DICTCONF, &Dbdih::execUNBLO_DICTCONF);
addRecSignal(GSN_COPY_ACTIVECONF, &Dbdih::execCOPY_ACTIVECONF);
addRecSignal(GSN_TAB_COMMITREQ, &Dbdih::execTAB_COMMITREQ);
......@@ -201,7 +201,6 @@ Dbdih::Dbdih(const class Configuration & config):
addRecSignal(GSN_NDB_STARTREQ, &Dbdih::execNDB_STARTREQ);
addRecSignal(GSN_GETGCIREQ, &Dbdih::execGETGCIREQ);
addRecSignal(GSN_DIH_RESTARTREQ, &Dbdih::execDIH_RESTARTREQ);
addRecSignal(GSN_CNTR_CHANGEREP, &Dbdih::execCNTR_CHANGEREP);
addRecSignal(GSN_START_RECCONF, &Dbdih::execSTART_RECCONF);
addRecSignal(GSN_START_FRAGCONF, &Dbdih::execSTART_FRAGCONF);
addRecSignal(GSN_ADD_FRAGCONF, &Dbdih::execADD_FRAGCONF);
......
This diff is collapsed.
This diff is collapsed.
......@@ -220,7 +220,7 @@ Dblqh::Dblqh(const class Configuration & conf):
addRecSignal(GSN_CHECK_LCP_STOP, &Dblqh::execCHECK_LCP_STOP);
addRecSignal(GSN_SEND_PACKED, &Dblqh::execSEND_PACKED);
addRecSignal(GSN_TUP_ATTRINFO, &Dblqh::execTUP_ATTRINFO);
addRecSignal(GSN_SIZEALT_REP, &Dblqh::execSIZEALT_REP);
addRecSignal(GSN_READ_CONFIG_REQ, &Dblqh::execREAD_CONFIG_REQ, true);
addRecSignal(GSN_LQHFRAGREQ, &Dblqh::execLQHFRAGREQ);
addRecSignal(GSN_LQHADDATTREQ, &Dblqh::execLQHADDATTREQ);
addRecSignal(GSN_TUP_ADD_ATTCONF, &Dblqh::execTUP_ADD_ATTCONF);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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