Commit be6403eb authored by unknown's avatar unknown

Bug #13266 Online adding of MySQLD causes cluster to crash

- check node type, if configuration has not bee updated, type will be undefined, and conenction will be refused


storage/ndb/include/kernel/signaldata/AllocNodeId.hpp:
  Bug #13266 Online adding of MySQLD causes cluster to crash
  - propagate node type on allocation
storage/ndb/src/mgmsrv/MgmtSrvr.cpp:
  Bug #13266 Online adding of MySQLD causes cluster to crash
  - propagate node type on allocation
storage/ndb/src/mgmsrv/MgmtSrvr.hpp:
  Bug #13266 Online adding of MySQLD causes cluster to crash
  - propagate node type on allocation
storage/ndb/src/ndbapi/ndberror.c:
  Bug #13266 Online adding of MySQLD causes cluster to crash
  - propagate node type on allocation
parent 73977d11
......@@ -25,11 +25,12 @@
*/
class AllocNodeIdReq {
public:
STATIC_CONST( SignalLength = 3 );
STATIC_CONST( SignalLength = 4 );
Uint32 senderRef;
Uint32 senderData;
Uint32 nodeId;
Uint32 nodeType;
};
class AllocNodeIdConf {
......@@ -53,7 +54,8 @@ public:
NotMaster = 702,
NodeReserved = 1701,
NodeConnected = 1702,
NodeFailureHandlingNotCompleted = 1703
NodeFailureHandlingNotCompleted = 1703,
NodeTypeMismatch = 1704
};
Uint32 senderRef;
......
......@@ -4736,6 +4736,7 @@ Qmgr::execALLOC_NODEID_REQ(Signal * signal)
const AllocNodeIdReq * req = (AllocNodeIdReq*)signal->getDataPtr();
Uint32 senderRef = req->senderRef;
Uint32 nodeId = req->nodeId;
Uint32 nodeType = req->nodeType;
Uint32 error = 0;
if (refToBlock(senderRef) != QMGR) // request from management server
......@@ -4786,7 +4787,9 @@ Qmgr::execALLOC_NODEID_REQ(Signal * signal)
NodeRecPtr nodePtr;
nodePtr.i = nodeId;
ptrAss(nodePtr, nodeRec);
if (nodePtr.p->failState != NORMAL)
if (nodeType != getNodeInfo(nodeId).m_type)
error = AllocNodeIdRef::NodeTypeMismatch;
else if (nodePtr.p->failState != NORMAL)
error = AllocNodeIdRef::NodeFailureHandlingNotCompleted;
}
......
......@@ -1927,7 +1927,7 @@ MgmtSrvr::get_connected_nodes(NodeBitmask &connected_nodes) const
}
int
MgmtSrvr::alloc_node_id_req(Uint32 free_node_id)
MgmtSrvr::alloc_node_id_req(NodeId free_node_id, enum ndb_mgm_node_type type)
{
SignalSender ss(theFacade);
ss.lock(); // lock will be released on exit
......@@ -1940,6 +1940,7 @@ MgmtSrvr::alloc_node_id_req(Uint32 free_node_id)
req->senderRef = ss.getOwnRef();
req->senderData = 19;
req->nodeId = free_node_id;
req->nodeType = type;
int do_send = 1;
NodeId nodeId = 0;
......@@ -2140,7 +2141,7 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId,
if (id_found && client_addr != 0)
{
int res = alloc_node_id_req(id_found);
int res = alloc_node_id_req(id_found, type);
unsigned save_id_found = id_found;
switch (res)
{
......
......@@ -520,7 +520,7 @@ private:
*/
int getBlockNumber(const BaseString &blockName);
int alloc_node_id_req(Uint32 free_node_id);
int alloc_node_id_req(NodeId free_node_id, enum ndb_mgm_node_type type);
//**************************************************************************
int _blockNumber;
......
......@@ -462,6 +462,7 @@ ErrorBundle ErrorCodes[] = {
{ 1701, DMEC, AE, "Node already reserved" },
{ 1702, DMEC, AE, "Node already connected" },
{ 1703, DMEC, AE, "Node failure handling not completed" },
{ 1704, DMEC, AE, "Node type mismatch" },
/**
* Still uncategorized
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment