From 11ec718ef1a5b555ecc31cbbb7ffc240cb1c1cb3 Mon Sep 17 00:00:00 2001 From: "stewart@mysql.com" <> Date: Thu, 7 Jul 2005 15:19:56 +1000 Subject: [PATCH] BUG#11516 ndb_mgmd debug core on cluster shutdown with failed data nodes Fix closing of sessions on mgm server shutdown. --- ndb/include/mgmcommon/ConfigRetriever.hpp | 1 + ndb/src/common/mgmcommon/ConfigRetriever.cpp | 6 ++++++ ndb/src/mgmsrv/main.cpp | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ndb/include/mgmcommon/ConfigRetriever.hpp b/ndb/include/mgmcommon/ConfigRetriever.hpp index 95d257dea23..c0b877af07d 100644 --- a/ndb/include/mgmcommon/ConfigRetriever.hpp +++ b/ndb/include/mgmcommon/ConfigRetriever.hpp @@ -32,6 +32,7 @@ public: ~ConfigRetriever(); int do_connect(int no_retries, int retry_delay_in_seconds, int verbose); + int disconnect(); /** * Get configuration for current node. diff --git a/ndb/src/common/mgmcommon/ConfigRetriever.cpp b/ndb/src/common/mgmcommon/ConfigRetriever.cpp index eca886c8586..0e9b2a83e2f 100644 --- a/ndb/src/common/mgmcommon/ConfigRetriever.cpp +++ b/ndb/src/common/mgmcommon/ConfigRetriever.cpp @@ -107,6 +107,12 @@ ConfigRetriever::do_connect(int no_retries, 0 : -1; } +int +ConfigRetriever::disconnect() +{ + return ndb_mgm_disconnect(m_handle); +} + //**************************************************************************** //**************************************************************************** //**************************************************************************** diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index 3335fdc827c..c7315c61ba1 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -353,7 +353,8 @@ int main(int argc, char** argv) g_eventLogger.info("Shutting down server..."); glob.socketServer->stopServer(); - glob.socketServer->stopSessions(); + glob.mgmObject->get_config_retriever()->disconnect(); + glob.socketServer->stopSessions(true); g_eventLogger.info("Shutdown complete"); return 0; error_end: