Below is the list of changes that have just been committed into a local
5.0 repository of tomas. When tomas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2141 06/04/07 12:01:07 tomas@stripped +2 -0
multi node shutdown adabtions for restart of management servers
ndb/src/mgmsrv/Services.cpp
1.61 06/04/07 12:01:00 tomas@stripped +0 -23
multi node shutdown adabtions for restart of management servers
ndb/src/mgmsrv/MgmtSrvr.cpp
1.96 06/04/07 12:00:59 tomas@stripped +31 -22
multi node shutdown adabtions for restart of management servers
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: tomas
# Host: poseidon.ndb.mysql.com
# Root: /home/tomas/mysql-5.0-jonas
--- 1.95/ndb/src/mgmsrv/MgmtSrvr.cpp 2006-04-07 10:39:41 +02:00
+++ 1.96/ndb/src/mgmsrv/MgmtSrvr.cpp 2006-04-07 12:00:59 +02:00
@@ -987,41 +987,44 @@
// send the signals
NodeBitmask nodes;
- NodeId nodeId;
+ NodeId nodeId= 0;
int use_master_node= 0;
int do_send= 0;
+ int do_stop_self= 0;
NdbNodeBitmask nodes_to_stop;
{
for (unsigned i= 0; i < node_ids.size(); i++)
- nodes_to_stop.set(node_ids[i]);
- }
- if (node_ids.size())
- {
- do_send= 1;
- if (node_ids.size() == 1)
{
- nodeId= node_ids[0];
- if (nodeId == getOwnNodeId())
- {
- if (restart)
- g_RestartServer= true;
- g_StopServer= true;
- DBUG_RETURN(0);
- }
- else if (getNodeType(nodeId) == NDB_MGM_NODE_TYPE_MGM)
+ nodeId= node_ids[i];
+ if (getNodeType(nodeId) != NDB_MGM_NODE_TYPE_MGM)
+ nodes_to_stop.set(nodeId);
+ else if (nodeId != getOwnNodeId())
{
error= sendStopMgmd(nodeId, abort, stop, restart,
nostart, initialStart);
if (error == 0)
stoppedNodes.set(nodeId);
- DBUG_RETURN(error);
}
+ else
+ do_stop_self= 1;;
}
- else // multi node stop, send to master
+ }
+ int no_of_nodes_to_stop= nodes_to_stop.count();
+ if (node_ids.size())
+ {
+ if (no_of_nodes_to_stop)
{
- use_master_node= 1;
- nodes_to_stop.copyto(NdbNodeBitmask::Size, stopReq->nodes);
- StopReq::setStopNodes(stopReq->requestInfo, 1);
+ do_send= 1;
+ if (no_of_nodes_to_stop == 1)
+ {
+ nodeId= nodes_to_stop.find(0);
+ }
+ else // multi node stop, send to master
+ {
+ use_master_node= 1;
+ nodes_to_stop.copyto(NdbNodeBitmask::Size, stopReq->nodes);
+ StopReq::setStopNodes(stopReq->requestInfo, 1);
+ }
}
}
else
@@ -1105,7 +1108,7 @@
}
else
{
- assert(node_ids.size() > 1);
+ assert(no_of_nodes_to_stop > 1);
stoppedNodes.bitOR(nodes_to_stop);
}
nodes.clear(nodeId);
@@ -1149,6 +1152,12 @@
#endif
DBUG_RETURN(SEND_OR_RECEIVE_FAILED);
}
+ }
+ if (!error && do_stop_self)
+ {
+ if (restart)
+ g_RestartServer= true;
+ g_StopServer= true;
}
DBUG_RETURN(error);
}
--- 1.60/ndb/src/mgmsrv/Services.cpp 2006-04-07 10:39:41 +02:00
+++ 1.61/ndb/src/mgmsrv/Services.cpp 2006-04-07 12:01:00 +02:00
@@ -1010,22 +1010,6 @@
nodes.push_back(atoi(p));
}
- int stop_self= 0;
- size_t i;
- for(i=0; i < nodes.size(); i++) {
- if (nodes[i] == m_mgmsrv.getOwnNodeId()) {
- stop_self= 1;
- if (i != nodes.size()-1) {
- m_output->println("stop reply");
- m_output->println("result: server must be stopped last");
- m_output->println("");
- return;
- }
- nodes.erase(i);
- break;
- }
- }
-
int stopped= 0;
int result= 0;
if (nodes.size())
@@ -1035,16 +1019,9 @@
if(result != 0)
m_output->println("result: %s", get_error_text(result));
else
- {
m_output->println("result: Ok");
- if (stop_self)
- stopped++;
- }
m_output->println("stopped: %d", stopped);
m_output->println("");
-
- if (stop_self)
- g_StopServer= true;
}
| Thread |
|---|
| • bk commit into 5.0 tree (tomas:1.2141) | tomas | 7 Apr |