Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

bk commit into 5.0 tree (Justin.He:1.2483) BUG#27999

From: <justin.he(at)mysql.com>
Date: Sun Sep 30 2007 - 04:10:50 EDT


Below is the list of changes that have just been committed into a local 5.0 repository of justin.he. When justin.he 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.2483, 2007-09-30 16:10:43+08:00, Justin.He@dev3-240.dev.cn.tlan +6 -0   Bug#27999 Single User Mode: Management client should show API permitted to connect

  ndb/include/mgmapi/mgmapi.h@1.56, 2007-09-30 16:10:40+08:00, Justin.He@dev3-240.dev.cn.tlan +4 -0     add a variable definition to get which node is permitted to connect to ndbd     after enter single user mode

  ndb/src/mgmapi/mgmapi.cpp@1.73, 2007-09-30 16:10:41+08:00, Justin.He@dev3-240.dev.cn.tlan +2 -0     parse single user api node id

  ndb/src/mgmclient/CommandInterpreter.cpp@1.81, 2007-09-30 16:10:41+08:00, Justin.He@dev3-240.dev.cn.tlan +22 -3     print single user mode info for API nodes

  ndb/src/mgmsrv/MgmtSrvr.cpp@1.118, 2007-09-30 16:10:41+08:00, Justin.He@dev3-240.dev.cn.tlan +4 -1     get node id of single user api node from API regconf

  ndb/src/mgmsrv/MgmtSrvr.hpp@1.54, 2007-09-30 16:10:41+08:00, Justin.He@dev3-240.dev.cn.tlan +2 -1     add a variable definition regarding API node id

  ndb/src/mgmsrv/Services.cpp@1.78, 2007-09-30 16:10:41+08:00, Justin.He@dev3-240.dev.cn.tlan +4 -2     send node status to mgmapi clients

# 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:	Justin.He
# Host:	dev3-240.dev.cn.tlan
# Root:	/home/justin.he/mysql/mysql-5.0/bug27999-5.0-ndb

--- 1.55/ndb/include/mgmapi/mgmapi.h	2007-09-30 16:10:49 +08:00
+++ 1.56/ndb/include/mgmapi/mgmapi.h	2007-09-30 16:10:50 +08:00

@@ -352,6 +352,10 @@
sizeof("000.000.000.000")+1 #endif ]; + /* the id of API node which is permitted only to connect to NDBD node + * after enter single user mode; + */

