Commit 5e902af9 authored by unknown's avatar unknown
Browse files

Merge mysql.com:/home/stewart/Documents/MySQL/5.0/main

into  mysql.com:/home/stewart/Documents/MySQL/5.0/bug12124


ndb/src/mgmsrv/MgmtSrvr.cpp:
  Auto merged
parents 1b20404e 5755c787
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -993,6 +993,22 @@ extern "C" {
  int ndb_mgm_alloc_nodeid(NdbMgmHandle handle,
			   unsigned version, int nodetype);

  /**
   * End Session
   *
   * This function tells the mgm server to free all resources associated with
   * this connection. It will also close it.
   *
   * This differs from just disconnecting as we now synchronously clean up,
   * so that a quickly restarting server that needs the same node id can
   * get it when it restarts.
   *
   * @param  handle NDB management handle
   * @return 0 on success
   *
   * @note you still have to destroy the NdbMgmHandle.
   */
  int ndb_mgm_end_session(NdbMgmHandle handle);

  /**
   * Get the node id of the mgm server we're connected to
+3 −0
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ public:
  const char *get_connectstring(char *buf, int buf_sz) const;
  NdbMgmHandle get_mgmHandle() { return m_handle; };
  NdbMgmHandle* get_mgmHandlePtr() { return &m_handle; };
  void end_session(bool end) { m_end_session= end; };

  Uint32 get_configuration_nodeid() const;
private:
@@ -92,6 +93,8 @@ private:
  void setError(ErrorType, const char * errorMsg);
  
  Uint32      _ownNodeId;
  bool m_end_session;

  /*
  Uint32      m_mgmd_port;
  const char *m_mgmd_host;
+3 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ ConfigRetriever::ConfigRetriever(const char * _connect_string,
  m_version = version;
  m_node_type = node_type;
  _ownNodeId= 0;
  m_end_session= true;

  m_handle= ndb_mgm_create_handle();

@@ -73,6 +74,8 @@ ConfigRetriever::~ConfigRetriever()
{
  DBUG_ENTER("ConfigRetriever::~ConfigRetriever");
  if (m_handle) {
    if(m_end_session)
      ndb_mgm_end_session(m_handle);
    ndb_mgm_disconnect(m_handle);
    ndb_mgm_destroy_handle(&m_handle);
  }
+2 −0
Original line number Diff line number Diff line
@@ -42,6 +42,8 @@ SocketServer::~SocketServer() {
    delete m_sessions[i].m_session;
  }
  for(i = 0; i<m_services.size(); i++){
    if(m_services[i].m_socket)
      NDB_CLOSE_SOCKET(m_services[i].m_socket);
    delete m_services[i].m_service;
  }
}
+4 −1
Original line number Diff line number Diff line
@@ -307,8 +307,11 @@ int main(int argc, char** argv)
    /**
     * We no longer need the mgm connection in this process
     * (as we are the angel, not ndb)
     *
     * We don't want to purge any allocated resources (nodeid), so
     * we set that option to false
     */
    theConfig->closeConfiguration();
    theConfig->closeConfiguration(false);

    int status = 0, error_exit = 0, signum = 0;
    while(waitpid(child, &status, 0) != child);
Loading