Commit 1905e1c5 authored by unknown's avatar unknown
Browse files

bug#4529


ndb/include/mgmcommon/ConfigRetriever.hpp:
  Separate connect and all/fetch
ndb/include/mgmcommon/LocalConfig.hpp:
  Use BaseString
ndb/src/common/mgmcommon/ConfigRetriever.cpp:
  Separate connect and all/fetch
ndb/src/common/mgmcommon/LocalConfig.cpp:
  Removed useless onlyNodeId
ndb/src/kernel/main.cpp:
  Separeted Configuration fetch/setup
ndb/src/kernel/vm/Configuration.cpp:
  Separeted Configuration fetch/setup
ndb/src/kernel/vm/Configuration.hpp:
  Separeted Configuration fetch/setup
ndb/src/mgmapi/mgmapi.cpp:
  Fixed some return codes
ndb/src/mgmclient/main.cpp:
  LocalConfig update
ndb/src/mgmsrv/MgmtSrvr.cpp:
  Put mutex around reserving node'ids
ndb/src/mgmsrv/MgmtSrvr.hpp:
  Put mutex around reserving node'ids
ndb/src/mgmsrv/MgmtSrvrConfig.cpp:
  Changes ConfigRetreiver interface
ndb/src/mgmsrv/Services.cpp:
  Allow reserve same id twice
ndb/src/mgmsrv/main.cpp:
  Ignore SIGPIPE
ndb/src/ndbapi/TransporterFacade.cpp:
  ConfigRetriever interface
parent 89b44696
Loading
Loading
Loading
Loading
+21 −24
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@

#include <ndb_types.h>
#include <mgmapi.h>
#include <BaseString.hpp>
#include <LocalConfig.hpp>

/**
 * @class ConfigRetriever
@@ -26,15 +28,16 @@
 */
class ConfigRetriever {
public:
  ConfigRetriever();
  ConfigRetriever(const int id, const char* remoteHost, const int port);
  ConfigRetriever(Uint32 version, Uint32 nodeType);
  ~ConfigRetriever();

  /**
   * Read local config 
   * @return Own node id, -1 means fail
   */
  int init(bool onlyNodeId = false);
  int init();

  int do_connect();
  
  /**
   * Get configuration for current (nodeId given in local config file) node.
@@ -47,7 +50,7 @@ public:
   * @return ndb_mgm_configuration object if succeeded, 
   *         NULL if erroneous local config file or configuration error.
   */
  struct ndb_mgm_configuration * getConfig(int versionId, int nodeType);
  struct ndb_mgm_configuration * getConfig();
  
  const char * getErrorString();

@@ -61,29 +64,22 @@ public:
   */
  void setLocalConfigFileName(const char * connectString);

  /**
   * Sets connectstring which can be used instead of local config file
   * environment variables and Ndb.cfg has precidence over this
   */
  void setDefaultConnectString(const char * defaultConnectString);

  /**
   * @return Node id of this node (as stated in local config or connectString)
   */
  inline Uint32 getOwnNodeId() { return _ownNodeId; }

  Uint32 allocNodeId();

  /**
   * Get config using socket
   */
  struct ndb_mgm_configuration * getConfig(const char * mgmhost, short port,
					   int versionId, int nodetype);
  struct ndb_mgm_configuration * getConfig(NdbMgmHandle handle);
  
  /**
   * Get config from file
   */
  struct ndb_mgm_configuration * getConfig(const char * file, int versionId);
  struct ndb_mgm_configuration * getConfig(const char * file);
private:
  char * errorString;
  BaseString errorString;
  enum ErrorType {
    CR_ERROR = 0,
    CR_RETRY = 1
@@ -92,19 +88,20 @@ private:
  
  void setError(ErrorType, const char * errorMsg);
  
  char *                _localConfigFileName;
  struct LocalConfig *  _localConfig;
  BaseString            _localConfigFileName;
  struct LocalConfig    _localConfig;
  int                   _ownNodeId;
  
  char *                m_connectString;
  char *                m_defaultConnectString;
  BaseString            m_connectString;
  
  Uint32 m_version;
  Uint32 m_node_type;
  NdbMgmHandle m_handle;

