Commit c51b1b8c authored by unknown's avatar unknown

Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.1-new-ndb

into  perch.ndb.mysql.com:/home/jonas/src/51-ndb

parents dbddc8b1 7c9cb762
......@@ -421,9 +421,10 @@ void Cmvmi::execCLOSE_COMREQ(Signal* signal)
// Uint32 noOfNodes = closeCom->noOfNodes;
jamEntry();
for (unsigned i = 0; i < MAX_NODES; i++){
if(NodeBitmask::get(closeCom->theNodes, i)){
for (unsigned i = 0; i < MAX_NODES; i++)
{
if(NodeBitmask::get(closeCom->theNodes, i))
{
jam();
//-----------------------------------------------------
......@@ -437,7 +438,9 @@ void Cmvmi::execCLOSE_COMREQ(Signal* signal)
globalTransporterRegistry.do_disconnect(i);
}
}
if (failNo != 0) {
if (failNo != 0)
{
jam();
signal->theData[0] = userRef;
signal->theData[1] = failNo;
......@@ -456,13 +459,21 @@ void Cmvmi::execOPEN_COMREQ(Signal* signal)
jamEntry();
const Uint32 len = signal->getLength();
if(len == 2){
if(len == 2)
{
#ifdef ERROR_INSERT
if (! ((ERROR_INSERTED(9000) || ERROR_INSERTED(9002))
&& c_error_9000_nodes_mask.get(tStartingNode)))
#endif
{
if (globalData.theStartLevel != NodeState::SL_STARTED &&
(getNodeInfo(tStartingNode).m_type != NodeInfo::DB &&
getNodeInfo(tStartingNode).m_type != NodeInfo::MGM))
{
jam();
goto done;
}
globalTransporterRegistry.do_connect(tStartingNode);
globalTransporterRegistry.setIOState(tStartingNode, HaltIO);
......@@ -475,9 +486,11 @@ void Cmvmi::execOPEN_COMREQ(Signal* signal)
//-----------------------------------------------------
}
} else {
for(unsigned int i = 1; i < MAX_NODES; i++ ) {
for(unsigned int i = 1; i < MAX_NODES; i++ )
{
jam();
if (i != getOwnNodeId() && getNodeInfo(i).m_type == tData2){
if (i != getOwnNodeId() && getNodeInfo(i).m_type == tData2)
{
jam();
#ifdef ERROR_INSERT
......@@ -496,6 +509,7 @@ void Cmvmi::execOPEN_COMREQ(Signal* signal)
}
}
done:
if (userRef != 0) {
jam();
signal->theData[0] = tStartingNode;
......@@ -537,22 +551,8 @@ void Cmvmi::execDISCONNECT_REP(Signal *signal)
const NodeInfo::NodeType type = getNodeInfo(hostId).getType();
ndbrequire(type != NodeInfo::INVALID);
if(type == NodeInfo::DB || globalData.theStartLevel == NodeState::SL_STARTED){
jam();
DisconnectRep * const rep = (DisconnectRep *)&signal->theData[0];
rep->nodeId = hostId;
rep->err = errNo;
sendSignal(QMGR_REF, GSN_DISCONNECT_REP, signal,
DisconnectRep::SignalLength, JBA);
} else if((globalData.theStartLevel == NodeState::SL_CMVMI ||
globalData.theStartLevel == NodeState::SL_STARTING)
&& type == NodeInfo::MGM) {
/**
* Someone disconnected during cmvmi period
*/
jam();
globalTransporterRegistry.do_connect(hostId);
}
cancelSubscription(hostId);
......@@ -587,6 +587,8 @@ void Cmvmi::execCONNECT_REP(Signal *signal){
*/
if(type == NodeInfo::MGM){
jam();
signal->theData[0] = hostId;
sendSignal(QMGR_REF, GSN_CONNECT_REP, signal, 1, JBA);
} else {
/**
* Dont allow api nodes to connect
......@@ -802,6 +804,8 @@ Cmvmi::execSTART_ORD(Signal* signal) {
}
}
}
EXECUTE_DIRECT(QMGR, GSN_START_ORD, signal, 1);
return ;
}
......@@ -830,9 +834,6 @@ Cmvmi::execSTART_ORD(Signal* signal) {
* Do Restart
*/
globalScheduler.clear();
globalTimeQueue.clear();
// Disconnect all nodes as part of the system restart.
// We need to ensure that we are starting up
// without any connected nodes.
......
......@@ -266,6 +266,8 @@ private:
void execALLOC_NODEID_REF(Signal *);
void completeAllocNodeIdReq(Signal *);
void execSTART_ORD(Signal*);
// Arbitration signals
void execARBIT_CFG(Signal* signal);
void execARBIT_PREPREQ(Signal* signal);
......@@ -281,6 +283,7 @@ private:
void check_readnodes_reply(Signal* signal, Uint32 nodeId, Uint32 gsn);
Uint32 check_startup(Signal* signal);
void api_failed(Signal* signal, Uint32 aFailedNode);
void node_failed(Signal* signal, Uint16 aFailedNode);
void checkStartInterface(Signal* signal);
void failReport(Signal* signal,
......
......@@ -31,10 +31,6 @@ void Qmgr::initData()
cnoCommitFailedNodes = 0;
c_maxDynamicId = 0;
c_clusterNodes.clear();
Uint32 hbDBAPI = 500;
setHbApiDelay(hbDBAPI);
c_connectedNodes.set(getOwnNodeId());
c_stopReq.senderRef = 0;
/**
......@@ -43,6 +39,27 @@ void Qmgr::initData()
ndbrequire((Uint32)NodeInfo::DB == 0);
ndbrequire((Uint32)NodeInfo::API == 1);
ndbrequire((Uint32)NodeInfo::MGM == 2);
NodeRecPtr nodePtr;
nodePtr.i = getOwnNodeId();
ptrAss(nodePtr, nodeRec);
nodePtr.p->blockRef = reference();
c_connectedNodes.set(getOwnNodeId());
setNodeInfo(getOwnNodeId()).m_version = NDB_VERSION;
/**
* Timeouts
*/
const ndb_mgm_configuration_iterator * p =
m_ctx.m_config.getOwnConfigIterator();
ndbrequire(p != 0);
Uint32 hbDBAPI = 1500;
ndb_mgm_get_int_parameter(p, CFG_DB_API_HEARTBEAT_INTERVAL, &hbDBAPI);
setHbApiDelay(hbDBAPI);
}//Qmgr::initData()
void Qmgr::initRecords()
......@@ -113,6 +130,7 @@ Qmgr::Qmgr(Block_context& ctx)
addRecSignal(GSN_DIH_RESTARTREF, &Qmgr::execDIH_RESTARTREF);
addRecSignal(GSN_DIH_RESTARTCONF, &Qmgr::execDIH_RESTARTCONF);
addRecSignal(GSN_NODE_VERSION_REP, &Qmgr::execNODE_VERSION_REP);
addRecSignal(GSN_START_ORD, &Qmgr::execSTART_ORD);
initData();
}//Qmgr::Qmgr()
......
......@@ -119,7 +119,11 @@ operator<<(NdbOut& out, const LogLevel & ll)
void
MgmtSrvr::logLevelThreadRun()
{
while (!_isStopThread) {
while (!_isStopThread)
{
Vector<NodeId> failed_started_nodes;
Vector<EventSubscribeReq> failed_log_level_requests;
/**
* Handle started nodes
*/
......@@ -145,13 +149,14 @@ MgmtSrvr::logLevelThreadRun()
if (setEventReportingLevelImpl(node, req))
{
ndbout_c("setEventReportingLevelImpl(%d): failed", node);
failed_started_nodes.push_back(node);
}
else
{
SetLogLevelOrd ord;
ord = m_nodeLogLevel[node];
setNodeLogLevelImpl(node, ord);
}
m_started_nodes.lock();
}
}
......@@ -169,14 +174,17 @@ MgmtSrvr::logLevelThreadRun()
req.blockRef = _ownReference;
if (setEventReportingLevelImpl(0, req))
{
ndbout_c("setEventReportingLevelImpl: failed 2!");
failed_log_level_requests.push_back(req);
}
}
else
{
SetLogLevelOrd ord;
ord = req;
setNodeLogLevelImpl(req.blockRef, ord);
if (setNodeLogLevelImpl(req.blockRef, ord))
{
failed_log_level_requests.push_back(req);
}
}
m_log_level_requests.lock();
}
......@@ -185,7 +193,28 @@ MgmtSrvr::logLevelThreadRun()
if(!ERROR_INSERTED(10000))
m_event_listner.check_listeners();
NdbSleep_MilliSleep(_logLevelThreadSleep);
Uint32 sleeptime = _logLevelThreadSleep;
if (failed_started_nodes.size())
{
m_started_nodes.lock();
for (Uint32 i = 0; i<failed_started_nodes.size(); i++)
m_started_nodes.push_back(failed_started_nodes[i], false);
m_started_nodes.unlock();
failed_started_nodes.clear();
sleeptime = 100;
}
if (failed_log_level_requests.size())
{
m_log_level_requests.lock();
for (Uint32 i = 0; i<failed_log_level_requests.size(); i++)
m_log_level_requests.push_back(failed_log_level_requests[i], false);
m_log_level_requests.unlock();
failed_log_level_requests.clear();
sleeptime = 100;
}
NdbSleep_MilliSleep(sleeptime);
}
}
......@@ -1535,7 +1564,6 @@ MgmtSrvr::setEventReportingLevelImpl(int nodeId_arg,
{
SignalSender ss(theFacade);
NdbNodeBitmask nodes;
int retries = 30;
nodes.clear();
while (1)
{
......@@ -1572,19 +1600,9 @@ MgmtSrvr::setEventReportingLevelImpl(int nodeId_arg,
continue;
}
// api_reg_conf not recevied yet, need to retry
break;
}
}
if (nodeId <= max)
{
if (--retries)
{
ss.unlock();
NdbSleep_MilliSleep(100);
continue;
}
return SEND_OR_RECEIVE_FAILED;
}
}
if (nodeId_arg == 0)
{
......@@ -1607,6 +1625,10 @@ MgmtSrvr::setEventReportingLevelImpl(int nodeId_arg,
continue; // node is not connected, skip
if (ss.sendSignal(nodeId, &ssig) == SEND_OK)
nodes.set(nodeId);
else if (max == nodeId)
{
return SEND_OR_RECEIVE_FAILED;
}
}
break;
}
......@@ -2988,8 +3010,8 @@ int MgmtSrvr::connect_to_self(void)
return 0;
}
template class Vector<unsigned short>;
template class MutexVector<unsigned short>;
template class MutexVector<Ndb_mgmd_event_service::Event_listener>;
template class Vector<EventSubscribeReq>;
template class MutexVector<EventSubscribeReq>;
......@@ -169,7 +169,7 @@ ErrorBundle ErrorCodes[] = {
{ 219, DMEC, TR, "219" },
{ 233, DMEC, TR,
"Out of operation records in transaction coordinator (increase MaxNoOfConcurrentOperations)" },
{ 275, DMEC, TR, "275" },
{ 275, DMEC, TR, "Out of transaction records for complete phase (increase MaxNoOfConcurrentTransactions)" },
{ 279, DMEC, TR, "Out of transaction markers in transaction coordinator" },
{ 414, DMEC, TR, "414" },
{ 418, DMEC, TR, "Out of transaction buffers in LQH" },
......
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