better error printouts on cannot alloc node id
put ByteOrder config param back as depricated ndb/src/common/mgmcommon/ConfigInfo.cpp: put ByteOrder config param back as depricated ndb/src/mgmsrv/MgmtSrvr.cpp: better error printouts on cannot alloc node id
This commit is contained in:
parent
9b44664537
commit
2cd71180ef
@ -259,6 +259,18 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
|
|||||||
MANDATORY,
|
MANDATORY,
|
||||||
0,
|
0,
|
||||||
MAX_INT_RNIL },
|
MAX_INT_RNIL },
|
||||||
|
|
||||||
|
{
|
||||||
|
KEY_INTERNAL,
|
||||||
|
"ByteOrder",
|
||||||
|
"COMPUTER",
|
||||||
|
0,
|
||||||
|
ConfigInfo::DEPRICATED,
|
||||||
|
false,
|
||||||
|
ConfigInfo::STRING,
|
||||||
|
UNDEFINED,
|
||||||
|
0,
|
||||||
|
0 },
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* SYSTEM
|
* SYSTEM
|
||||||
|
@ -2332,6 +2332,9 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId,
|
|||||||
bool found_matching_id= false;
|
bool found_matching_id= false;
|
||||||
bool found_matching_type= false;
|
bool found_matching_type= false;
|
||||||
bool found_free_node= false;
|
bool found_free_node= false;
|
||||||
|
const char *config_hostname = 0;
|
||||||
|
struct in_addr config_addr= {0};
|
||||||
|
int r_config_addr= -1;
|
||||||
unsigned type_c= 0;
|
unsigned type_c= 0;
|
||||||
|
|
||||||
ndb_mgm_configuration_iterator iter(*(ndb_mgm_configuration *)_config->m_configValues,
|
ndb_mgm_configuration_iterator iter(*(ndb_mgm_configuration *)_config->m_configValues,
|
||||||
@ -2349,18 +2352,16 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId,
|
|||||||
if (connected_nodes.get(tmp))
|
if (connected_nodes.get(tmp))
|
||||||
continue;
|
continue;
|
||||||
found_free_node= true;
|
found_free_node= true;
|
||||||
const char *config_hostname = 0;
|
|
||||||
if(iter.get(CFG_NODE_HOST, &config_hostname)) abort();
|
if(iter.get(CFG_NODE_HOST, &config_hostname)) abort();
|
||||||
|
|
||||||
if (config_hostname && config_hostname[0] != 0 && client_addr) {
|
if (config_hostname && config_hostname[0] != 0 && client_addr) {
|
||||||
// check hostname compatability
|
// check hostname compatability
|
||||||
struct in_addr config_addr;
|
const void *tmp_in= &(((sockaddr_in*)client_addr)->sin_addr);
|
||||||
const void *tmp= &(((sockaddr_in*)client_addr)->sin_addr);
|
if((r_config_addr= Ndb_getInAddr(&config_addr, config_hostname)) != 0
|
||||||
if(Ndb_getInAddr(&config_addr, config_hostname) != 0
|
|| memcmp(&config_addr, tmp_in, sizeof(config_addr)) != 0) {
|
||||||
|| memcmp(&config_addr, tmp, sizeof(config_addr)) != 0) {
|
|
||||||
struct in_addr tmp_addr;
|
struct in_addr tmp_addr;
|
||||||
if(Ndb_getInAddr(&tmp_addr, "localhost") != 0
|
if(Ndb_getInAddr(&tmp_addr, "localhost") != 0
|
||||||
|| memcmp(&tmp_addr, tmp, sizeof(config_addr)) != 0) {
|
|| memcmp(&tmp_addr, tmp_in, sizeof(config_addr)) != 0) {
|
||||||
// not localhost
|
// not localhost
|
||||||
#if 0
|
#if 0
|
||||||
ndbout << "MgmtSrvr::getFreeNodeId compare failed for \"" << config_hostname
|
ndbout << "MgmtSrvr::getFreeNodeId compare failed for \"" << config_hostname
|
||||||
@ -2402,7 +2403,7 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId,
|
|||||||
if (found_matching_id)
|
if (found_matching_id)
|
||||||
if (found_matching_type)
|
if (found_matching_type)
|
||||||
if (found_free_node)
|
if (found_free_node)
|
||||||
error_string.appfmt("Connection done from wrong host %s.",
|
error_string.appfmt("Connection done from wrong host ip %s.",
|
||||||
inet_ntoa(((struct sockaddr_in *)(client_addr))->sin_addr));
|
inet_ntoa(((struct sockaddr_in *)(client_addr))->sin_addr));
|
||||||
else
|
else
|
||||||
error_string.appfmt("No free node id found for %s.", type_string.c_str());
|
error_string.appfmt("No free node id found for %s.", type_string.c_str());
|
||||||
@ -2413,10 +2414,13 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId,
|
|||||||
} else {
|
} else {
|
||||||
if (found_matching_id)
|
if (found_matching_id)
|
||||||
if (found_matching_type)
|
if (found_matching_type)
|
||||||
if (found_free_node)
|
if (found_free_node) {
|
||||||
error_string.appfmt("Connection with id %d done from wrong host %s, expected host XX.",
|
// have to split these into two since inet_ntoa overwrites itself
|
||||||
|
error_string.appfmt("Connection with id %d done from wrong host ip %s,",
|
||||||
*nodeId, inet_ntoa(((struct sockaddr_in *)(client_addr))->sin_addr));
|
*nodeId, inet_ntoa(((struct sockaddr_in *)(client_addr))->sin_addr));
|
||||||
else
|
error_string.appfmt(" expected %s(%s).", config_hostname,
|
||||||
|
r_config_addr ? "lookup failed" : inet_ntoa(config_addr));
|
||||||
|
} else
|
||||||
error_string.appfmt("Id %d already allocated by another node.", *nodeId);
|
error_string.appfmt("Id %d already allocated by another node.", *nodeId);
|
||||||
else
|
else
|
||||||
error_string.appfmt("Id %d configured as %s, connect attempted as %s.",
|
error_string.appfmt("Id %d configured as %s, connect attempted as %s.",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user