  /**
   * Verify config
   */
  bool verifyConfig(const struct ndb_mgm_configuration *, int type);
  bool verifyConfig(const struct ndb_mgm_configuration *);
};

#endif
+10 −24
Original line number Diff line number Diff line
@@ -32,49 +32,35 @@ enum MgmtSrvrId_Type {

struct MgmtSrvrId {
  MgmtSrvrId_Type type;
  union {
    struct {
      char * remoteHost;
  BaseString name;
  unsigned int port;
    } tcp;
    struct {
      char * filename;
    } file;
  } data;
};

struct LocalConfig {

  int _ownNodeId;

  int size;
  int items;
  MgmtSrvrId ** ids;
  Vector<MgmtSrvrId> ids;
  
  int error_line;
  char error_msg[256];

  LocalConfig();
  ~LocalConfig();
  bool init(bool onlyNodeId = false,
	    const char *connectString = 0,
	    const char *fileName = 0,
	    const char *defaultConnectString = 0);

  void add(MgmtSrvrId *i);
  bool init(const char *connectString = 0,
	    const char *fileName = 0);

  void printError() const;
  void printUsage() const;

  void setError(int lineNumber, const char * _msg);
  bool readConnectString(const char * connectString, bool onlyNodeId = false);  
  bool readFile(const char * filename, bool &fopenError, bool onlyNodeId = false);
  bool readConnectString(const char *);  
  bool readFile(const char * file, bool &fopenError);
  bool parseLine(char * line, int lineNumber);
  
  bool parseNodeId(const char *buf);
  bool parseHostName(const char *buf);
  bool parseFileName(const char *buf);
  bool parseString(const char *buf, bool onlyNodeId, char *line);
  bool parseString(const char *buf, char *line);
};

#endif // LocalConfig_H
+99 −169
Original line number Diff line number Diff line
@@ -43,33 +43,14 @@
//****************************************************************************
//****************************************************************************

ConfigRetriever::ConfigRetriever() {
  
  _localConfigFileName = 0;
  m_defaultConnectString = 0;


  errorString = 0;
  _localConfig = new LocalConfig();  
  m_connectString = 0;
ConfigRetriever::ConfigRetriever(Uint32 version, Uint32 node_type) {
  
  m_handle= 0;
  m_version = version;
  m_node_type = node_type;
}

ConfigRetriever::~ConfigRetriever(){
  if(_localConfigFileName != 0)
    free(_localConfigFileName);
  
  if(m_defaultConnectString != 0)
    free(m_defaultConnectString);

  if(m_connectString != 0)
    free(m_connectString);

  if(errorString != 0)
    free(errorString);
  
  delete _localConfig;

  if (m_handle) {
    ndb_mgm_disconnect(m_handle);
@@ -82,68 +63,51 @@ ConfigRetriever::~ConfigRetriever(){
//****************************************************************************
 
int 
ConfigRetriever::init(bool onlyNodeId) {
  if (_localConfig->init(onlyNodeId, m_connectString, _localConfigFileName, m_defaultConnectString)) {
    return _ownNodeId = (*_localConfig)._ownNodeId;
  }
ConfigRetriever::init() {
  if (!_localConfig.init(m_connectString.c_str(), 
			 _localConfigFileName.c_str())){
    
    setError(CR_ERROR, "error in retrieving contact info for mgmtsrvr");
  _localConfig->printError();
  _localConfig->printUsage();

    _localConfig.printError();
    _localConfig.printUsage();
    return -1;
  }
  
//****************************************************************************
//****************************************************************************
//****************************************************************************
//****************************************************************************
struct ndb_mgm_configuration*
ConfigRetriever::getConfig(int verId, int nodeType) {

  int res = init();
  if (res == -1) {
    return 0;
  return _ownNodeId = _localConfig._ownNodeId;
}

  if (_localConfig->items == 0){
    setError(CR_ERROR,"No Management Servers configured in local config file");
    return 0;
int
ConfigRetriever::do_connect(){

  if(!m_handle)
    m_handle= ndb_mgm_create_handle();

  if (m_handle == 0) {
    setError(CR_ERROR, "Unable to allocate mgm handle");
    return -1;
  }

  int retry = 1;
  int retry_max = 12;    // Max number of retry attempts
  int retry_interval= 5; // Seconds between each retry
  do {
  while(retry < retry_max){
    Uint32 type = CR_ERROR;
    for (int i = 0; i<_localConfig->items; i++){
      MgmtSrvrId * m = _localConfig->ids[i];
      struct ndb_mgm_configuration * p = 0;
    BaseString tmp;
    for (int i = 0; i<_localConfig.ids.size(); i++){
      MgmtSrvrId * m = &_localConfig.ids[i];
      switch(m->type){
      case MgmId_TCP:
	p = getConfig(m->data.tcp.remoteHost, m->data.tcp.port,
		      verId, nodeType);
	break;
	tmp.assfmt("%s:%d", m->name.c_str(), m->port);
	if (ndb_mgm_connect(m_handle, tmp.c_str()) == 0) {
	  return 0;
	}
	setError(CR_RETRY, ndb_mgm_get_latest_error_desc(m_handle));
      case MgmId_File:
	p = getConfig(m->data.file.filename, verId);
	break;
      default:
	setError(CR_ERROR, "Unknown error type");
	break;
      }
      
      if (p != 0) {
	if(!verifyConfig(p, nodeType)){
	  free(p);
	  return 0;
      }
	return p;
    }
      if(latestErrorType == CR_RETRY)
	type = CR_RETRY;
    } // for

    if(type == CR_RETRY){
    if(latestErrorType == CR_RETRY){
      REPORT_WARNING("Failed to retrieve cluster configuration");
      ndbout << "(Cause of failure: " << getErrorString() << ")" << endl;
      ndbout << "Attempt " << retry << " of " << retry_max << ". " 
@@ -154,82 +118,63 @@ ConfigRetriever::getConfig(int verId, int nodeType) {
      break;
    }
    retry++;
    
  } while (retry <= retry_max);
  
  return 0;
  }
  
ndb_mgm_configuration *
ConfigRetriever::getConfig(const char * mgmhost, 
			   short port,
			   int versionId,
			   int nodetype){
  if (m_handle) {
    ndb_mgm_disconnect(m_handle);
  ndb_mgm_destroy_handle(&m_handle);
  m_handle= 0;
  return -1;
}

  m_handle = ndb_mgm_create_handle();
//****************************************************************************
//****************************************************************************
//****************************************************************************
//****************************************************************************
struct ndb_mgm_configuration*
ConfigRetriever::getConfig() {

  if (m_handle == 0) {
    setError(CR_ERROR, "Unable to allocate mgm handle");
    return 0;
  }
  struct ndb_mgm_configuration * p = 0;

  BaseString tmp;
  tmp.assfmt("%s:%d", mgmhost, port);
  if (ndb_mgm_connect(m_handle, tmp.c_str()) != 0) {
    setError(CR_RETRY, ndb_mgm_get_latest_error_desc(m_handle));
    ndb_mgm_destroy_handle(&m_handle);
    m_handle= 0;
  if(m_handle != 0){
    p = getConfig(m_handle);
  } else {
    for (int i = 0; i<_localConfig.ids.size(); i++){
      MgmtSrvrId * m = &_localConfig.ids[i];
      switch(m->type){
      case MgmId_File:
	p = getConfig(m->name.c_str());
	break;
      case MgmId_TCP:
	break;
      }
      if(p)
	break;
    }
  }
  if(p == 0)
    return 0;
  
  if(!verifyConfig(p)){
    free(p);
    p= 0;
  }
  
  ndb_mgm_configuration * conf = ndb_mgm_get_configuration(m_handle, versionId);
  if(conf == 0){
    setError(CR_ERROR, ndb_mgm_get_latest_error_desc(m_handle));
    ndb_mgm_disconnect(m_handle);
    ndb_mgm_destroy_handle(&m_handle);
    m_handle= 0;
    return 0;
  return p;
}

  {
    unsigned nodeid= getOwnNodeId();
ndb_mgm_configuration *
ConfigRetriever::getConfig(NdbMgmHandle m_handle){
  
    int res= ndb_mgm_alloc_nodeid(m_handle, versionId, &nodeid, nodetype);
    if(res != 0) {
  ndb_mgm_configuration * conf = ndb_mgm_get_configuration(m_handle,m_version);
  if(conf == 0){
    setError(CR_ERROR, ndb_mgm_get_latest_error_desc(m_handle));
      ndb_mgm_disconnect(m_handle);
      ndb_mgm_destroy_handle(&m_handle);
      m_handle= 0;
    return 0;
  }
  
    _ownNodeId= nodeid;
  }

  return conf;
#if 0  
  bool compatible;
  if (global_ndb_check)
    compatible = ndbCompatible_ndb_mgmt(versionId, version);
  else
    compatible = ndbCompatible_api_mgmt(versionId, version);

  if(!compatible){ //  if(version != versionId){
    NDB_CLOSE_SOCKET(sockfd);
    snprintf(err_buf, sizeof(err_buf), "Management Server: Invalid version. "
	     "Version from server: %d Own version: %d", version, versionId);
    setError(CR_ERROR, err_buf);
    return 0;
  }
#endif
}
	
ndb_mgm_configuration *
ConfigRetriever::getConfig(const char * filename, int versionId){
ConfigRetriever::getConfig(const char * filename){

  struct stat sbuf;
  const int res = stat(filename, &sbuf);
@@ -272,60 +217,29 @@ ConfigRetriever::getConfig(const char * filename, int versionId){

void
ConfigRetriever::setError(ErrorType et, const char * s){
  if(errorString != 0){
    free(errorString);
  }
  if(s == 0)
    errorString = 0;
  else
    errorString = strdup(s);
  errorString.assign(s ? s : "");
  latestErrorType = et;
}


const char * 
ConfigRetriever::getErrorString(){
  return errorString;
  return errorString.c_str();
}

void 
ConfigRetriever::setLocalConfigFileName(const char * localConfigFileName) {
  if(_localConfigFileName != 0)
    free(_localConfigFileName);
  if(localConfigFileName != 0)
    _localConfigFileName = strdup(localConfigFileName);
  else
    _localConfigFileName = 0;
  _localConfigFileName.assign(localConfigFileName ? localConfigFileName : "");
}

void 
ConfigRetriever::setConnectString(const char * connectString) {
  if(m_connectString != 0)
    free(m_connectString);
  if (connectString != 0) {
    m_connectString = strdup(connectString);
  } else {
    m_connectString = 0;
  }
}

/**
 * @note Do not use!  Use the one above if possible. /elathal
 */
void 
ConfigRetriever::setDefaultConnectString(const char * defaultConnectString) {
  if(m_defaultConnectString != 0)
    free(m_defaultConnectString);
  if (defaultConnectString != 0) {
    m_defaultConnectString = strdup(defaultConnectString);
  } else {
    m_defaultConnectString = 0;
  }
  m_connectString.assign(connectString ? connectString : "");
}

bool
ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf, 
			      int type){
ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf){

  char buf[255];
  ndb_mgm_configuration_iterator * it;
  it = ndb_mgm_create_configuration_iterator((struct ndb_mgm_configuration *)conf, CFG_SECTION_NODE);
@@ -338,8 +252,8 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf,
  }
  NdbAutoPtr<ndb_mgm_configuration_iterator> ptr(it);
  
  if(ndb_mgm_find(it, CFG_NODE_ID, getOwnNodeId()) != 0){
    snprintf(buf, 255, "Unable to find node with id: %d", getOwnNodeId());
  if(ndb_mgm_find(it, CFG_NODE_ID, _ownNodeId) != 0){
    snprintf(buf, 255, "Unable to find node with id: %d", _ownNodeId);
    setError(CR_ERROR, buf);
    return false;
  }
@@ -396,11 +310,27 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf,
    return false;
  }
  
  if(_type != type){
  if(_type != m_node_type){
    snprintf(buf, 255, "Supplied node type(%d) and config node type(%d) "
	     " don't match", type, _type);
	     " don't match", m_node_type, _type);
    setError(CR_ERROR, buf);
    return false;
  }

  return true;
}

Uint32
ConfigRetriever::allocNodeId(){
  unsigned nodeid= _ownNodeId;
  
  if(m_handle != 0){
    int res= ndb_mgm_alloc_nodeid(m_handle, m_version, &nodeid, m_node_type);
    if(res != 0) {
      setError(CR_ERROR, ndb_mgm_get_latest_error_desc(m_handle));
      return 0;
    }
  }
  
  return _ownNodeId= nodeid;
}
+30 −64
Original line number Diff line number Diff line
@@ -20,16 +20,13 @@
#include <NdbAutoPtr.hpp>

LocalConfig::LocalConfig(){
  ids = 0; size = 0; items = 0;
  error_line = 0; error_msg[0] = 0;
  _ownNodeId= 0;
}

bool
LocalConfig::init(bool onlyNodeId,
		  const char *connectString,
		  const char *fileName,
		  const char *defaultConnectString) {
LocalConfig::init(const char *connectString,
		  const char *fileName) {
  /** 
   * Escalation:
   *  1. Check connectString
@@ -41,8 +38,8 @@ LocalConfig::init(bool onlyNodeId,
   */
  
  //1. Check connectString
  if(connectString != 0) {
    if(readConnectString(connectString, onlyNodeId)){
  if(connectString != 0 && connectString[0] != 0){
    if(readConnectString(connectString)){
      return true;
    }
    return false;
@@ -51,7 +48,7 @@ LocalConfig::init(bool onlyNodeId,
  //2. Check given filename
  if (fileName && strlen(fileName) > 0) {
    bool fopenError;
    if(readFile(fileName, fopenError, onlyNodeId)){
    if(readFile(fileName, fopenError)){
      return true;
    }
    return false;
@@ -61,7 +58,7 @@ LocalConfig::init(bool onlyNodeId,
  char buf[255];  
  if(NdbEnv_GetEnv("NDB_CONNECTSTRING", buf, sizeof(buf)) &&
     strlen(buf) != 0){
    if(readConnectString(buf, onlyNodeId)){
    if(readConnectString(buf)){
      return true;
    }
    return false;
@@ -72,7 +69,7 @@ LocalConfig::init(bool onlyNodeId,
    bool fopenError;
    char *buf= NdbConfig_NdbCfgName(1 /*true*/);
    NdbAutoPtr<char> tmp_aptr(buf);
    if(readFile(buf, fopenError, onlyNodeId))
    if(readFile(buf, fopenError))
      return true;
    if (!fopenError)
      return false;
@@ -83,24 +80,17 @@ LocalConfig::init(bool onlyNodeId,
    bool fopenError;
    char *buf= NdbConfig_NdbCfgName(0 /*false*/);
    NdbAutoPtr<char> tmp_aptr(buf);
    if(readFile(buf, fopenError, onlyNodeId))
    if(readFile(buf, fopenError))
      return true;
    if (!fopenError)
      return false;
  }

  //6. Check defaultConnectString
  if(defaultConnectString != 0) {
    if(readConnectString(defaultConnectString, onlyNodeId))
      return true;
    return false;
  }

  //7. Check
  {
    char buf[256];
    snprintf(buf, sizeof(buf), "host=localhost:%u", NDB_BASE_PORT);
    if(readConnectString(buf, onlyNodeId))
    if(readConnectString(buf))
      return true;
  }

@@ -110,28 +100,6 @@ LocalConfig::init(bool onlyNodeId,
}

LocalConfig::~LocalConfig(){
  for(int i = 0; i<items; i++){
    if(ids[i]->type == MgmId_TCP)
      free(ids[i]->data.tcp.remoteHost);
    else if(ids[i]->type == MgmId_File)
      free(ids[i]->data.file.filename);
    delete ids[i];
  }
  if(ids != 0)
    delete[] ids;
}
  
void LocalConfig::add(MgmtSrvrId * i){
  if(items == size){
    MgmtSrvrId ** tmp = new MgmtSrvrId * [size+10];
    if(ids != 0){
      memcpy(tmp, ids, items*sizeof(MgmtSrvrId *));
      delete []ids;
    }
    ids = tmp;
  }
  ids[items] = i;
  items++;
}
  
void LocalConfig::setError(int lineNumber, const char * _msg) {
@@ -162,13 +130,13 @@ void LocalConfig::printUsage() const {
	 <<endl<<endl;
}
  
char *nodeIdTokens[] = {
const char *nodeIdTokens[] = {
  "OwnProcessId %i",
  "nodeid=%i",
  0
};

char *hostNameTokens[] = {
const char *hostNameTokens[] = {
  "host://%[^:]:%i",
  "host=%[^:]:%i",
  "%[^:]:%i",
@@ -176,7 +144,7 @@ char *hostNameTokens[] = {
  0
};

char *fileNameTokens[] = {
const char *fileNameTokens[] = {
  "file://%s",
  "file=%s",
  0
@@ -196,11 +164,11 @@ LocalConfig::parseHostName(const char * buf){
  int port;
  for(int i = 0; hostNameTokens[i] != 0; i++) {
    if (sscanf(buf, hostNameTokens[i], tempString, &port) == 2) {
      MgmtSrvrId* mgmtSrvrId = new MgmtSrvrId();
      mgmtSrvrId->type = MgmId_TCP;
      mgmtSrvrId->data.tcp.remoteHost = strdup(tempString);
      mgmtSrvrId->data.tcp.port       = port;
      add(mgmtSrvrId);
      MgmtSrvrId mgmtSrvrId;
      mgmtSrvrId.type = MgmId_TCP;
      mgmtSrvrId.name.assign(tempString);
      mgmtSrvrId.port = port;
      ids.push_back(mgmtSrvrId);
      return true;
    }
  }
@@ -212,10 +180,10 @@ LocalConfig::parseFileName(const char * buf){
  char tempString[1024];
  for(int i = 0; fileNameTokens[i] != 0; i++) {
    if (sscanf(buf, fileNameTokens[i], tempString) == 1) {
      MgmtSrvrId* mgmtSrvrId = new MgmtSrvrId();
      mgmtSrvrId->type = MgmId_File;
      mgmtSrvrId->data.file.filename = strdup(tempString);
      add(mgmtSrvrId);
      MgmtSrvrId mgmtSrvrId;
      mgmtSrvrId.type = MgmId_File;
      mgmtSrvrId.name.assign(tempString);
      ids.push_back(mgmtSrvrId);
      return true;
    }
  }
@@ -223,7 +191,7 @@ LocalConfig::parseFileName(const char * buf){
}

bool
LocalConfig::parseString(const char * connectString, bool onlyNodeId, char *line){
LocalConfig::parseString(const char * connectString, char *line){
  char * for_strtok;
  char * copy = strdup(connectString);
  NdbAutoPtr<char> tmp_aptr(copy);
@@ -231,8 +199,7 @@ LocalConfig::parseString(const char * connectString, bool onlyNodeId, char *line
  bool b_nodeId = false;
  bool found_other = false;

  for (char *tok = strtok_r(copy,";",&for_strtok);
       tok != 0 && !(onlyNodeId && b_nodeId);
  for (char *tok = strtok_r(copy,";",&for_strtok); tok != 0;
       tok = strtok_r(NULL, ";", &for_strtok)) {

    if (tok[0] == '#') continue;
@@ -240,8 +207,6 @@ LocalConfig::parseString(const char * connectString, bool onlyNodeId, char *line
    if (!b_nodeId) // only one nodeid definition allowed
      if (b_nodeId = parseNodeId(tok))
	continue;
    if (onlyNodeId)
      continue;
    if (found_other = parseHostName(tok))
      continue;
    if (found_other = parseFileName(tok))
@@ -252,16 +217,17 @@ LocalConfig::parseString(const char * connectString, bool onlyNodeId, char *line
    return false;
  }

  if (!onlyNodeId && !found_other) {
  if (!found_other) {
    if (line)
      snprintf(line, 150, "Missing host/file name extry in \"%s\"", connectString);
      snprintf(line, 150, "Missing host/file name extry in \"%s\"", 
	       connectString);
    return false;
  }

  return true;
}

bool LocalConfig::readFile(const char * filename, bool &fopenError, bool onlyNodeId)
bool LocalConfig::readFile(const char * filename, bool &fopenError)
{
  char line[150], line2[150];
    
@@ -292,7 +258,7 @@ bool LocalConfig::readFile(const char * filename, bool &fopenError, bool onlyNod
    strcat(theString, line);
  }

  bool return_value = parseString(theString, onlyNodeId, line);
  bool return_value = parseString(theString, line);

  if (!return_value) {
    snprintf(line2, 150, "Reading %s: %s", filename, line);
@@ -305,9 +271,9 @@ bool LocalConfig::readFile(const char * filename, bool &fopenError, bool onlyNod
}

bool
LocalConfig::readConnectString(const char * connectString, bool onlyNodeId){
LocalConfig::readConnectString(const char * connectString){
  char line[150], line2[150];
  bool return_value = parseString(connectString, onlyNodeId, line);
  bool return_value = parseString(connectString, line);
  if (!return_value) {
    snprintf(line2, 150, "Reading NDB_CONNECTSTRING \"%s\": %s", connectString, line);
    setError(0,line2);
+6 −5
Original line number Diff line number Diff line
@@ -69,7 +69,8 @@ NDB_MAIN(ndb_kernel){
  }
  
  { // Do configuration
    theConfig->setupConfiguration();
    signal(SIGPIPE, SIG_IGN);
    theConfig->fetch_configuration();
  }
  
  if (theConfig->getDaemonMode()) {
@@ -88,8 +89,6 @@ NDB_MAIN(ndb_kernel){
    /**
     * Parent
     */
    theConfig->closeConfiguration();

    catchsigs(true);

    int status = 0;
@@ -132,9 +131,11 @@ NDB_MAIN(ndb_kernel){
      exit(0);
    }
    g_eventLogger.info("Ndb has terminated (pid %d) restarting", child);
    theConfig->fetch_configuration();
  }

  g_eventLogger.info("Angel pid: %d ndb pid: %d", getppid(), getpid());
  theConfig->setupConfiguration();
  systemInfo(* theConfig, * theConfig->m_logLevel); 
  
    // Load blocks
Loading