added printout for where configuration is fetched

debug printouts
parent 8bfc619e
...@@ -45,7 +45,7 @@ status_ndb= ...@@ -45,7 +45,7 @@ status_ndb=
ndb_diskless=0 ndb_diskless=0
ndb_no_ord=512 ndb_no_ord=512
ndb_con_op=10000 ndb_con_op=105000
ndb_dmem=80M ndb_dmem=80M
ndb_imem=24M ndb_imem=24M
......
...@@ -73,6 +73,9 @@ public: ...@@ -73,6 +73,9 @@ public:
* Verify config * Verify config
*/ */
bool verifyConfig(const struct ndb_mgm_configuration *, Uint32 nodeid); bool verifyConfig(const struct ndb_mgm_configuration *, Uint32 nodeid);
Uint32 get_mgmd_port() const {return m_mgmd_port;};
const char *get_mgmd_host() const {return m_mgmd_host;};
private: private:
BaseString errorString; BaseString errorString;
enum ErrorType { enum ErrorType {
...@@ -85,7 +88,9 @@ private: ...@@ -85,7 +88,9 @@ private:
struct LocalConfig& _localConfig; struct LocalConfig& _localConfig;
Uint32 _ownNodeId; Uint32 _ownNodeId;
Uint32 m_mgmd_port;
const char *m_mgmd_host;
Uint32 m_version; Uint32 m_version;
Uint32 m_node_type; Uint32 m_node_type;
NdbMgmHandle m_handle; NdbMgmHandle m_handle;
......
...@@ -74,6 +74,9 @@ ConfigRetriever::init() { ...@@ -74,6 +74,9 @@ ConfigRetriever::init() {
int int
ConfigRetriever::do_connect(int exit_on_connect_failure){ ConfigRetriever::do_connect(int exit_on_connect_failure){
m_mgmd_port= 0;
m_mgmd_host= 0;
if(!m_handle) if(!m_handle)
m_handle= ndb_mgm_create_handle(); m_handle= ndb_mgm_create_handle();
...@@ -94,6 +97,8 @@ ConfigRetriever::do_connect(int exit_on_connect_failure){ ...@@ -94,6 +97,8 @@ ConfigRetriever::do_connect(int exit_on_connect_failure){
case MgmId_TCP: case MgmId_TCP:
tmp.assfmt("%s:%d", m->name.c_str(), m->port); tmp.assfmt("%s:%d", m->name.c_str(), m->port);
if (ndb_mgm_connect(m_handle, tmp.c_str()) == 0) { if (ndb_mgm_connect(m_handle, tmp.c_str()) == 0) {
m_mgmd_port= m->port;
m_mgmd_host= m->name.c_str();
return 0; return 0;
} }
setError(CR_RETRY, ndb_mgm_get_latest_error_desc(m_handle)); setError(CR_RETRY, ndb_mgm_get_latest_error_desc(m_handle));
...@@ -118,6 +123,8 @@ ConfigRetriever::do_connect(int exit_on_connect_failure){ ...@@ -118,6 +123,8 @@ ConfigRetriever::do_connect(int exit_on_connect_failure){
ndb_mgm_destroy_handle(&m_handle); ndb_mgm_destroy_handle(&m_handle);
m_handle= 0; m_handle= 0;
m_mgmd_port= 0;
m_mgmd_host= 0;
return -1; return -1;
} }
......
...@@ -252,6 +252,9 @@ systemInfo(const Configuration & config, const LogLevel & logLevel){ ...@@ -252,6 +252,9 @@ systemInfo(const Configuration & config, const LogLevel & logLevel){
if(logLevel.getLogLevel(LogLevel::llStartUp) > 0){ if(logLevel.getLogLevel(LogLevel::llStartUp) > 0){
g_eventLogger.info("NDB Cluster -- DB node %d", globalData.ownId); g_eventLogger.info("NDB Cluster -- DB node %d", globalData.ownId);
g_eventLogger.info("%s --", NDB_VERSION_STRING); g_eventLogger.info("%s --", NDB_VERSION_STRING);
if (config.get_mgmd_host())
g_eventLogger.info("Configuration fetched at %s port %d",
config.get_mgmd_host(), config.get_mgmd_port());
#ifdef NDB_SOLARIS // ok #ifdef NDB_SOLARIS // ok
g_eventLogger.info("NDB is running on a machine with %d processor(s) at %d MHz", g_eventLogger.info("NDB is running on a machine with %d processor(s) at %d MHz",
processor, speed); processor, speed);
......
...@@ -193,6 +193,8 @@ Configuration::fetch_configuration(LocalConfig &local_config){ ...@@ -193,6 +193,8 @@ Configuration::fetch_configuration(LocalConfig &local_config){
delete m_config_retriever; delete m_config_retriever;
} }
m_mgmd_port= 0;
m_mgmd_host= 0;
m_config_retriever= new ConfigRetriever(local_config, NDB_VERSION, NODE_TYPE_DB); m_config_retriever= new ConfigRetriever(local_config, NDB_VERSION, NODE_TYPE_DB);
if(m_config_retriever->init() == -1 || if(m_config_retriever->init() == -1 ||
m_config_retriever->do_connect() == -1){ m_config_retriever->do_connect() == -1){
...@@ -207,6 +209,9 @@ Configuration::fetch_configuration(LocalConfig &local_config){ ...@@ -207,6 +209,9 @@ Configuration::fetch_configuration(LocalConfig &local_config){
ERROR_SET(fatal, ERR_INVALID_CONFIG, "Could connect to ndb_mgmd", s); ERROR_SET(fatal, ERR_INVALID_CONFIG, "Could connect to ndb_mgmd", s);
} }
m_mgmd_port= m_config_retriever->get_mgmd_port();
m_mgmd_host= m_config_retriever->get_mgmd_host();
ConfigRetriever &cr= *m_config_retriever; ConfigRetriever &cr= *m_config_retriever;
if((globalData.ownId = cr.allocNodeId()) == 0){ if((globalData.ownId = cr.allocNodeId()) == 0){
......
...@@ -67,6 +67,9 @@ public: ...@@ -67,6 +67,9 @@ public:
const ndb_mgm_configuration_iterator * getOwnConfigIterator() const; const ndb_mgm_configuration_iterator * getOwnConfigIterator() const;
Uint32 get_mgmd_port() const {return m_mgmd_port;};
const char *get_mgmd_host() const {return m_mgmd_host;};
class LogLevel * m_logLevel; class LogLevel * m_logLevel;
private: private:
friend class Cmvmi; friend class Cmvmi;
...@@ -95,6 +98,8 @@ private: ...@@ -95,6 +98,8 @@ private:
char * _backupPath; char * _backupPath;
bool _initialStart; bool _initialStart;
char * _connectString; char * _connectString;
Uint32 m_mgmd_port;
const char *m_mgmd_host;
bool _daemonMode; bool _daemonMode;
void calcSizeAlt(class ConfigValues * ); void calcSizeAlt(class ConfigValues * );
......
...@@ -327,7 +327,11 @@ Ndb::startTransaction(Uint32 aPriority, const char * keyData, Uint32 keyLen) ...@@ -327,7 +327,11 @@ Ndb::startTransaction(Uint32 aPriority, const char * keyData, Uint32 keyLen)
} else { } else {
nodeId = 0; nodeId = 0;
}//if }//if
DBUG_RETURN(startTransactionLocal(aPriority, nodeId)); {
NdbConnection *trans= startTransactionLocal(aPriority, nodeId);
DBUG_PRINT("exit",("start trans= 0x%x", trans));
DBUG_RETURN(trans);
}
} else { } else {
DBUG_RETURN(NULL); DBUG_RETURN(NULL);
}//if }//if
...@@ -451,7 +455,7 @@ Ndb::startTransactionLocal(Uint32 aPriority, Uint32 nodeId) ...@@ -451,7 +455,7 @@ Ndb::startTransactionLocal(Uint32 aPriority, Uint32 nodeId)
abort(); abort();
} }
#endif #endif
DBUG_PRINT("exit", ("transaction id: %d", tConnection->getTransactionId())); DBUG_PRINT("exit", ("transid= %lld", tConnection->getTransactionId()));
DBUG_RETURN(tConnection); DBUG_RETURN(tConnection);
}//Ndb::startTransactionLocal() }//Ndb::startTransactionLocal()
...@@ -465,6 +469,8 @@ void ...@@ -465,6 +469,8 @@ void
Ndb::closeTransaction(NdbConnection* aConnection) Ndb::closeTransaction(NdbConnection* aConnection)
{ {
DBUG_ENTER("Ndb::closeTransaction"); DBUG_ENTER("Ndb::closeTransaction");
DBUG_PRINT("enter",("close trans= 0x%x, transid= %lld",
aConnection, aConnection->getTransactionId()));
NdbConnection* tCon; NdbConnection* tCon;
NdbConnection* tPreviousCon; NdbConnection* tPreviousCon;
......
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