Commit 3dae7e93 authored by unknown's avatar unknown

some more printouts to SHOW command


mysql-test/ndb/ndbcluster.sh:
  stop instead of kill
parent 30f6acf4
...@@ -194,6 +194,7 @@ stop_default_ndbcluster() { ...@@ -194,6 +194,7 @@ stop_default_ndbcluster() {
exec_mgmtclient="$exec_mgmtclient --try-reconnect=1" exec_mgmtclient="$exec_mgmtclient --try-reconnect=1"
echo "all stop" | $exec_mgmtclient 2>&1 | cat > /dev/null echo "all stop" | $exec_mgmtclient 2>&1 | cat > /dev/null
echo "3 stop" | $exec_mgmtclient 2>&1 | cat > /dev/null
if [ -f "$fs_ndb/$pidfile" ] ; then if [ -f "$fs_ndb/$pidfile" ] ; then
kill -9 `cat "$fs_ndb/$pidfile"` 2> /dev/null kill -9 `cat "$fs_ndb/$pidfile"` 2> /dev/null
......
...@@ -649,9 +649,10 @@ CommandInterpreter::executeShow(char* parameters) ...@@ -649,9 +649,10 @@ CommandInterpreter::executeShow(char* parameters)
} }
int int
ndb_nodes = 0, master_id= 0,
api_nodes = 0, ndb_nodes= 0,
mgm_nodes = 0; api_nodes= 0,
mgm_nodes= 0;
for(i=0; i < state->no_of_nodes; i++) { for(i=0; i < state->no_of_nodes; i++) {
switch(state->node_states[i].node_type) { switch(state->node_states[i].node_type) {
...@@ -659,6 +660,8 @@ CommandInterpreter::executeShow(char* parameters) ...@@ -659,6 +660,8 @@ CommandInterpreter::executeShow(char* parameters)
api_nodes++; api_nodes++;
break; break;
case NDB_MGM_NODE_TYPE_NDB: case NDB_MGM_NODE_TYPE_NDB:
if (state->node_states[i].dynamic_id > master_id)
master_id= state->node_states[i].dynamic_id;
ndb_nodes++; ndb_nodes++;
break; break;
case NDB_MGM_NODE_TYPE_MGM: case NDB_MGM_NODE_TYPE_MGM:
...@@ -681,8 +684,11 @@ CommandInterpreter::executeShow(char* parameters) ...@@ -681,8 +684,11 @@ CommandInterpreter::executeShow(char* parameters)
ndbout << " (Version: " ndbout << " (Version: "
<< getMajor(state->node_states[i].version) << "." << getMajor(state->node_states[i].version) << "."
<< getMinor(state->node_states[i].version) << "." << getMinor(state->node_states[i].version) << "."
<< getBuild(state->node_states[i].version) << ")" << endl; << getBuild(state->node_states[i].version) << ","
<< " Nodegroup: " << state->node_states[i].node_group;
if (state->node_states[i].dynamic_id == master_id)
ndbout << ", Master";
ndbout << ")" << endl;
} else } else
{ {
ndbout << " (not connected) " << endl; ndbout << " (not connected) " << endl;
...@@ -692,13 +698,13 @@ CommandInterpreter::executeShow(char* parameters) ...@@ -692,13 +698,13 @@ CommandInterpreter::executeShow(char* parameters)
} }
ndbout << endl; ndbout << endl;
ndbout << api_nodes ndbout << mgm_nodes
<< " API Node(s)" << " MGM Node(s)"
<< endl; << endl;
for(i=0; i < state->no_of_nodes; i++) { for(i=0; i < state->no_of_nodes; i++) {
if(state->node_states[i].node_type == NDB_MGM_NODE_TYPE_API) { if(state->node_states[i].node_type == NDB_MGM_NODE_TYPE_MGM) {
ndbout << "API node:\t" << state->node_states[i].node_id; ndbout << "MGM node:\t" << state->node_states[i].node_id;
if(state->node_states[i].version != 0) { if(state->node_states[i].version != 0) {
ndbout << " (Version: " ndbout << " (Version: "
<< getMajor(state->node_states[i].version) << "." << getMajor(state->node_states[i].version) << "."
...@@ -707,19 +713,19 @@ CommandInterpreter::executeShow(char* parameters) ...@@ -707,19 +713,19 @@ CommandInterpreter::executeShow(char* parameters)
} else } else
{ {
ndbout << " (not connected) " << endl; ndbout << " (no version information available) " << endl;
} }
} }
} }
ndbout << endl; ndbout << endl;
ndbout << mgm_nodes ndbout << api_nodes
<< " MGM Node(s)" << " API Node(s)"
<< endl; << endl;
for(i=0; i < state->no_of_nodes; i++) { for(i=0; i < state->no_of_nodes; i++) {
if(state->node_states[i].node_type == NDB_MGM_NODE_TYPE_MGM) { if(state->node_states[i].node_type == NDB_MGM_NODE_TYPE_API) {
ndbout << "MGM node:\t" << state->node_states[i].node_id; ndbout << "API node:\t" << state->node_states[i].node_id;
if(state->node_states[i].version != 0) { if(state->node_states[i].version != 0) {
ndbout << " (Version: " ndbout << " (Version: "
<< getMajor(state->node_states[i].version) << "." << getMajor(state->node_states[i].version) << "."
...@@ -728,11 +734,12 @@ CommandInterpreter::executeShow(char* parameters) ...@@ -728,11 +734,12 @@ CommandInterpreter::executeShow(char* parameters)
} else } else
{ {
ndbout << " (no version information available) " << endl; ndbout << " (not connected) " << endl;
} }
} }
} }
ndbout << endl; ndbout << endl;
// ndbout << helpTextShow; // ndbout << helpTextShow;
return; return;
} else if (strcmp(parameters, "PROPERTIES") == 0 || } else if (strcmp(parameters, "PROPERTIES") == 0 ||
......
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