+ int single_user_api;
Do you need help?X

   };  

   /**

  • 1.72/ndb/src/mgmapi/mgmapi.cpp 2007-09-30 16:10:50 +08:00 +++ 1.73/ndb/src/mgmapi/mgmapi.cpp 2007-09-30 16:10:50 +08:00
    @@ -734,6 +734,8 @@
    } else if(strcmp("address", field) == 0){ strncpy(state->connect_address, value, sizeof(state->connect_address)); state->connect_address[sizeof(state->connect_address)-1]= 0; + } else if(strcmp("single_user_api", field) == 0){ + state->single_user_api = atoi(value); } else { ndbout_c("Unknown field: %s", field); }
  • 1.80/ndb/src/mgmclient/CommandInterpreter.cpp 2007-09-30 16:10:50 +08:00 +++ 1.81/ndb/src/mgmclient/CommandInterpreter.cpp 2007-09-30 16:10:50 +08:00
    @@ -1597,12 +1597,21 @@
    const char *proc_name, int no_proc, ndb_mgm_node_type type, int master_id) { - int i; + int i, single_user_api=0; ndbout << "[" << proc_name << "(" << ndb_mgm_get_node_type_string(type) << ")]\t" << no_proc << " node(s)" << endl; for(i=0; i < state->no_of_nodes; i++) { struct ndb_mgm_node_state *node_state= &(state->node_states[i]); + if(node_state->node_type == NDB_MGM_NODE_TYPE_NDB) { + if(node_state->node_status == NDB_MGM_NODE_STATUS_SINGLEUSER) { + single_user_api = node_state->single_user_api; + break; + } + } + } + for(i=0; i < state->no_of_nodes; i++) { + struct ndb_mgm_node_state *node_state= &(state->node_states[i]); if(node_state->node_type == type) { int node_id= node_state->node_id; ndbout << "id=" << node_id;
    @@ -1628,6 +1637,12 @@
    ndbout << ", Master"; } } + if (type == NDB_MGM_NODE_TYPE_API && single_user_api) { + if (single_user_api == node_id) + ndbout << ", " << status_string(NDB_MGM_NODE_STATUS_SINGLEUSER); + else + ndbout << ", " << "no operations allowed"; + } ndbout << ")" << endl; } else { ndb_mgm_first(it);
    @@ -1636,8 +1651,12 @@
    ndb_mgm_get_string_parameter(it, CFG_NODE_HOST, &config_hostname); if (config_hostname == 0 || config_hostname[0] == 0) config_hostname= "any host"; - ndbout_c(" (not connected, accepting connect from %s)", - config_hostname); + if (type == NDB_MGM_NODE_TYPE_API && single_user_api) + ndbout_c(" (not connected, accepting connect from %s, no operations allowed)", + config_hostname); + else + ndbout_c(" (not connected, accepting connect from %s)", + config_hostname); } else {
  • 1.117/ndb/src/mgmsrv/MgmtSrvr.cpp 2007-09-30 16:10:50 +08:00 +++ 1.118/ndb/src/mgmsrv/MgmtSrvr.cpp 2007-09-30 16:10:50 +08:00
    @@ -1492,7 +1492,8 @@
    Uint32 * dynamic, Uint32 * nodegroup, Uint32 * connectCount, - const char **address) + const char **address, + Uint32 * single_user_api) { if (getNodeType(nodeId) == NDB_MGM_NODE_TYPE_API || getNodeType(nodeId) == NDB_MGM_NODE_TYPE_MGM) {
    @@ -1516,6 +1517,8 @@
    • dynamic = node.m_state.dynamicId;
    • nodegroup = node.m_state.nodeGroup;
    • connectCount = node.m_info.m_connectCount; + if (single_user_api) + * single_user_api = node.m_state.singleUserApi;

   switch(node.m_state.startLevel){
   case NodeState::SL_CMVMI:

  • 1.53/ndb/src/mgmsrv/MgmtSrvr.hpp 2007-09-30 16:10:50 +08:00 +++ 1.54/ndb/src/mgmsrv/MgmtSrvr.hpp 2007-09-30 16:10:50 +08:00
    @@ -221,7 +221,8 @@
    Uint32 * dynamicId, Uint32 * nodeGroup, Uint32 * connectCount, - const char **address); + const char **address, + Uint32 * single_user_api=NULL);

   // All the functions below may return any of this error codes:    // NO_CONTACT_WITH_PROCESS, PROCESS_NOT_CONFIGURED, WRONG_PROCESS_TYPE,

  • 1.77/ndb/src/mgmsrv/Services.cpp 2007-09-30 16:10:50 +08:00 +++ 1.78/ndb/src/mgmsrv/Services.cpp 2007-09-30 16:10:50 +08:00
    @@ -930,12 +930,13 @@
    version = 0, dynamicId = 0, nodeGroup = 0, - connectCount = 0; + connectCount = 0, + single_user_api = 0; bool system; const char *address= NULL; mgmsrv.status(nodeId, &status, &version, &startPhase, &system, &dynamicId, &nodeGroup, &connectCount, - &address); + &address, &single_user_api); output->println("node.%d.type: %s", nodeId, ndb_mgm_get_node_type_string(type));
    @@ -948,6 +949,7 @@
    output->println("node.%d.node_group: %d", nodeId, nodeGroup); output->println("node.%d.connect_count: %d", nodeId, connectCount); output->println("node.%d.address: %s", nodeId, address ? address : ""); + output->println("node.%d.single_user_api: %d", nodeId, single_user_api); }

 }

-- 
MySQL Code Commits Mailing List
For list archives: 
http://lists.mysql.com/commits
To unsubscribe:    
http://lists.mysql.com/commits?unsub=lists@pantek.com
Received on Sun Sep 30 04:29:38 2007

This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 09:45:41 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library