You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by db...@apache.org on 2016/03/17 17:24:13 UTC

[2/3] incubator-trafodion git commit: TRAFODION-1885

TRAFODION-1885


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/83d96555
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/83d96555
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/83d96555

Branch: refs/heads/master
Commit: 83d965550f45ccc1c2b11439074685835a9048b6
Parents: c6bc8a3
Author: Trina Krug <tr...@edev05.esgyn.local>
Authored: Thu Mar 17 01:29:48 2016 +0000
Committer: Trina Krug <tr...@edev05.esgyn.local>
Committed: Thu Mar 17 01:29:48 2016 +0000

----------------------------------------------------------------------
 core/sqf/monitor/linux/cmsh.cxx  | 30 ++++++++++++------
 core/sqf/monitor/linux/shell.cxx | 57 ++++++++++++++++++++++++++++-------
 2 files changed, 66 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/83d96555/core/sqf/monitor/linux/cmsh.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/cmsh.cxx b/core/sqf/monitor/linux/cmsh.cxx
index 6144a79..c8c4975 100755
--- a/core/sqf/monitor/linux/cmsh.cxx
+++ b/core/sqf/monitor/linux/cmsh.cxx
@@ -128,21 +128,31 @@ int CCmsh::GetClusterState( PhysicalNodeNameMap_t &physicalNodeMap )
             if (it != physicalNodeMap.end())
             {
                // TEST_POINT and Exclude List : to force state down on node name 
-                const char *downNodeName = getenv( TP001_NODE_DOWN );
-                const char *downNodeList = getenv( TRAF_EXCLUDE_LIST );
-                if (( downNodeList != NULL && 
-                    (strstr(downNodeList,nodeName.c_str()))) ||
-                    ( downNodeName != NULL && 
-                   !strcmp( downNodeName, nodeName.c_str() ) ))
-                 {
-                    nodeState = StateDown ;
-                }
+               const char *downNodeName = getenv( TP001_NODE_DOWN );
+               const char *downNodeList = getenv( TRAF_EXCLUDE_LIST );
+	       string downNodeString = " ";
+	       if (downNodeList)
+	       {
+		 downNodeString += downNodeList;
+	         downNodeString += " ";
+	       }
+	       string downNodeToFind = " ";
+	       downNodeToFind += nodeName.c_str();
+	       downNodeToFind += " ";
+               if (((downNodeList != NULL) && 
+		      strstr(downNodeString.c_str(),downNodeToFind.c_str())) ||
+                   ( (downNodeName != NULL) && 
+                     !strcmp( downNodeName, nodeName.c_str()) ))
+              {
+                   nodeState = StateDown;
+              }
+	   
                 // Set physical node state
                 physicalNode = it->second;
                 physicalNode->SetState( nodeState );
             }
         }
-    }
+    }	
 
     TRACE_EXIT;
     return( rc );

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/83d96555/core/sqf/monitor/linux/shell.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/shell.cxx b/core/sqf/monitor/linux/shell.cxx
index ca3f3d3..fc1de2a 100755
--- a/core/sqf/monitor/linux/shell.cxx
+++ b/core/sqf/monitor/linux/shell.cxx
@@ -186,14 +186,23 @@ bool init_pnode_map( void )
         // TEST_POINT and exclude list : to force state down on node name
          NodeState_t nodeState = StateUp;
          const char *downNodeName = getenv( TP001_NODE_DOWN );
-        const char *downNodeList = getenv( TRAF_EXCLUDE_LIST );
-        if (( downNodeList != NULL && 
-            (strstr(downNodeList,pnodeConfig->GetName()))) ||
+         const char *downNodeList = getenv( TRAF_EXCLUDE_LIST );
+	 string downNodeString = " ";
+	 if (downNodeList)
+	 {
+	   downNodeString += downNodeList;
+	   downNodeString += " ";
+	 }
+	 string downNodeToFind = " ";
+	 downNodeToFind += pnodeConfig->GetName();
+	 downNodeToFind += " ";
+         if (((downNodeList != NULL) && 
+	    (strstr(downNodeString.c_str(),downNodeToFind.c_str()))) ||
             ( downNodeName != NULL && 
              !strcmp( downNodeName, pnodeConfig->GetName() ) ))
-        {
-            nodeState = StateDown;
-        }
+         {
+             nodeState = StateDown;
+         }
 
         // effectively remove spare nodes on startup only
         if ( SpareNodeColdStandby && pnodeConfig->IsSpareNode() )
@@ -3184,6 +3193,13 @@ void listNodeInfo( int nid )
     }
 
     const char *downNodeList = getenv( TRAF_EXCLUDE_LIST );
+    string downNodeString = " ";
+    if (downNodeList)
+    {
+      downNodeString += downNodeList;
+      downNodeString += " ";
+    }
+		 
     bool needBanner = true;
     bool getMoreInfo = false;
     do
@@ -3230,10 +3246,18 @@ void listNodeInfo( int nid )
                         for (i=0; i < msg->u.reply.u.node_info.num_returned; i++)
                         {
                              CPNodeConfig *pConfig = ClusterConfig.GetPNodeConfig (msg->u.reply.u.node_info.node[i].pnid);
-                            if ((downNodeList != NULL ) && (pConfig != NULL) && (strstr(downNodeList, pConfig->GetName())))
-                            {
-                                continue; // We do not want to consider this node since it is in our exclude list
-                            }
+			     
+			     if (pConfig != NULL)
+			     {
+			       string downNodeToFind = " ";
+	                       downNodeToFind += pConfig->GetName();
+	                       downNodeToFind += " ";
+
+                               if  ((downNodeList != NULL) && strstr(downNodeString.c_str(),downNodeToFind.c_str()))
+                               {
+                                   continue; // We do not want to consider this node since it is in our exclude list
+                               }
+			     }
 
                             if ( last_nid != -1 )
                             {
@@ -3592,6 +3616,13 @@ void node_cmd (char *cmd_tail)
     char delimiter;
     char *ptr;
     const char *downNodeList = getenv( TRAF_EXCLUDE_LIST );
+    string downNodeString = " ";
+    
+    if (downNodeList)
+    {
+	 downNodeString += downNodeList;
+	 downNodeString += " ";
+    }
 
     if (*cmd_tail == '\0')
     {
@@ -3615,7 +3646,11 @@ void node_cmd (char *cmd_tail)
                 pnodeConfig = lnodeConfig->GetPNodeConfig();
                 if ( pnodeConfig )
                 {
-                   if ((!downNodeList) || ((downNodeList) && !(strstr(downNodeList,pnodeConfig->GetName()))))
+		   string downNodeToFind = " ";
+	           downNodeToFind += pnodeConfig->GetName();
+	           downNodeToFind += " ";
+     
+                   if (((!downNodeList) || ((downNodeList) && !(strstr(downNodeString.c_str(),downNodeToFind.c_str())))))
                        printf( "[%s] Node[%d]=%s, %s, %s\n"
                           , MyName
                           , i