From ee3bdf586b128b4985730df9ff4c598b4423d0d9 Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Wed, 26 Apr 2006 16:57:45 +0200 Subject: Bug #18550 ndbd getting "node failure handling not complete..." after graceful restart - addded more retries to wait for nodefailure to complete Bug #19039 multi node failure causes node failure handling not to complete - patch to avoid this scenario when the management server is used to perform the stop - wait for NF_COMPLETE_REP in management server before returning ndb: allocate nodeid - only retry on retryable error --- ndb/src/mgmapi/mgmapi.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'ndb/src/mgmapi') diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index b02367a8870..f99478a8cea 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -1868,7 +1868,8 @@ const char *ndb_mgm_get_connectstring(NdbMgmHandle handle, char *buf, int buf_sz extern "C" int -ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, int nodetype) +ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, int nodetype, + int log_event) { CHECK_HANDLE(handle, 0); CHECK_CONNECTED(handle, 0); @@ -1888,9 +1889,11 @@ ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, int nodetype) args.put("endian", (endian_check.c[sizeof(long)-1])?"big":"little"); if (handle->m_name) args.put("name", handle->m_name); + args.put("log_event", log_event); const ParserRow reply[]= { MGM_CMD("get nodeid reply", NULL, ""), + MGM_ARG("error_code", Int, Optional, "Error code"), MGM_ARG("nodeid", Int, Optional, "Error message"), MGM_ARG("result", String, Mandatory, "Error message"), MGM_END() @@ -1903,14 +1906,16 @@ ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, int nodetype) nodeid= -1; do { const char * buf; - if(!prop->get("result", &buf) || strcmp(buf, "Ok") != 0){ + if (!prop->get("result", &buf) || strcmp(buf, "Ok") != 0) + { const char *hostname= ndb_mgm_get_connected_host(handle); unsigned port= ndb_mgm_get_connected_port(handle); BaseString err; + Uint32 error_code= NDB_MGM_ALLOCID_ERROR; err.assfmt("Could not alloc node id at %s port %d: %s", hostname, port, buf); - setError(handle, NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET, __LINE__, - err.c_str()); + prop->get("error_code", &error_code); + setError(handle, error_code, __LINE__, err.c_str()); break; } Uint32 _nodeid; -- cgit v1.2.1