summaryrefslogtreecommitdiff
path: root/ndb/src/mgmsrv/MgmtSrvr.cpp
diff options
context:
space:
mode:
authorcmiller@zippy.cornsilk.net <>2007-01-31 16:23:05 -0500
committercmiller@zippy.cornsilk.net <>2007-01-31 16:23:05 -0500
commitad66e7a0dd8d28ccc9a2ab206de373ec6a5aebcc (patch)
tree310051f9adb743a7d4761e730eb5dc7f6124cf95 /ndb/src/mgmsrv/MgmtSrvr.cpp
parent5a0ac8afe71044cada67f1bed9c9dcae72b37689 (diff)
parent45f61a06fbad3e41efcd4cd950a068e967a70bd3 (diff)
downloadmariadb-git-ad66e7a0dd8d28ccc9a2ab206de373ec6a5aebcc.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
Diffstat (limited to 'ndb/src/mgmsrv/MgmtSrvr.cpp')
-rw-r--r--ndb/src/mgmsrv/MgmtSrvr.cpp48
1 files changed, 35 insertions, 13 deletions
diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp
index ebef5510b55..0ee59f70885 100644
--- a/ndb/src/mgmsrv/MgmtSrvr.cpp
+++ b/ndb/src/mgmsrv/MgmtSrvr.cpp
@@ -137,8 +137,11 @@ MgmtSrvr::logLevelThreadRun()
m_started_nodes.erase(0, false);
m_started_nodes.unlock();
- setEventReportingLevelImpl(node, req);
-
+ if (setEventReportingLevelImpl(node, req))
+ {
+ ndbout_c("setEventReportingLevelImpl(%d): failed", node);
+ }
+
SetLogLevelOrd ord;
ord = m_nodeLogLevel[node];
setNodeLogLevelImpl(node, ord);
@@ -155,10 +158,16 @@ MgmtSrvr::logLevelThreadRun()
m_log_level_requests.erase(0, false);
m_log_level_requests.unlock();
- if(req.blockRef == 0){
+ if(req.blockRef == 0)
+ {
req.blockRef = _ownReference;
- setEventReportingLevelImpl(0, req);
- } else {
+ if (setEventReportingLevelImpl(0, req))
+ {
+ ndbout_c("setEventReportingLevelImpl: failed 2!");
+ }
+ }
+ else
+ {
SetLogLevelOrd ord;
ord = req;
setNodeLogLevelImpl(req.blockRef, ord);
@@ -1376,9 +1385,6 @@ int MgmtSrvr::restartDB(bool nostart, bool initialStart,
NodeId nodeId = 0;
NDB_TICKS maxTime = NdbTick_CurrentMillisecond() + waitTime;
- ndbout_c(" %d", nodes.get(1));
- ndbout_c(" %d", nodes.get(2));
-
while(getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)) {
if (!nodes.get(nodeId))
continue;
@@ -1584,6 +1590,11 @@ MgmtSrvr::setEventReportingLevelImpl(int nodeId,
}
}
+ if (nodes.isclear())
+ {
+ return SEND_OR_RECEIVE_FAILED;
+ }
+
int error = 0;
while (!nodes.isclear())
{
@@ -1600,16 +1611,24 @@ MgmtSrvr::setEventReportingLevelImpl(int nodeId,
error = 1;
break;
}
+ // Since sending okToSend(true),
+ // there is no guarantee that NF_COMPLETEREP will come
+ // i.e listen also to NODE_FAILREP
+ case GSN_NODE_FAILREP: {
+ const NodeFailRep * const rep =
+ CAST_CONSTPTR(NodeFailRep, signal->getDataPtr());
+ NdbNodeBitmask mask;
+ mask.assign(NdbNodeBitmask::Size, rep->theNodes);
+ nodes.bitANDC(mask);
+ break;
+ }
+
case GSN_NF_COMPLETEREP:{
const NFCompleteRep * const rep =
CAST_CONSTPTR(NFCompleteRep, signal->getDataPtr());
nodes.clear(rep->failedNodeId);
break;
}
- case GSN_NODE_FAILREP:{
- // ignore, NF_COMPLETEREP will arrive later
- break;
- }
default:
report_unknown_signal(signal);
return SEND_OR_RECEIVE_FAILED;
@@ -1909,7 +1928,10 @@ MgmtSrvr::handleStatus(NodeId nodeId, bool alive, bool nfComplete)
theData[1] = nodeId;
if (alive) {
- m_started_nodes.push_back(nodeId);
+ if (nodeTypes[nodeId] == NODE_TYPE_DB)
+ {
+ m_started_nodes.push_back(nodeId);
+ }
rep->setEventType(NDB_LE_Connected);
} else {
rep->setEventType(NDB_LE_Disconnected);