You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by su...@apache.org on 2018/06/16 17:09:31 UTC

[01/50] [abbrv] trafodion git commit: Update.

Repository: trafodion
Updated Branches:
  refs/heads/master 5b5ab328a -> 07e94f3ba


Update.


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

Branch: refs/heads/master
Commit: b0f649b78c52e6d449c927f608b5f66346489bf7
Parents: 77e13d1
Author: Dave George <de...@gmail.com>
Authored: Fri Mar 23 18:45:49 2018 +0000
Committer: Dave George <de...@gmail.com>
Committed: Fri Mar 23 18:45:49 2018 +0000

----------------------------------------------------------------------
 core/sqf/src/seabed/test/go22 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/b0f649b7/core/sqf/src/seabed/test/go22
----------------------------------------------------------------------
diff --git a/core/sqf/src/seabed/test/go22 b/core/sqf/src/seabed/test/go22
index dafb35f..7326fba 100755
--- a/core/sqf/src/seabed/test/go22
+++ b/core/sqf/src/seabed/test/go22
@@ -33,7 +33,7 @@ node
 ! Start the monitor processes across the cluster
 startup
 ! Start the client process
-exec {nowait name \$CLI} $xclient $*
+exec {$nid0 nowait name \$CLI} $xclient $*
 exec {$nid0 name \$CLI2} $xclient $*
 ! Display process status to see new processes
 ps


[27/50] [abbrv] trafodion git commit: Forward StringIds of path/ldpath/program.

Posted by su...@apache.org.
Forward StringIds of path/ldpath/program.


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

Branch: refs/heads/master
Commit: 4fc4ad3d0723339fc5fcfca5fd073c8a8de0f8bd
Parents: 8175d44
Author: Dave George <de...@gmail.com>
Authored: Thu Apr 12 18:52:50 2018 +0000
Committer: Dave George <de...@gmail.com>
Committed: Thu Apr 12 18:52:50 2018 +0000

----------------------------------------------------------------------
 core/sqf/monitor/linux/reqqueue.cxx | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/4fc4ad3d/core/sqf/monitor/linux/reqqueue.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqqueue.cxx b/core/sqf/monitor/linux/reqqueue.cxx
index 6825652..ac559c2 100644
--- a/core/sqf/monitor/linux/reqqueue.cxx
+++ b/core/sqf/monitor/linux/reqqueue.cxx
@@ -1499,6 +1499,13 @@ void CIntNewProcReq::performRequest()
              lnode->GetState() == State_Shutdown ) )
         {   // Create the CProcess object and store the various
             // process parameters.
+#ifndef NAMESERVER_PROCESS
+            // cause strings to be forwarded
+            string path;
+            Config->strIdToString( pathStrId_, path );
+            Config->strIdToString( ldpathStrId_, path );
+            Config->strIdToString( programStrId_, path );
+#endif
             CProcess *newProcess ;
             newProcess = lnode->GetNode()->
                 CreateProcess ( parentProcess,


[34/50] [abbrv] trafodion git commit: Scale testing fixes.

Posted by su...@apache.org.
Scale testing fixes.


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

Branch: refs/heads/master
Commit: 3931a75fad052df35072a7109aa5e4babbb90f38
Parents: db65660
Author: Zalo Correa <za...@esgyn.com>
Authored: Mon May 14 06:24:43 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Mon May 14 06:24:43 2018 -0700

----------------------------------------------------------------------
 .../export/include/common/evl_sqlog_eventnum.h  |  34 +-
 core/sqf/export/include/trafconf/trafconfig.h   |   8 +-
 core/sqf/monitor/linux/cluster.cxx              | 431 +++++++++++++++----
 core/sqf/monitor/linux/cluster.h                |  12 +-
 core/sqf/monitor/linux/commaccept.cxx           |   4 +-
 core/sqf/monitor/linux/healthcheck.cxx          |  25 +-
 core/sqf/monitor/linux/healthcheck.h            |   1 +
 core/sqf/monitor/linux/internal.h               |  10 +-
 core/sqf/monitor/linux/monitor.cxx              | 143 ++++--
 core/sqf/monitor/linux/msgdef.h                 |   1 +
 core/sqf/monitor/linux/nameserver.cxx           |   9 +-
 core/sqf/monitor/linux/nsprocess.cxx            |   6 +-
 core/sqf/monitor/linux/nsreqnewproc.cxx         |   1 +
 core/sqf/monitor/linux/nsreqqueue.cxx           |   2 +-
 core/sqf/monitor/linux/pnode.cxx                |  35 +-
 core/sqf/monitor/linux/process.cxx              | 100 +++--
 core/sqf/monitor/linux/process.h                |   3 +-
 core/sqf/monitor/linux/ptpclient.cxx            | 187 +++++++-
 core/sqf/monitor/linux/ptpclient.h              |  10 +
 core/sqf/monitor/linux/ptpcommaccept.cxx        |  41 +-
 core/sqf/monitor/linux/redirector.cxx           |  88 +++-
 core/sqf/monitor/linux/replicate.cxx            |   9 +
 core/sqf/monitor/linux/replicate.h              |   2 +
 core/sqf/monitor/linux/reqdump.cxx              |   9 +-
 core/sqf/monitor/linux/reqnewproc.cxx           |   3 +-
 core/sqf/monitor/linux/reqprocinfo.cxx          | 151 ++++---
 core/sqf/monitor/linux/reqqueue.cxx             | 282 +++++++++++-
 core/sqf/monitor/linux/reqqueue.h               |  48 +++
 core/sqf/monitor/linux/shell.cxx                |  15 +-
 core/sqf/monitor/linux/system.cxx               |   2 +-
 core/sqf/monitor/linux/tmsync.cxx               |  12 +
 core/sqf/monitor/linux/zclient.cxx              | 120 +++++-
 core/sqf/monitor/linux/zclient.h                |   2 +
 core/sqf/monitor/linux/zootest.cxx              |   8 +
 core/sqf/monitor/test/monitor.env               |  40 +-
 core/sqf/monitor/test/sqconfig.monitor.virtual  |   6 +-
 core/sqf/sqenvcom.sh                            |  30 +-
 core/sqf/sql/scripts/monitor.env                |   2 +-
 core/sqf/sql/scripts/sqconfig                   |   6 +-
 core/sqf/sql/scripts/sqnameserver.pm            |   4 +-
 core/sqf/sql/scripts/sqnodes.pm                 |   4 +-
 41 files changed, 1526 insertions(+), 380 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/export/include/common/evl_sqlog_eventnum.h
----------------------------------------------------------------------
diff --git a/core/sqf/export/include/common/evl_sqlog_eventnum.h b/core/sqf/export/include/common/evl_sqlog_eventnum.h
index e9186e1..2d630c9 100644
--- a/core/sqf/export/include/common/evl_sqlog_eventnum.h
+++ b/core/sqf/export/include/common/evl_sqlog_eventnum.h
@@ -85,7 +85,8 @@
 #define MON_CLUSTER_MARKDOWN_2              101011102
 #define MON_CLUSTER_MARKDOWN_3              101011103
 //#define MON_CLUSTER_MARKUP                  101011201
-#define MON_CLUSTER_NODE_TM_READY           101011300
+#define MON_CLUSTER_NODE_TM_READY_1         101011301
+#define MON_CLUSTER_NODE_TM_READY_2         101011302
 #define MON_CLUSTER_FORCEDOWN_1             101011401
 #define MON_CLUSTER_FORCEDOWN_2             101011402
 #define MON_CLUSTER_CLUSTER_MANAGER         101011501
@@ -245,6 +246,13 @@
 
 #define MON_PINGSOCKPEER_1                  101015201
 #define MON_PINGSOCKPEER_2                  101015202
+#define MON_PINGSOCKPEER_3                  101015203
+#define MON_PINGSOCKPEER_4                  101015204
+
+#define MON_CLUSTER_ASSIGNMONITORLEADER_1   101015301
+#define MON_CLUSTER_ASSIGNMONITORLEADER_2   101015302
+#define MON_CLUSTER_ASSIGNMONITORLEADER_3   101015303
+#define MON_CLUSTER_ASSIGNMONITORLEADER_4   101015304
 
 /* Module: monitor.cxx = 02 */
 
@@ -265,6 +273,7 @@
 #define MON_MONITOR_MAIN_15                 101020115
 #define MON_MONITOR_MAIN_16                 101020116
 #define MON_MONITOR_MAIN_17                 101020117
+#define MON_MONITOR_MAIN_18                 101020118
 #define MON_MONITOR_TMLEADER_1              101020201
 #define MON_MONITOR_TMLEADER_2              101020202
 #define MON_MONITOR_DEATH_HANDLER_1         101020301
@@ -724,16 +733,19 @@
 #define MON_REQ_NAMESERVER_DELETE_3         101181203
 #define MON_REQ_NAMESERVER_DELETE_4         101181204
 #define MON_REQ_NAMESERVER_INFO_1           101181301
-
 #define MON_REQ_EVALREQ_PERFORMANCE_1       101181501
 #define MON_INTREQ_CLONEPROC_1              101181601
 #define MON_INTREQ_EXIT_1                   101181701
 #define MON_INTREQ_NEWPROC_1                101181801
+#define MON_INTREQ_NEWPROC_2                101181802
 #define MON_INTREQ_NOTIFY_1                 101181901
 #define MON_INTREQ_NOTIFY_2                 101181902
 #define MON_INTREQ_NOTIFY_3                 101181903
 #define MON_INTREQ_NOTIFY_4                 101181904
 #define MON_INTREQ_OPEN_1                   101182001
+#define MON_REQ_IODATA_1                    101182201
+#define MON_REQ_STDIN_1                     101182301
+#define MON_REQ_STDIN_2                     101182302
 
 /* Module: clio.cxx = 19 */
 #define MON_CLIO_ACQUIRE_MSG_1              101190101
@@ -785,7 +797,8 @@
 #define MON_HEALTHCHECK_WAKEUP_1            101230401
 #define MON_HEALTHCHECK_WAKEUP_2            101230402
 #define MON_HEALTHCHECK_Q_BLOCK             101230501
-#define MON_HEALTHCHECK_STOP_NS_1           101230601
+
+#define MON_HEALTHCHECK_STOP_NS_1           101230701
 
 /* Module: sdtimer.cxx = 24 */
 #define MON_SDTIMER_SOFTDOG_TH_1            101240101
@@ -945,6 +958,7 @@
 #define MON_ZCLIENT_WATCHMASTERNODEDELETE_2 101372106
 #define MON_ZCLIENT_WATCHMASTERNODEDELETE_3 101372107
 #define MON_ZCLIENT_CREATEORSETMASTERWATCH  101372108
+#define MON_ZCLIENT_CREATEORSETMASTERINFO   101372109
 
 /* Module: zconfig.cxx = 38 */
 #define ZCONFIG_ZCONFIG_1                   101380101
@@ -1018,6 +1032,20 @@
 
 /* Module ptpclient.cxx = 93 */
 #define PTPCLIENT_PTPCLIENT_1               101930101
+#define PTPCLIENT_STDINREQ_1                101930201
+#define PTPCLIENT_STDINREQ_2                101930202
+#define PTPCLIENT_STDIODATA_1               101930301
+#define PTPCLIENT_STDIODATA_2               101930302
+
+/* Module ptpcommaccept.cxx = 94 */
+#define PTP_COMMACCEPT_1                    101940101
+#define PTP_COMMACCEPT_2                    101940102
+#define PTP_COMMACCEPT_3                    101940103
+#define PTP_COMMACCEPT_4                    101940104
+#define PTP_COMMACCEPT_5                    101940105
+#define PTP_COMMACCEPT_6                    101940106
+#define PTP_COMMACCEPT_7                    101940107
+#define PTP_COMMACCEPT_8                    101940108
 
 /**********************************************/
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/export/include/trafconf/trafconfig.h
----------------------------------------------------------------------
diff --git a/core/sqf/export/include/trafconf/trafconfig.h b/core/sqf/export/include/trafconf/trafconfig.h
index d68a8d0..2eba1c8 100644
--- a/core/sqf/export/include/trafconf/trafconfig.h
+++ b/core/sqf/export/include/trafconf/trafconfig.h
@@ -50,7 +50,11 @@
 #define TC_PERSIST_KEY_MAX              64
 #define TC_PERSIST_VALUE_MAX          4096
 #define TC_PERSIST_KEYS_VALUE_MAX     4096
-#define TC_NODES_MAX                  1024
+#define TC_NODES_MAX                  1024 // This can be higher when needed and
+                                           // will have performance implications
+                                           // in the monitor process.
+                                           // NOTE: Must increment by 64, see
+                                           //       monitor's msgdef.h MAX_NODES
 #define TC_SPARE_NODES_MAX             256
 #define TC_UNIQUE_STRING_VALUE_MAX    4096
 
@@ -111,7 +115,7 @@ typedef enum {
       TCDBSTOREUNDEFINED = 0     
     , TCDBMYSQL          = 1 // MySQL Database
     , TCDBPOSTGRESQL     = 2 // PostgresQL Database   [TBD]
-    , TCDBSQLITE         = 3 // Sqlite Database       [deprecated]
+    , TCDBSQLITE         = 3 // Sqlite Database
 } TcStorageType_t;
 
 typedef enum {

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/cluster.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/cluster.cxx b/core/sqf/monitor/linux/cluster.cxx
index 4646433..a7ccdf1 100644
--- a/core/sqf/monitor/linux/cluster.cxx
+++ b/core/sqf/monitor/linux/cluster.cxx
@@ -1,4 +1,4 @@
-// ///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
 //
 // @@@ START COPYRIGHT @@@
 //
@@ -99,7 +99,6 @@ extern CommType_t CommType;
 extern int MyPNID;
 
 extern CReqQueue ReqQueue;
-extern char Node_name[MPI_MAX_PROCESSOR_NAME];
 
 extern CMonitor *Monitor;
 extern CNodeContainer *Nodes;
@@ -354,13 +353,13 @@ void CCluster::NodeTmReady( int nid )
             char la_buf[MON_STRING_BUF_SIZE];
             sprintf( la_buf, "[%s], Soft Node up! pnid=%d, name=(%s)\n"
                    , method_name, MyNode->GetPNid(), MyNode->GetName());
-            mon_log_write(MON_CLUSTER_NODE_TM_READY, SQ_LOG_INFO, la_buf);
+            mon_log_write(MON_CLUSTER_NODE_TM_READY_1, SQ_LOG_INFO, la_buf);
         }
         else
         {
             char la_buf[MON_STRING_BUF_SIZE];
             sprintf(la_buf, "[%s], Node activated! pnid=%d, name=(%s) \n", method_name, MyNode->GetPNid(), MyNode->GetName());
-            mon_log_write(MON_CLUSTER_NODE_TM_READY, SQ_LOG_INFO, la_buf);
+            mon_log_write(MON_CLUSTER_NODE_TM_READY_2, SQ_LOG_INFO, la_buf);
 
             // Let other monitors know the node is up
             CReplActivateSpare *repl = new CReplActivateSpare( MyPNID, -1 );
@@ -398,9 +397,30 @@ void CCluster::NodeReady( CNode *spareNode )
     TRACE_EXIT;
 }
 
+void CCluster::UpdateMonitorPort (const char* newMaster)
+{
+    const char method_name[] = "CCluster::UpdateMonitorPort";
+    TRACE_ENTRY;
+    
+    char *monitorPort = getenv ("MONITOR_COMM_PORT");
+    if ((monitorPort) && (newMaster))
+    {
+         strcpy( IntegratingMonitorPort, newMaster );
+         strcat( IntegratingMonitorPort, ":");
+         strcat( IntegratingMonitorPort, monitorPort);
+
+          if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+          {
+               trace_printf("%s@%d" " (MasterMonitor) UpdateMonitorPort Updating IntegratingMonitorPort to %s\n",
+                             method_name, __LINE__,IntegratingMonitorPort );
+          }
+    } 
+    TRACE_EXIT;
+}
+
 // Assign leaders as required
 // Current leaders are TM Leader and Monitor Leader
-void CCluster::AssignLeaders( int pnid, bool checkProcess )
+void CCluster::AssignLeaders( int pnid, const char* failedMaster, bool checkProcess )
 {
     const char method_name[] = "CCluster::AssignLeaders";
     TRACE_ENTRY;
@@ -408,31 +428,31 @@ void CCluster::AssignLeaders( int pnid, bool checkProcess )
 #ifndef NAMESERVER_PROCESS
     AssignTmLeader ( pnid, checkProcess );
 #else
+    pnid = pnid;
     checkProcess = checkProcess;
 #endif
-    AssignMonitorLeader ( pnid );
+    AssignMonitorLeader ( failedMaster );
 
     TRACE_EXIT;
 }
 
-// Assign montior lead in the case of failure
-void CCluster::AssignMonitorLeader( int pnid )
+// Assign monitor lead in the case of failure
+void CCluster::AssignMonitorLeader( const char* failedMaster )
 {
     const char method_name[] = "CCluster::AssignMonitorLeader";
     TRACE_ENTRY;
 
     int i = 0;
     int rc = 0;
-
-    int monitorLeaderPNid = monitorLeaderPNid_;
+    
+    int monitorLeaderPNid = -1;
     CNode *node = NULL;
-
-    if (monitorLeaderPNid_ != pnid)
+    
+    if (failedMaster == NULL)
     {
         if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
         {
-            trace_printf( "%s@%d" " - (MasterMonitor) returning, pnid %d != monitorLead %d\n"
-                        , method_name, __LINE__, pnid, monitorLeaderPNid_ );
+            trace_printf( "%s@%d" " - (MasterMonitor) failedMaster is NULL, returning\n" , method_name, __LINE__);
         }
         TRACE_EXIT;
         return;
@@ -440,22 +460,93 @@ void CCluster::AssignMonitorLeader( int pnid )
 
     if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
     {
-        trace_printf( "%s@%d" " - (MasterMonitor) Node "  "%d" " MonitorLeader failed!\n"
-                    , method_name, __LINE__, monitorLeaderPNid_ );
+        trace_printf( "%s@%d" " - (MasterMonitor) "  " MonitorLeader (%s) failed!\n"
+                    , method_name, __LINE__, failedMaster );
     }
 
-    for (i=0; i<GetConfigPNodesMax(); i++)
+    if (!IsAgentMode || !ZClientEnabled)
     {
-        monitorLeaderPNid++;
-
-        if (monitorLeaderPNid == GetConfigPNodesMax())
+        if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+        {
+               trace_printf( "%s@%d" " - (MasterMonitor) not AgentMode or zookeeper not enabled, returning\n"
+                 , method_name, __LINE__);
+        }
+        TRACE_EXIT;
+        return;
+    }
+    // delete old master if needed
+    const char *masterMonitor = ZClient->WaitForAndReturnMaster (false);
+    if (masterMonitor)
+    {   
+        // IFF it is the failed master, delete, do not delete anything else because we could delete a new master
+        if (strcmp (masterMonitor, failedMaster) == 0)
         {
-            monitorLeaderPNid = 0; // restart with nid 0
+            ZClient->WatchNodeMasterDelete (failedMaster);
+            if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+            {
+                 trace_printf( "%s@%d" " - (MasterMonitor) deleting master %s\n"
+                              , method_name, __LINE__, masterMonitor );
+             }
         }
+        // no worries
+        else
+        {            
+             rc = ZClient->WatchMasterNode( masterMonitor ); 
+             UpdateMonitorPort ( masterMonitor );
+             if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+             {
+                   trace_printf( "%s@%d" " - (MasterMonitor) master did not match, set watch (rc = %d) and returning %s\n"
+                     , method_name, __LINE__, rc, masterMonitor );
+             }
+             TRACE_EXIT;
+             return;
+         }
+    }
+
+    // choose a new master
+    if (((MyNode) && ((MyNode->GetState() != State_Up) ||(!IAmIntegrated))) || (MyNode == NULL /* not set up yet*/))
+    {
+        // Do not let this monitor participate in choosing the master.  It can wait until an integrated
+        // monitor makes a decision.
+         if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+         {
+              trace_printf( "%s@%d" " - (MasterMonitor) This Node is not set up yet and will not participate in master choice!\n"
+                    , method_name, __LINE__);
+         }
+         
+         // wait until another monitor choose a master
+         const char *masterMonitor = ZClient->WaitForAndReturnMaster (true);
+         if (masterMonitor)
+         {
+             rc = ZClient->WatchMasterNode( masterMonitor ); 
+             if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+             {
+                  trace_printf("%s@%d" " (MasterMonitor) AssignMonitorLeader WatchMasterNode with rc = %d\n", method_name, __LINE__, rc);
+             }
+
+          UpdateMonitorPort ( masterMonitor );
+          }
+          TRACE_EXIT;
+          return;
+    }
+ 
+    // For all monitors who are up - choose the master using the same logic
+    for (i=0; i<GetConfigPNodesMax(); i++)
+    {
+        monitorLeaderPNid++; // set to -1, so this will bump it to 0 on the first time through
 
-        if (monitorLeaderPNid == pnid)
+        if (monitorLeaderPNid == GetConfigPNodesMax())
         {
-            continue; // this is the node that is going down, skip it
+             if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+             {
+                 trace_printf("%s@%d" " (MasterMonitor) AssignMonitorLeader  Unable to create or set watch\n", method_name, __LINE__);
+             }
+             char    buf[MON_STRING_BUF_SIZE];
+             snprintf( buf, sizeof(buf)
+                           , "[%s], Unable to create or set watch on master, hit max\n"
+                           , method_name );
+            mon_log_write(MON_CLUSTER_ASSIGNMONITORLEADER_1, SQ_LOG_ERR, buf);
+            break;
         }
 
         if (Node[monitorLeaderPNid] == NULL)
@@ -465,6 +556,12 @@ void CCluster::AssignMonitorLeader( int pnid )
 
         node = Node[monitorLeaderPNid];
 
+        // skip this node
+        if ( node == NULL )
+        {
+            continue; 
+        }
+
         if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
         {
             trace_printf( "%s@%d - Node pnid=%d (%s), phase=%s, isSoftNodeDown=%d\n"
@@ -483,43 +580,60 @@ void CCluster::AssignMonitorLeader( int pnid )
             continue; // skip this node for any of the above reasons
         }
 
-        monitorLeaderPNid_ = node->GetPNid();
-
         if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
         {
-            trace_printf("%s@%d" " - Node "  "%d" " is the new monitorLeaderPNid_." "\n", method_name, __LINE__, monitorLeaderPNid_);
+            trace_printf("%s@%d" " - Node "  "%d" " is the new monitorLeaderPNid." "\n", method_name, __LINE__, node->GetPNid());
         }
 
-        if (ZClientEnabled)
+        const char *masterMonitor = ZClient->WaitForAndReturnMaster (false);
+    
+        //nobody has written it yet, we don't want to overwrite anything
+        if (!masterMonitor)
         {
             rc = ZClient->CreateMasterZNode ( node->GetName() );
             if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
             {
                 trace_printf("%s@%d" " (MasterMonitor) AssignMonitorLeader CreateMasterZNode with rc = %d\n", method_name, __LINE__, rc);
             }
+            char    buf[MON_STRING_BUF_SIZE];
+            snprintf( buf, sizeof(buf)
+                              , "[%s], Master Monitor is %s on node %d\n"
+                              , method_name, node->GetName(), node->GetPNid() );
+            mon_log_write(MON_CLUSTER_ASSIGNMONITORLEADER_2, SQ_LOG_INFO, buf);
+
             if ( (rc == ZOK) || (rc == ZNODEEXISTS) )
             {
-                if ( IsAgentMode )
-                {
-                    rc = ZClient->WatchMasterNode( node->GetName( ) );
-                    if ( trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC) )
-                    {
-                        trace_printf( "%s@%d" " (MasterMonitor) AssignMonitorLeader WatchMasterNode with rc = %d\n", method_name, __LINE__, rc );
-                    }
-                }
+                 rc = ZClient->WatchMasterNode( node->GetName() ); 
+                 if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+                 {
+                     trace_printf("%s@%d" " (MasterMonitor) AssignMonitorLeader WatchMasterNode with rc = %d\n", method_name, __LINE__, rc);
+                 }
             }
             else
             {
                  if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
                  {
-                     trace_printf("%s@%d" " (MasterMonitor) AssignMonitorLeader  Unable to set create or set watch\n", method_name, __LINE__);
+                     trace_printf("%s@%d" " (MasterMonitor) AssignMonitorLeader  Unable to create or set watch\n", method_name, __LINE__);
                  }
                  char    buf[MON_STRING_BUF_SIZE];
                  snprintf( buf, sizeof(buf)
-                           , "[%s], Unable to set create or set watch on master node %s\n"
+                           , "[%s], Unable to create or set watch on master node %s\n"
                            , method_name, node->GetName() );
-                 mon_log_write(MON_ZCLIENT_CREATEORSETMASTERWATCH, SQ_LOG_ERR, buf);
+                 mon_log_write(MON_CLUSTER_ASSIGNMONITORLEADER_3, SQ_LOG_ERR, buf);
             }
+       }
+       else
+       {
+           rc = ZClient->WatchMasterNode( masterMonitor ); 
+           char    buf[MON_STRING_BUF_SIZE];
+           snprintf( buf, sizeof(buf)
+                          , "[%s], Master Monitor is %s\n"
+                          , method_name, masterMonitor);
+           mon_log_write(MON_CLUSTER_ASSIGNMONITORLEADER_4, SQ_LOG_INFO, buf);
+           if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+           {
+               trace_printf("%s@%d" " (MasterMonitor) AssignMonitorLeader WatchMasterNode with rc = %d\n", method_name, __LINE__, rc);
+           }
         }
 
         break;
@@ -579,7 +693,7 @@ void CCluster::AssignTmLeader( int pnid, bool checkProcess )
                 {
                     if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
                     {
-                        trace_printf( "%s@%d - Getting process from Name Server, nid=%d, type%s\n"
+                        trace_printf( "%s@%d - Getting process from Name Server, nid=%d, type=%s\n"
                                     , method_name, __LINE__
                                     , tmLeaderNid_, ProcessTypeString(ProcessType_DTM) );
                     }
@@ -711,7 +825,6 @@ CCluster::CCluster (void)
       configPNodesCount_ (-1),
       configPNodesMax_ (-1),
       nodeMap_ (NULL),
-      monitorLeaderPNid_ (-1),
 #ifndef NAMESERVER_PROCESS
       tmLeaderNid_ (-1),
       tmReadyCount_(0),
@@ -1132,7 +1245,7 @@ void CCluster::HardNodeDown (int pnid, bool communicate_state)
     if ( Emulate_Down )
     {
         IAmIntegrated = false;
-        AssignLeaders(pnid, false);
+        AssignLeaders(pnid, node->GetName(), false);
     }
 
     TRACE_EXIT;
@@ -1237,7 +1350,7 @@ void CCluster::SoftNodeDown( int pnid )
     }
 
     IAmIntegrated = false;
-    AssignLeaders(pnid, false);
+    AssignLeaders(pnid, node->GetName(), false);
 
     TRACE_EXIT;
 }
@@ -2044,6 +2157,7 @@ void CCluster::DoDeviceReq(char * ldevName)
 }
 #endif
 
+#ifdef EXCHANGE_CPU_SCHEDULING_DATA
 void CCluster::SaveSchedData( struct internal_msg_def *recv_msg )
 {
     const char method_name[] = "CCluster::SaveSchedData";
@@ -2081,6 +2195,7 @@ void CCluster::SaveSchedData( struct internal_msg_def *recv_msg )
 
     TRACE_EXIT;
 }
+#endif
 
 void CCluster::HandleOtherNodeMsg (struct internal_msg_def *recv_msg,
                                    int pnid)
@@ -2550,7 +2665,9 @@ void CCluster::HandleOtherNodeMsg (struct internal_msg_def *recv_msg,
 #endif
 
     case InternalType_SchedData:
+#ifdef EXCHANGE_CPU_SCHEDULING_DATA
         SaveSchedData( recv_msg );
+#endif
         break;
 
     case InternalType_Set:
@@ -3205,7 +3322,7 @@ void CCluster::InitializeConfigCluster( void )
     const char method_name[] = "CCluster::InitializeConfigCluster";
     TRACE_ENTRY;
 
-    int worldSize;
+    int worldSize = 0;
     MPI_Comm_size (MPI_COMM_WORLD, &worldSize);
 #ifdef NAMESERVER_PROCESS
     if ( !IsRealCluster )
@@ -3218,21 +3335,25 @@ void CCluster::InitializeConfigCluster( void )
         }
     }
 #endif
-    int rankToPnid[worldSize];
     CClusterConfig *clusterConfig = Nodes->GetClusterConfig();
+    configPNodesCount_ = clusterConfig->GetPNodesCount();
+    int rankToPnid[configPNodesCount_];
 
 #ifdef NAMESERVER_PROCESS
     currentNodes_ = 1;  // non-master Name Servers join set through master Name Server
 #else
-    currentNodes_ = worldSize;
-#endif
-
-    if ( IsRealCluster )
+    if (IAmIntegrating || IsAgentMode)
     {
-        configPNodesCount_ = clusterConfig->GetPNodesCount();
+        currentNodes_ = 1;  // non-master monitors join cluster through master monitor
     }
     else
     {
+        currentNodes_ = worldSize;
+    }
+#endif
+
+    if ( !IsRealCluster )
+    {
         // Set virtual cluster size to collective size
         MPI_Comm_size (MPI_COMM_WORLD, &configPNodesCount_);
 #ifdef NAMESERVER_PROCESS
@@ -3248,6 +3369,14 @@ void CCluster::InitializeConfigCluster( void )
             upNodes_.upNodes[i/MAX_NODE_BITMASK] |= (1ull << (i%MAX_NODE_BITMASK));
         }
     }
+    else
+    {
+        for (int i=0; i<configPNodesCount_; ++i)
+        {
+            rankToPnid[i] = i;
+            rankToPnid[i] = rankToPnid[i];  // make compiler happy
+        }
+    }
 
     // Build the monitor's configured view of the cluster
     if ( IsRealCluster )
@@ -3438,10 +3567,8 @@ void CCluster::InitializeConfigCluster( void )
             delete [] commPortNums;
             delete [] syncPortNums;
 
-#ifndef NAMESERVER_PROCESS
             tmLeaderNid_ = Nodes->GetFirstNid();
             int TmLeaderPNid = LNode[tmLeaderNid_]->GetNode()->GetPNid();
-#endif
 
             // Any nodes not in the initial MPI_COMM_WORLD are down.
             for (int i=0; i<GetConfigPNodesCount(); ++i)
@@ -3457,14 +3584,11 @@ void CCluster::InitializeConfigCluster( void )
 
                     node = Nodes->GetNode(indexToPnid_[i]);
                     if ( node ) node->SetState( State_Down );
-
-#ifndef NAMESERVER_PROCESS
                     // assign new TmLeader if TMLeader node is dead.
                     if (TmLeaderPNid == indexToPnid_[i])
                     {
                         AssignTmLeader(indexToPnid_[i], false);
                     }
-#endif
                 }
                 else
                 {   // Set bit indicating node is up
@@ -3481,20 +3605,16 @@ void CCluster::InitializeConfigCluster( void )
                 }
             }
         }
-#ifndef NAMESERVER_PROCESS
         else
         {
             tmLeaderNid_ = 0;
         }
-#endif
 
         // Initialize communicators for point-to-point communications
         int myRank;
         MPI_Comm_rank( MPI_COMM_WORLD, &myRank );
-#ifdef NAMESERVER_PROCESS
         if ( !IsRealCluster )
             myRank = MyPNID;
-#endif
 
         InitClusterComm(worldSize, myRank, rankToPnid);
         if ( CommType == CommType_Sockets )
@@ -3844,6 +3964,43 @@ bool CCluster::PingSockPeer(CNode *node)
     const char method_name[] = "CCluster::PingSockPeer";
     TRACE_ENTRY;
 
+    static int sv_connect_wait_timeout = -2;
+    static int sv_connect_retry_count = 1;
+    if ( sv_connect_wait_timeout == -2 )
+    {
+        // Use the EPOLL timeout and retry values
+        char *lv_connect_wait_timeout_env = getenv( "SQ_MON_EPOLL_WAIT_TIMEOUT" );
+        if ( lv_connect_wait_timeout_env )
+        {
+            // Timeout in seconds
+            sv_connect_wait_timeout = atoi( lv_connect_wait_timeout_env );
+            char *lv_connect_retry_count_env = getenv( "SQ_MON_EPOLL_RETRY_COUNT" );
+            if ( lv_connect_retry_count_env )
+            {
+                sv_connect_retry_count = atoi( lv_connect_retry_count_env );
+            }
+            if ( sv_connect_retry_count > 180 )
+            {
+                sv_connect_retry_count = 180;
+            }
+        }
+        else
+        {
+            // default to 64 seconds
+            sv_connect_wait_timeout = 16;
+            sv_connect_retry_count = 4;
+        }
+
+        char buf[MON_STRING_BUF_SIZE];
+        snprintf( buf, sizeof(buf)
+                , "[%s@%d] Ping connect timeout wait_timeout=1 second, retry_count=%d\n"
+                , method_name
+                ,  __LINE__
+                , (sv_connect_retry_count * sv_connect_wait_timeout) );
+
+        mon_log_write( MON_PINGSOCKPEER_3, SQ_LOG_INFO, buf );
+    }
+
     bool rs = true;
     int  rc;
     int  pingSock = -1;
@@ -3855,10 +4012,12 @@ bool CCluster::PingSockPeer(CNode *node)
                     , node->GetName(), node->GetPNid() );
     }
 
-    // Attempt to connect with remote monitor
-    for (int i = 0; i < MAX_RECONN_PING_RETRY_COUNT; i++ )
+    // Attempt to connect with remote monitor in one seconds increments
+    // to recover as quickly as possible or give up trying
+    for (int i = 0; i < (sv_connect_retry_count*sv_connect_wait_timeout); i++ )
     {
-        pingSock = Monitor->Connect( node->GetCommPort() );
+        // Disable internal retries
+        pingSock = Monitor->Connect( node->GetCommPort(), false );
         if ( pingSock < 0 )
         {
             if (node->GetState() != State_Up)
@@ -3873,7 +4032,14 @@ bool CCluster::PingSockPeer(CNode *node)
                 }
                 break;
             }
-            sleep( MAX_RECONN_PING_WAIT_TIMEOUT );
+            char buf[MON_STRING_BUF_SIZE];
+            snprintf( buf, sizeof(buf)
+                    , "[%s@%d] Retrying connect to remote monitor %s, pnid=%d, retry=%d\n"
+                    , method_name
+                    ,  __LINE__
+                    , node->GetName(), node->GetPNid(), i );
+            mon_log_write( MON_PINGSOCKPEER_4, SQ_LOG_INFO, buf );
+            sleep( 1 );
         }
         else
         {
@@ -4334,9 +4500,13 @@ void CCluster::ReIntegrateSock( int initProblem )
 
     if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
     {
-        trace_printf( "%s@%d - Connected to creator monitor, sending my info, "
-                      "node %d (%s), commPort=%s, syncPort=%s, creator=%d, "
-                      "creatorShellPid=%d:%d, ping=%d\n"
+        trace_printf( "%s@%d - Connected to creator monitor, sending my info:\n"
+                      "        myNodeInfo.pnid=%d (%s)\n"
+                      "        myNodeInfo.commPort=%s\n"
+                      "        myNodeInfo.syncPort=%s\n"
+                      "        myNodeInfo.creator=%d\n"
+                      "        myNodeInfo.creatorShellPid=%d:%d\n"
+                      "        myNodeInfo.ping=%d\n"
                     , method_name, __LINE__
                     , myNodeInfo.pnid
                     , myNodeInfo.nodeName
@@ -4452,7 +4622,6 @@ void CCluster::ReIntegrateSock( int initProblem )
             pch1 = strtok (commPort,":");
             pch1 = strtok (NULL,":");
             Node[nodeInfo[i].pnid]->SetCommSocketPort( atoi(pch1) );
-
             Node[nodeInfo[i].pnid]->SetSyncPort( syncPort );
             pch2 = strtok (syncPort,":");
             pch2 = strtok (NULL,":");
@@ -5193,7 +5362,7 @@ int CCluster::AllgatherSock( int nbytes, void *sbuf, char *rbuf, int tag, MPI_St
     int err = MPI_SUCCESS;
     peer_t p[GetConfigPNodesMax()];
     memset( p, 0, sizeof(p) );
-    tag = 0; // make compiler happy
+    tag = tag; // make compiler happy
     // Set to twice the ZClient session timeout
     static int sessionTimeout = ZClientEnabled
                                 ? (ZClient->GetSessionTimeout() * 2) : 120;
@@ -5855,6 +6024,11 @@ int CCluster::AllgatherSockReconnect( MPI_Status *stats, bool reestablishConnect
                                         , idst
                                         , ErrorMsg(stats[idst].MPI_ERROR) );
                         }
+
+                        --currentNodes_;
+                        // Clear bit in set of "up nodes"
+                        upNodes_.upNodes[idst/MAX_NODE_BITMASK] &= ~(1ull << (idst%MAX_NODE_BITMASK));
+            
                         // Remove old socket from epoll set, it may not be there
                         struct epoll_event event;
                         event.data.fd = socks_[idst];
@@ -5864,6 +6038,12 @@ int CCluster::AllgatherSockReconnect( MPI_Status *stats, bool reestablishConnect
                     }
                     continue;
                 }
+                if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+                {
+                    trace_printf( "%s@%d - Pinging Node %s (%d) to see if it's up\n"
+                                , method_name, __LINE__
+                                , node->GetName(), node->GetPNid() );
+                }
                 if (PingSockPeer(node))
                 {
                     reconnectSock = ConnectSockPeer( node, idst, reestablishConnections );
@@ -5896,6 +6076,11 @@ int CCluster::AllgatherSockReconnect( MPI_Status *stats, bool reestablishConnect
                                         , node->GetName(), node->GetPNid()
                                         , idst, socks_[idst] );
                         }
+
+                        --currentNodes_;
+                        // Clear bit in set of "up nodes"
+                        upNodes_.upNodes[idst/MAX_NODE_BITMASK] &= ~(1ull << (idst%MAX_NODE_BITMASK));
+            
                         // Remove old socket from epoll set, it may not be there
                         struct epoll_event event;
                         event.data.fd = socks_[idst];
@@ -5949,6 +6134,11 @@ int CCluster::AllgatherSockReconnect( MPI_Status *stats, bool reestablishConnect
                                         , idst
                                         , ErrorMsg(stats[idst].MPI_ERROR) );
                         }
+
+                        --currentNodes_;
+                        // Clear bit in set of "up nodes"
+                        upNodes_.upNodes[idst/MAX_NODE_BITMASK] &= ~(1ull << (idst%MAX_NODE_BITMASK));
+            
                         // Remove old socket from epoll set, it may not be there
                         struct epoll_event event;
                         event.data.fd = socks_[idst];
@@ -5996,6 +6186,11 @@ int CCluster::AllgatherSockReconnect( MPI_Status *stats, bool reestablishConnect
                                         , node->GetName(), node->GetPNid()
                                         , idst, socks_[idst] );
                         }
+
+                        --currentNodes_;
+                        // Clear bit in set of "up nodes"
+                        upNodes_.upNodes[idst/MAX_NODE_BITMASK] &= ~(1ull << (idst%MAX_NODE_BITMASK));
+            
                         // Remove old socket from epoll set, it may not be there
                         struct epoll_event event;
                         event.data.fd = socks_[idst];
@@ -6024,13 +6219,14 @@ int CCluster::AllgatherSockReconnect( MPI_Status *stats, bool reestablishConnect
             }
             if ( idst >= 0
               && reconnectSock != -1
+              && socks_[idst] != -1
               && fcntl( socks_[idst], F_SETFL, O_NONBLOCK ) )
             {
                 err = MPI_ERR_AMODE;
                 char ebuff[256];
                 char buf[MON_STRING_BUF_SIZE];
-                snprintf( buf, sizeof(buf), "[%s@%d] fcntl(NONBLOCK) error: %s\n",
-                    method_name, __LINE__, strerror_r( errno, ebuff, 256 ) );
+                snprintf( buf, sizeof(buf), "[%s@%d] fcntl(socks_[%d]=%d,F_SETFL,NONBLOCK) error: %s\n",
+                    method_name, __LINE__,idst, socks_[idst], strerror_r( errno, ebuff, 256 ) );
                 mon_log_write( MON_CLUSTER_ALLGATHERSOCKRECONN_1, SQ_LOG_CRIT, buf );
             }
         }
@@ -6704,7 +6900,7 @@ void CCluster::HandleDownNode( int pnid )
         trace_printf("%s@%d - Added down node to list, pnid=%d, name=(%s)\n", method_name, __LINE__, downNode->GetPNid(), downNode->GetName());
 
     // assign new leaders if needed
-    AssignLeaders(pnid, false);
+    AssignLeaders( pnid, downNode->GetName(), false );
 
     // Build available list of spare nodes
     CNode *spareNode;
@@ -7410,20 +7606,50 @@ bool CCluster::checkIfDone (  )
     const char method_name[] = "CCluster::checkIfDone";
     TRACE_ENTRY;
 
-#ifdef NAMESERVER_PROCESS
     int nameServerCount = 0;
     CClusterConfig *clusterConfig = Nodes->GetClusterConfig();
-    CNameServerConfigContainer *nameServerConfig = NULL;
+    CNameServerConfigContainer *nameServerConfigContainer = NULL;
+
+#ifdef NAMESERVER_PROCESS
 
     if (clusterConfig)
     {
-        nameServerConfig = Nodes->GetNameServerConfig();
-        if (nameServerConfig)
+        nameServerConfigContainer = Nodes->GetNameServerConfig();
+        if (nameServerConfigContainer)
+        {
+            nameServerCount = nameServerConfigContainer->GetCount();
+        }
+    }
+#else
+    int myNameServerCount = 0;
+    CNameServerConfig *nameServerConfig = NULL;
+
+    if (NameServerEnabled && clusterConfig)
+    {
+        nameServerConfigContainer = Nodes->GetNameServerConfig();
+        if (nameServerConfigContainer)
         {
-            nameServerCount = nameServerConfig->GetCount();
+            nameServerCount = nameServerConfigContainer->GetCount();
+            if (IsRealCluster)
+            {
+                nameServerConfig = nameServerConfigContainer->GetConfig( Node_name );
+                if (nameServerConfig)
+                {
+                    myNameServerCount = 1;
+                }
+            }
+            else
+            {
+                if (nameServerCount && MyPNID < nameServerCount)
+                {
+                    myNameServerCount = 1;
+                }
+            }
         }
     }
+#endif
 
+#ifdef NAMESERVER_PROCESS
     if (trace_settings & (TRACE_PROCESS | TRACE_PROCESS_DETAIL | TRACE_SYNC))
         trace_printf("%s@%d - Node %d shutdown level=%d, state=%s.  Process "
                      "count=%d, internal state=%d, currentNodes_=%d, "
@@ -7508,10 +7734,8 @@ bool CCluster::checkIfDone (  )
                     // let the watchdog process exit
                     HealthCheck.setState(MON_EXIT_PRIMITIVES);
                 }
-                else if ( (Nodes->ProcessCount() <= 
-                            (currentNodes_ * (MAX_PRIMITIVES)) ) // only Name Servers alive
-                          && (MyNode->GetNumProcs() <=
-                            (MAX_PRIMITIVES) )                   // only Name Servers alive
+                else if ( (MyNode->GetNumProcs() <=         // only My Name Server alive
+                            myNameServerCount )
                           && !MyNode->isInQuiesceState()    // post-quiescing will
                                                             // expire WDG (cluster)
                           && !waitForNameServerExit_ )      // Name Server not yet exiting
@@ -8852,7 +9076,7 @@ int CCluster::AcceptSock( int sock )
     return ( csock );
 }
 
-int CCluster::Connect( const char *portName )
+int CCluster::Connect( const char *portName, bool doRetries )
 {
     const char method_name[] = "CCluster::Connect";
     TRACE_ENTRY;
@@ -8885,7 +9109,6 @@ int CCluster::Connect( const char *portName )
     int len = colon - portName;
     host[len] = '\0';
     port = atoi(&colon[1]);
-
     size = sizeof(sockinfo);
 
     if ( !retries )
@@ -8937,15 +9160,29 @@ int CCluster::Connect( const char *portName )
         {
             if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
             {
-                trace_printf( "%s@%d - Connecting to %s addr=%d.%d.%d.%d, port=%d, connect_failures=%d\n"
-                            , method_name, __LINE__
-                            , host
-                            , (int)((unsigned char *)he->h_addr)[0]
-                            , (int)((unsigned char *)he->h_addr)[1]
-                            , (int)((unsigned char *)he->h_addr)[2]
-                            , (int)((unsigned char *)he->h_addr)[3]
-                            , port
-                            , connect_failures );
+                if (doRetries)
+                {
+                    trace_printf( "%s@%d - Connecting to %s, addr=%d.%d.%d.%d, port=%d, connect_failures=%d\n"
+                                , method_name, __LINE__
+                                , portName
+                                , (int)((unsigned char *)he->h_addr)[0]
+                                , (int)((unsigned char *)he->h_addr)[1]
+                                , (int)((unsigned char *)he->h_addr)[2]
+                                , (int)((unsigned char *)he->h_addr)[3]
+                                , port
+                                , connect_failures );
+                }
+                else
+                {
+                    trace_printf( "%s@%d - Connecting to %s, addr=%d.%d.%d.%d, port=%d\n"
+                                , method_name, __LINE__
+                                , portName
+                                , (int)((unsigned char *)he->h_addr)[0]
+                                , (int)((unsigned char *)he->h_addr)[1]
+                                , (int)((unsigned char *)he->h_addr)[2]
+                                , (int)((unsigned char *)he->h_addr)[3]
+                                , port );
+                }
             }
 
             ret = connect( sock, (struct sockaddr *) &sockinfo, size );
@@ -8965,8 +9202,8 @@ int CCluster::Connect( const char *portName )
             {
                 char la_buf[MON_STRING_BUF_SIZE];
                 int err = errno;
-                sprintf( la_buf, "[%s], connect() failed! errno=%d (%s)\n"
-                       , method_name, err, strerror( err ));
+                sprintf( la_buf, "[%s], connect(%s) failed! errno=%d (%s)\n"
+                       , method_name, portName, err, strerror( err ));
                 mon_log_write(MON_CLUSTER_CONNECT_3, SQ_LOG_ERR, la_buf);
                 close(sock);
                 return ( -1 );
@@ -8975,6 +9212,12 @@ int CCluster::Connect( const char *portName )
 
         if ( ret == 0 ) break;
 
+        if (doRetries == false)
+        {
+            close( sock );
+            return( -1 );
+        }
+
         // For large clusters, the connect/accept calls seem to fail occasionally,
         // no doubt do to the large number (1000's) of simultaneous connect packets
         // flooding the network at once.  So, we retry up to HPMP_CONNECT_RETRIES
@@ -8984,8 +9227,8 @@ int CCluster::Connect( const char *portName )
             if ( ++outer_failures > retries )
             {
                 char la_buf[MON_STRING_BUF_SIZE];
-                sprintf( la_buf, "[%s], connect() exceeded retries! count=%d\n"
-                       , method_name, retries);
+                sprintf( la_buf, "[%s], connect(%s) exceeded retries! count=%d\n"
+                       , method_name, portName, retries);
                 mon_log_write(MON_CLUSTER_CONNECT_4, SQ_LOG_ERR, la_buf);
                 close( sock );
                 return ( -1 );

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/cluster.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/cluster.h b/core/sqf/monitor/linux/cluster.h
index 49939ac..9d0925f 100644
--- a/core/sqf/monitor/linux/cluster.h
+++ b/core/sqf/monitor/linux/cluster.h
@@ -111,7 +111,7 @@ public:
 #else
     int  AcceptPtPSock( void );
 #endif
-    int  Connect( const char *portName );
+    int  Connect( const char *portName, bool doRetries = true );
     void Connect( int socketPort );
 #ifdef NAMESERVER_PROCESS
     void ConnectToMon2NsCommSelf( void );
@@ -127,11 +127,12 @@ public:
 #ifndef USE_BARRIER
     void ArmWakeUpSignal (void);
 #endif
-    void AssignLeaders( int pnid, bool checkProcess );
+    void AssignLeaders( int pnid, const char *failedMaster,  bool checkProcess );
 #ifndef NAMESERVER_PROCESS
     void AssignTmLeader( int pnid, bool checkProcess );
 #endif
-    void AssignMonitorLeader( int pnid );
+    void AssignMonitorLeader( const char* failedMaster );
+    void UpdateMonitorPort (const char* newMaster);
     void stats();
     void CompleteSyncCycle()
         { syncCycle_.lock(); syncCycle_.wait(); syncCycle_.unlock(); }
@@ -146,8 +147,6 @@ public:
     inline int  GetTmLeader( void ) { return( tmLeaderNid_ ); }
     inline void SetTmLeader( int tmLeaderNid ) { tmLeaderNid_ = tmLeaderNid; } 
 #endif
-    inline int  GetMonitorLeader( void ) { return( monitorLeaderPNid_); }
-    inline void SetMonitorLeader( int monitorLeaderPNid ) { monitorLeaderPNid_ = monitorLeaderPNid; } 
     int  GetDownedNid( void );
 #ifndef NAMESERVER_PROCESS
     inline int GetTmSyncPNid( void ) { return( tmSyncPNid_ ); } // Physical Node ID of current TmSync operations master
@@ -196,7 +195,9 @@ public:
     void NodeTmReady( int nid );
 #endif
     bool isMonSyncResponsive() { return monSyncResponsive_; }
+#ifdef EXCHANGE_CPU_SCHEDULING_DATA
     void SaveSchedData( struct internal_msg_def *recv_msg );
+#endif
     bool IsNodeDownDeathNotices() { return nodeDownDeathNotices_; }
 
     int  ReceiveMPI(char *buf, int size, int source, MonXChngTags tag, MPI_Comm comm);
@@ -275,7 +276,6 @@ private:
     int     configPNodesCount_; // # of physical nodes configured
     int     configPNodesMax_;   // max # of physical nodes that can be configured
     int    *nodeMap_;           // Mapping of Node ranks to COMM_WORLD ranks
-    int     monitorLeaderPNid_; // PNid of currently assigned Monitor leader node
 #ifndef NAMESERVER_PROCESS
     int     tmLeaderNid_;       // Nid of currently assigned TM Leader node
     int     tmReadyCount_;      // # of DTM processes ready for transactions

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/commaccept.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/commaccept.cxx b/core/sqf/monitor/linux/commaccept.cxx
index 8069653..5c4e3a5 100644
--- a/core/sqf/monitor/linux/commaccept.cxx
+++ b/core/sqf/monitor/linux/commaccept.cxx
@@ -664,9 +664,9 @@ void CCommAccept::processNewSock( int joinFd )
 
         char buf[MON_STRING_BUF_SIZE];
         snprintf( buf, sizeof(buf)
-                , "[%s], got connection from node %s. "
+                , "[%s], got connection from node %s (pnid=%d). "
                   "Node not down, node state=%s\n"
-                , method_name, nodeId.nodeName
+                , method_name, nodeId.nodeName, nodeId.pnid
                 , StateString(node->GetState()));
         mon_log_write(MON_COMMACCEPT_10, SQ_LOG_ERR, buf);
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/healthcheck.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/healthcheck.cxx b/core/sqf/monitor/linux/healthcheck.cxx
index d72b99c..1f344fc 100644
--- a/core/sqf/monitor/linux/healthcheck.cxx
+++ b/core/sqf/monitor/linux/healthcheck.cxx
@@ -115,6 +115,18 @@ CHealthCheck::CHealthCheck()
         quiesceTimeoutSec_     = atoi(quiesceTimeoutC);
     }
 
+#ifdef NAMESERVER_PROCESS
+    cpuSchedulingDataEnabled_ = false;
+#else
+    cpuSchedulingDataEnabled_ = true;
+    char *env;
+    env = getenv("SQ_CPUSCHEDULINGDATA_ENABLED");
+    if ( env && isdigit(*env) )
+    {
+        cpuSchedulingDataEnabled_ = atoi(env);
+    }
+#endif
+
     if (trace_settings & TRACE_HEALTH)
         trace_printf("%s@%d quiesceTimeoutSec_ = %d, syncTimeoutSec_ = %d, workerTimeoutSec_ = %d\n", method_name, __LINE__, quiesceTimeoutSec_, CMonitor::SYNC_MAX_RESPONSIVE, CReqQueue::REQ_MAX_RESPONSIVE);
 
@@ -242,9 +254,16 @@ void CHealthCheck::healthCheckThread()
             mem_log_write(MON_HEALTHCHECK_WAKEUP_2, (int)(currTime_.tv_sec - wakeupTimeSaved_));
         }
 
-        // Replicate the clone to other nodes
-        CReplSchedData *repl = new CReplSchedData();
-        Replicator.addItem(repl);
+#ifndef NAMESERVER_PROCESS
+#ifdef EXCHANGE_CPU_SCHEDULING_DATA
+        if (cpuSchedulingDataEnabled_)
+        {
+            // Replicate this host's CPU scheduling data to other nodes
+            CReplSchedData *repl = new CReplSchedData();
+            Replicator.addItem(repl);
+        }
+#endif
+#endif
 
         state = state_;
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/healthcheck.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/healthcheck.h b/core/sqf/monitor/linux/healthcheck.h
index c8e15fe..e637400 100644
--- a/core/sqf/monitor/linux/healthcheck.h
+++ b/core/sqf/monitor/linux/healthcheck.h
@@ -107,6 +107,7 @@ private:
     bool checkReqResponsive_;           // should req thread be checked for responsiveness or not
     int  monSyncTimeout_;               // timeout (in secs) for sync thread responsiveness
     int  refreshCounter_;               // monitor heartbeats, updated every second.
+    bool cpuSchedulingDataEnabled_;     // monitors exchange CPU scheduling data when enabled
 };
 
 #endif

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/internal.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/internal.h b/core/sqf/monitor/linux/internal.h
index 6d28b29..6329fc7 100644
--- a/core/sqf/monitor/linux/internal.h
+++ b/core/sqf/monitor/linux/internal.h
@@ -209,7 +209,8 @@ typedef struct
 {
     int  nid;                        // Nid id of process to receive io data
     int  pid;                        // Process id of process to receive io data
-    StdIoType   ioType;
+    Verifier_t verifier;             // Verifier of the process to receive io data
+    StdIoType  ioType;
     int  length;                     // Length in byte of Data buffer used
     char data[MAX_SYNC_DATA];        // Data to be replicated across cluster
 } ioData_t;
@@ -225,9 +226,10 @@ struct stdin_req_def
 {
     int nid;                         // Node id of process requesting stdin data
     int pid;                         // Process id of process requesting stdin data
+    Verifier_t verifier;
     StdinReqType reqType;
     int supplier_nid;                // Node id of process supplying stdin data
-    int supplier_pid;              // Process id of process to supplying stdin data
+    int supplier_pid;                // Process id of process to supplying stdin data
 };
 
 struct kill_def
@@ -375,6 +377,7 @@ typedef struct
     long long  cpu_soft_irq;        // Time in software interrupt
 } ProcStat_t;
 
+#ifdef EXCHANGE_CPU_SCHEDULING_DATA
 struct scheddata_def
 {
     int PNid;                           // Node ID of scheduling data
@@ -391,6 +394,7 @@ struct scheddata_def
     ProcStat_t   proc_stats[MAX_LNODES_PER_NODE]; // Per logical node processor statistics
     unsigned int btime;                 // Node boot time
 };
+#endif
 
 
 struct set_def
@@ -468,7 +472,9 @@ struct internal_msg_def
         struct spare_def   activate_spare;
         struct uniqstr_def uniqstr;
         struct shutdown_def shutdown;
+#ifdef EXCHANGE_CPU_SCHEDULING_DATA
         struct scheddata_def scheddata;
+#endif
         char   buffer[MAX_SYNC_SIZE-MSG_HDR_SIZE];  // Limit entire buffer to MAX_SYNC_SIZE
     } u;
 } __attribute__((__may_alias__));

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/monitor.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/monitor.cxx b/core/sqf/monitor/linux/monitor.cxx
index 933dee5..17ed27d 100755
--- a/core/sqf/monitor/linux/monitor.cxx
+++ b/core/sqf/monitor/linux/monitor.cxx
@@ -742,37 +742,42 @@ int CMonitor::PackProcObjs( char *&buffer )
 
     char *bufPtr = buffer;
 
-    // first copy all primary and generic processes
-    lnode = Nodes->GetFirstLNode();
-    for ( ; lnode ; lnode = lnode->GetNext() )
+#ifndef NAMESERVER_PROCESS
+    if (!NameServerEnabled)
+#endif
     {
-        process = lnode->GetFirstProcess();
-        while (process)
+        // first copy all primary and generic processes
+        lnode = Nodes->GetFirstLNode();
+        for ( ; lnode ; lnode = lnode->GetNext() )
         {
-            if (!process->IsBackup())
+            process = lnode->GetFirstProcess();
+            while (process)
             {
-                buffer = ProcCopy(buffer, process);
-                ++procCount;
+                if (!process->IsBackup())
+                {
+                    buffer = ProcCopy(buffer, process);
+                    ++procCount;
+                }
+    
+                process = process->GetNext();
             }
-
-            process = process->GetNext();
         }
-    }
-
-    // copy all the backup processes
-    lnode = Nodes->GetFirstLNode();
-    for ( ; lnode ; lnode = lnode->GetNext() )
-    {
-        process = lnode->GetFirstProcess();
-        while (process)
+    
+        // copy all the backup processes
+        lnode = Nodes->GetFirstLNode();
+        for ( ; lnode ; lnode = lnode->GetNext() )
         {
-            if (process->IsBackup())
+            process = lnode->GetFirstProcess();
+            while (process)
             {
-                buffer = ProcCopy(buffer, process);
-                ++procCount;
+                if (process->IsBackup())
+                {
+                    buffer = ProcCopy(buffer, process);
+                    ++procCount;
+                }
+    
+                process = process->GetNext();
             }
-
-            process = process->GetNext();
         }
     }
 
@@ -927,6 +932,24 @@ void CMonitor::StartPrimitiveProcesses( void )
 }
 #endif
 
+void HandleAssignMonitorLeader ( const char *failedMaster )
+{
+    const char method_name[] = "HandleAssignMonitorLeader";
+    TRACE_ENTRY;
+    if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+    {
+        trace_printf("%s@%d HandleAssignMonitorLeader called for %s\n"
+                            , method_name, __LINE__, failedMaster);
+    }
+    // only relevant in AgentMode
+     if (IsAgentMode)
+     {
+         Monitor->AssignMonitorLeader(failedMaster);
+     }
+    
+    TRACE_EXIT;
+}
+
 void HandleMyNodeExpiration( void )
 {
     const char method_name[] = "HandleMyNodeExpiration";
@@ -1126,7 +1149,9 @@ int main (int argc, char *argv[])
     char temp_fname[MAX_PROCESS_PATH];
 #endif
     char buf[MON_STRING_BUF_SIZE];
+#ifndef NAMESERVER_PROCESS
     unsigned int initSleepTime = 1; // 1 second
+#endif
 
     mallopt(M_ARENA_MAX, 4); // call to limit the number of arena's of  monitor to 4.This call doesn't seem to have any effect !
 
@@ -1337,11 +1362,13 @@ int main (int argc, char *argv[])
         genSnmpTrapEnabled = true;
     }
 
+#ifndef NAMESERVER_PROCESS
     env = getenv("MON_INIT_SLEEP");
     if ( env && isdigit(*env) )
     {
         initSleepTime = atoi(env);
     }
+#endif
 
     env = getenv("SQ_COLD_STANDBY_SPARE");
     if ( env && isdigit(*env) )
@@ -1527,6 +1554,10 @@ int main (int argc, char *argv[])
 
     if (IsAgentMode)
     {
+        if ( IsRealCluster )
+        {
+            MyPNID = -1;
+        }
         CreatorShellPid = 1000; // per monitor.sh
         CreatorShellVerifier = 0;
     }
@@ -1610,6 +1641,7 @@ int main (int argc, char *argv[])
             }
         }
     }
+
     if (trace_settings & TRACE_INIT)
     {
         trace_printf("%s@%d Using signal %d for normal processes "
@@ -1691,6 +1723,12 @@ int main (int argc, char *argv[])
            abort();
         }
 
+        //Moved creation of the below to later on
+        //Nodes = new CNodeContainer (); 
+        //Config = new CConfigContainer ();
+        //Monitor = new CMonitor (procTermSig);
+        
+
         // Set up zookeeper and determine the master
         if ( IsAgentMode || IsRealCluster )
         {
@@ -1728,6 +1766,16 @@ int main (int argc, char *argv[])
                 if (masterMonitor)
                 {
                     strcpy (MasterMonitorName, masterMonitor);
+
+                    if (trace_settings & TRACE_INIT)
+                    {
+                        trace_printf("%s@%d (MasterMonitor) IsAgentMode = TRUE, masterMonitor from ZK: %s, Node_name: %s\n"
+                                     , method_name
+                                     , __LINE__
+                                     , MasterMonitorName
+                                     , Node_name);
+                    }
+
                     // unfortunately, we have to do this to see if we are the master before
                     // other things are set up.   This is how we must do that
                     if (strcmp(Node_name, masterMonitor) == 0)
@@ -1742,6 +1790,16 @@ int main (int argc, char *argv[])
                 else
                 {
                     strcpy (MasterMonitorName, ClusterConfig->GetConfigMasterByName());
+
+                    if (trace_settings & TRACE_INIT)
+                    {
+                        trace_printf("%s@%d (MasterMonitor) IsAgentMode = TRUE, ConfigMasterMonitor: %s, Node_name:%s \n"
+                                     , method_name
+                                     , __LINE__
+                                     , MasterMonitorName
+                                     , Node_name);
+                    }
+
                     if (strcmp (Node_name,  ClusterConfig->GetConfigMasterByName()) == 0)
                     {
                         IsMaster = true;
@@ -1751,12 +1809,21 @@ int main (int argc, char *argv[])
                         IsMaster = false;
                     }
                 }
-
              }
 #ifdef NAMESERVER_PROCESS
              else
              {
                 strcpy (MasterMonitorName, ClusterConfig->GetConfigMasterByName());
+
+                if (trace_settings & TRACE_INIT)
+                {
+                    trace_printf("%s@%d (MasterMonitor) IsAgentMode = TRUE, ConfigMasterMonitor: %s, Node_name:%s \n"
+                                 , method_name
+                                 , __LINE__
+                                 , MasterMonitorName
+                                 , Node_name);
+                }
+
                 if ( IsRealCluster )
                 {
                     if (strcmp (Node_name,  ClusterConfig->GetConfigMasterByName()) == 0)
@@ -1774,7 +1841,6 @@ int main (int argc, char *argv[])
                  }
              }
 #endif
-
          }
 
          if (IsAgentMode)
@@ -1783,7 +1849,9 @@ int main (int argc, char *argv[])
             {
 #ifdef NAMESERVER_PROCESS
                 if ( IsRealCluster )
+                {
                     MyPNID = -1;
+                }
 #else
                 MyPNID = -1;
 #endif
@@ -1859,6 +1927,7 @@ int main (int argc, char *argv[])
 
         if (IsAgentMode)
         {
+            int monitorLead = -1;
             CNode *myNode = Nodes->GetNode(MyPNID);
             const char *masterMonitor = NULL;
             if (myNode == NULL)
@@ -1894,11 +1963,13 @@ int main (int argc, char *argv[])
                           trace_printf("%s@%d (MasterMonitor) IsMaster=%d, masterNode=%s\n", method_name, __LINE__, IsMaster, masterNode->GetName() );
                     }
                 }
-                Monitor->SetMonitorLeader( masterNode->GetPNid() );
-                if (MyPNID == masterNode->GetPNid())
+                monitorLead = masterNode->GetPNid();
+                if (MyPNID == monitorLead)
                 {
+                     ZClient->WatchNodeMasterDelete (myNode->GetName() ); // just in case of stale info
                      ZClient->CreateMasterZNode ( myNode->GetName() );
                      strcpy (MasterMonitorName, myNode->GetName());
+                     ZClient->WatchMasterNode( MasterMonitorName );
                      if (trace_settings & TRACE_INIT)
                      {
                          trace_printf("%s@%d (MasterMonitor) IsMaster=%d, set monitor lead to %d\n", method_name, __LINE__, IsMaster, MyPNID);
@@ -1920,7 +1991,8 @@ int main (int argc, char *argv[])
                           {
                               trace_printf("%s@%d (MasterMonitor) IsMaster=%d, set monitor lead to %d\n", method_name, __LINE__, IsMaster, masterNode->GetPNid());
                           }
-                          Monitor->SetMonitorLeader( masterNode->GetPNid() );
+                          monitorLead = masterNode->GetPNid();
+                          ZClient->WatchMasterNode( MasterMonitorName ); 
                      }
                      else
                      {
@@ -1936,6 +2008,20 @@ int main (int argc, char *argv[])
                      }
                 }
             }
+#ifdef NAMESERVER_PROCESS
+            else
+            {
+                if ( !IsRealCluster )
+                {
+                    monitorLead = 0;
+                }
+            }
+#endif
+            char    buf[MON_STRING_BUF_SIZE];
+            snprintf( buf, sizeof(buf)
+                           , "[%s], Master Monitor is on node %d\n"
+                           , method_name, monitorLead);
+            mon_log_write(MON_MONITOR_MAIN_18, SQ_LOG_INFO, buf);
         }
         if (!IAmIntegrating)
         {
@@ -2158,6 +2244,7 @@ int main (int argc, char *argv[])
             // Programmer bonehead!
             abort();
     }
+
     if (port != NULL)
     {
         int myPortNum;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/msgdef.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/msgdef.h b/core/sqf/monitor/linux/msgdef.h
index 4b34557..ca76fc1 100644
--- a/core/sqf/monitor/linux/msgdef.h
+++ b/core/sqf/monitor/linux/msgdef.h
@@ -34,6 +34,7 @@
 // Compile options
 //#define DEBUGGING
 #define NO_OPEN_CLOSE_NOTICES
+#define EXCHANGE_CPU_SCHEDULING_DATA
 
 #define SERVICE_TAG      1
 #define INTERNAL_TAG     2

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/nameserver.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nameserver.cxx b/core/sqf/monitor/linux/nameserver.cxx
index d367085..690e23d 100644
--- a/core/sqf/monitor/linux/nameserver.cxx
+++ b/core/sqf/monitor/linux/nameserver.cxx
@@ -27,6 +27,7 @@
 
 using namespace std;
 
+#include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -41,6 +42,7 @@ using namespace std;
 #include <sys/resource.h>
 #include <errno.h>
 #include <limits.h>
+#include <unistd.h>
 
 #include "lnode.h"
 #include "pnode.h"
@@ -696,7 +698,12 @@ int CNameServer::SendReceive( struct message_def* msg )
         size += sizeof(msg->u.request.u.process_info_cont);
         break;
     case ReqType_ProcessInfoNs:
-        descp = (char *) "process-info-ns";
+        msginfo = &msg->u.request.u.process_info;
+        sprintf( desc, "process-info-ns (nid=%d, pid=%d, verifier=%d, name=%s)\n"
+                       "\ttarget (nid=%d, pid=%d, verifier=%d, name=%s, type=%d)\n",
+                msginfo->nid, msginfo->pid, msginfo->verifier, msginfo->process_name,
+                msginfo->target_nid, msginfo->target_pid, msginfo->target_verifier, 
+                msginfo->target_process_name, msginfo->type );
         size += sizeof(msg->u.request.u.process_info);
         break;
     case ReqType_ShutdownNs:

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/nsprocess.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nsprocess.cxx b/core/sqf/monitor/linux/nsprocess.cxx
index 62523ae..dd2ab68 100644
--- a/core/sqf/monitor/linux/nsprocess.cxx
+++ b/core/sqf/monitor/linux/nsprocess.cxx
@@ -44,13 +44,15 @@ CProcess *CProcessContainer::CreateProcess (CProcess * parent,
                                             strId_t programStrId,
                                             char *infile,
                                             char *outfile,
+                                            void *tag,
                                             int &result)
 {
-    CProcess *process = NULL;
-
     const char method_name[] = "CProcessContainer::CreateProcess";
     TRACE_ENTRY;
 
+    CProcess *process = NULL;
+
+    tag = tag; // Satisfy compiler
     result = MPI_SUCCESS;
 
     // load & normalize process name

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/nsreqnewproc.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nsreqnewproc.cxx b/core/sqf/monitor/linux/nsreqnewproc.cxx
index 2231fc0..eb06728 100644
--- a/core/sqf/monitor/linux/nsreqnewproc.cxx
+++ b/core/sqf/monitor/linux/nsreqnewproc.cxx
@@ -126,6 +126,7 @@ void CExtNewProcNsReq::performRequest()
                                               msg_->u.request.u.new_process_ns.programStrId,
                                               msg_->u.request.u.new_process_ns.infile,
                                               msg_->u.request.u.new_process_ns.outfile,
+                                              0, // tag
                                               result
                                             );
     if (process)

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/nsreqqueue.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nsreqqueue.cxx b/core/sqf/monitor/linux/nsreqqueue.cxx
index 3d62e7a..d10a963 100644
--- a/core/sqf/monitor/linux/nsreqqueue.cxx
+++ b/core/sqf/monitor/linux/nsreqqueue.cxx
@@ -36,7 +36,7 @@ void CRequest::monreply(struct message_def *msg, int sockFd, int *error)
         *error = 0;
     if (!msg->noreply) // send reply
     {
-        int size = offsetof(message_def, u.reply.u);
+        int size = offsetof(struct message_def, u.reply.u);
         switch (msg->u.reply.type)
         {
         case ReplyType_Generic:

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/pnode.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnode.cxx b/core/sqf/monitor/linux/pnode.cxx
index 033a19a..563cf01 100644
--- a/core/sqf/monitor/linux/pnode.cxx
+++ b/core/sqf/monitor/linux/pnode.cxx
@@ -78,7 +78,6 @@ extern CHealthCheck HealthCheck;
 extern CMonTrace *MonTrace;
 extern bool IsAgentMode;
 extern bool IAmIntegrating;
-extern char MasterMonitorName[MAX_PROCESS_PATH];
 extern char Node_name[MPI_MAX_PROCESSOR_NAME];
 extern CClusterConfig *ClusterConfig;
 
@@ -115,8 +114,8 @@ extern CNameServerConfigContainer *NameServerConfig;
 
 // The following defines specify the default values for the HA
 // timers if the timer related environment variables are not defined.
-// Defaults to 5 second Watchdog process timer expiration
-#define WDT_KeepAliveTimerDefault 5
+// Defaults to 60 second Watchdog process timer expiration
+#define WDT_KeepAliveTimerDefault 60
 
 // Default interval used by GetSchedulingData (in milliseconds)
 unsigned long int CNode::minSchedDataInterval_ = 500;
@@ -1251,6 +1250,7 @@ void CNode::StartNameServerProcess( void )
                                         programStrId,
                                         (char *) "", //infile,
                                         stdout, //outfile,
+                                        0, //tag
                                         result
                                         );
     if ( NameServerProcess )
@@ -1331,6 +1331,7 @@ void CNode::StartWatchdogProcess( void )
                                       programStrId,
                                       (char *) "", //infile,
                                       stdout, //outfile,
+                                      0, //tag
                                       result
                                       );
     if ( watchdogProcess )
@@ -1388,6 +1389,7 @@ void CNode::StartPStartDProcess( void )
                                       programStrId,
                                       (char *) "", //infile,
                                       stdout, //outfile,
+                                      0, //tag
                                       result
                                       );
     if ( pstartdProcess )
@@ -1564,6 +1566,7 @@ void CNode::StartSMServiceProcess( void )
                                  programStrId,
                                  (char *) "", //infile,
                                  stdout, //outfile,
+                                 0, //tag
                                  result
                                  );
     if ( smsProcess )
@@ -1652,6 +1655,7 @@ CNodeContainer::~CNodeContainer( void )
     if (clusterConfig_)
     {
         delete clusterConfig_;
+        clusterConfig_ = NULL;
     }
     if (nameServerConfig_)
     {
@@ -3202,6 +3206,31 @@ CProcess *CNodeContainer::GetProcessLByTypeNs( int nid, PROCESSTYPE type )
     processInfo->target_process_pattern[0] = 0;
     processInfo->type = type;
 
+    if ( trace_settings & ( TRACE_PROCESS | TRACE_REQUEST) )
+    {
+        trace_printf( "%s@%d - Received monitor request process-info-ns data.\n"
+                      "        process_info.nid=%d\n"
+                      "        process_info.pid=%d\n"
+                      "        process_info.verifier=%d\n"
+                      "        process_info.target_nid=%d\n"
+                      "        process_info.target_pid=%d\n"
+                      "        process_info.target_verifier=%d\n"
+                      "        process_info.target_process_name=%s\n"
+                      "        process_info.target_process_pattern=%s\n"
+                      "        process_info.type=%d\n"
+                    , method_name, __LINE__
+                    , processInfo->nid
+                    , processInfo->pid
+                    , processInfo->verifier
+                    , processInfo->target_nid
+                    , processInfo->target_pid
+                    , processInfo->target_verifier
+                    , processInfo->target_process_name
+                    , processInfo->target_process_pattern
+                    , processInfo->type
+                    );
+    }
+
     int error = NameServer->ProcessInfoNs(&msg); // in reqQueue thread (CExternalReq)
     if (error == 0)
     {

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/process.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/process.cxx b/core/sqf/monitor/linux/process.cxx
index 5ecaf50..9b2be4f 100644
--- a/core/sqf/monitor/linux/process.cxx
+++ b/core/sqf/monitor/linux/process.cxx
@@ -586,8 +586,8 @@ void CProcess::procExitNotifierNodes( void )
     const char method_name[] = "CProcess::procExitNotifierNodes";
     TRACE_ENTRY;
 
-    CLNode *targetLNode;
-    CNode  *targetNode;
+    CLNode *targetLNode = NULL;
+    CNode  *targetNode = NULL;
     nidSet_t::iterator it;
 
     // Remove death notice registration for all entries on list
@@ -1545,7 +1545,7 @@ void CProcess::setEnvFromRegistry ( char **envp, int &countEnv )
 }
 
 #ifndef NAMESERVER_PROCESS
-bool CProcess::Create (CProcess *parent, int & result)
+bool CProcess::Create (CProcess *parent, void* tag, int & result)
 {
     bool monAltLogEnabled = false;
     bool seamonsterEnabled = false;
@@ -2276,6 +2276,28 @@ bool CProcess::Create (CProcess *parent, int & result)
         // I'm the monitor ... connect to child
         rc = MPI_SUCCESS;
 
+        // Save process id and build process name if not already named
+        Pid = os_pid;
+        if (Name[0] == '\0')
+        {   // No name assigned to the process so generate one based on
+            // the node-id and process-id.
+            MyNode->BuildOurName(Nid, os_pid, Name);
+
+            if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
+                trace_printf("%s@%d - No process name specified, generated name=%s for process (%d, %d)\n", method_name, __LINE__, Name, Nid, os_pid);
+        }
+
+        if (NameServerEnabled && tag != NULL)
+        {
+            // Send actual pid and process name back to parent
+            // STDIO Redirection requires that clone process in parent node
+            // have the actual pid
+            PtpClient->ProcessInit( this
+                                  , tag
+                                  , 0
+                                  , parent->Nid );
+        }
+
         if (trace_settings & (TRACE_PROCESS | TRACE_REDIRECTION))
             trace_printf("%s@%d Process=%s, Infile=[%s], Outfile=[%s]\n",
                          method_name, __LINE__, Name, infile_.c_str(),
@@ -2342,14 +2364,6 @@ bool CProcess::Create (CProcess *parent, int & result)
             fd_stdout_ = pfds_stdout[0];
         }
 
-        if (Name[0] == '\0')
-        {   // No name assigned to the process so generate one based on
-            // the node-id and process-id.
-            MyNode->BuildOurName(Nid, os_pid, Name);
-
-            if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
-                trace_printf("%s@%d - No process name specified, generated name=%s for process (%d, %d)\n", method_name, __LINE__, Name, Nid, os_pid);
-        }
         // stderr pipe to child:
         //    We don't need write end of pipe.
         //    Add the read end of file descriptor to list of file
@@ -2579,7 +2593,6 @@ bool CProcess::Create (CProcess *parent, int & result)
     if (rc == MPI_SUCCESS && result == MPI_SUCCESS)
     {
         successful = true;
-        Pid = os_pid;
         PidAtFork_  = os_pid;
 
         // Indicate that process exists but has not yet completed initialization.
@@ -2939,28 +2952,47 @@ void CProcess::Exit( CProcess *parent )
 
     SetState(State_Stopped);
 
-    if (parent && NameServerEnabled)
+    if (!Clone && parent && NameServerEnabled)
     {
-        ProcessInfoNs_reply_def processInfo;
-        int rc = Nodes->GetProcessInfoNs( parent->GetNid()
-                                        , parent->GetPid()
-                                        , parent->GetVerifier()
-                                        , &processInfo);
-        if (rc == MPI_ERR_NAME)
-        {
-            if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+        if (parent->GetNid() != GetNid())
+        { // parent is remote
+            if (parent->childCount() == 0)
+            { // process is parent's last child
+                if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+                {
+                    trace_printf( "%s@%d - Parent's last child, deleting clone process %s, (%d,%d:%d)\n"
+                                , method_name, __LINE__
+                                , parent->GetName()
+                                , parent->GetNid()
+                                , parent->GetPid()
+                                , parent->GetVerifier() );
+                }
+                Nodes->DeleteCloneProcess( parent );
+                parent = NULL;
+            }
+            else
             {
-                trace_printf( "%s@%d - Deleting clone process %s, (%d,%d:%d)\n"
-                            , method_name, __LINE__
-                            , parent->GetName()
-                            , parent->GetNid()
-                            , parent->GetPid()
-                            , parent->GetVerifier() );
+                ProcessInfoNs_reply_def processInfo;
+                int rc = Nodes->GetProcessInfoNs( parent->GetNid()
+                                                , parent->GetPid()
+                                                , parent->GetVerifier()
+                                                , &processInfo);
+                if (rc == MPI_ERR_NAME)
+                { // parent exited
+                    if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+                    {
+                        trace_printf( "%s@%d - Deleting clone process %s, (%d,%d:%d)\n"
+                                    , method_name, __LINE__
+                                    , parent->GetName()
+                                    , parent->GetNid()
+                                    , parent->GetPid()
+                                    , parent->GetVerifier() );
+                    }
+                    Nodes->DeleteCloneProcess( parent );
+                    parent = NULL;
+                }
             }
-            Nodes->DeleteCloneProcess( parent );
-            parent = NULL;
         }
-    
     }
 
     // if the env is set to not deliver death messages upon node down,
@@ -4624,7 +4656,8 @@ void CProcessContainer::Child_Exit ( CProcess * parent )
                 {
                     if (NameServerEnabled)
                     {
-                        CNode  *childNode = childNode->GetNode();
+                        CNode  *childNode = NULL;
+                        childNode = childNode->GetNode();
                         // Forward the process create to the target node
                         PtpClient->ProcessKill( process
                                               , process->GetAbort()
@@ -4883,6 +4916,7 @@ CProcess *CProcessContainer::CreateProcess (CProcess * parent,
                                             strId_t programStrId,
                                             char *infile,
                                             char *outfile,
+                                            void *tag,
                                             int &result)
 {
     CProcess *process = NULL;
@@ -4954,7 +4988,7 @@ CProcess *CProcessContainer::CreateProcess (CProcess * parent,
             {
                 process->userArgs ( monitorArgc, monitorArgv );
             }
-            if (process->Create (parent, result)) // monitor
+            if (process->Create (parent, tag, result)) // monitor
             {
                 AddToPidMap(process->GetPid(), process);
             }
@@ -6356,7 +6390,7 @@ bool CProcessContainer::RestartPersistentProcess( CProcess *process, int downNid
             process->SetPriorPid( !MyNode->IsSpareNode() ? process->GetPid() : 0 );
             process->SetClone( false );
             int result;
-            successful = process->Create(parent, result);
+            successful = process->Create(parent, 0, result);
             if (successful)
             {
                 process->SetAbended( false );

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/process.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/process.h b/core/sqf/monitor/linux/process.h
index f6f22cb..227836f 100644
--- a/core/sqf/monitor/linux/process.h
+++ b/core/sqf/monitor/linux/process.h
@@ -123,6 +123,7 @@ class CProcessContainer
                              strId_t programStrId,
                              char *infile,
                              char *outfile
+                             , void *tag
                              , int & result
                              );
     bool Dump_Process( CProcess *dumper, CProcess *process, char *core_path );
@@ -237,7 +238,7 @@ class CProcess
     void CompleteDump(DUMPSTATUS status, char *core_file);
     void CompleteProcessStartup( char *port, int os_pid, bool event_messages, bool system_messages, bool preclone, struct timespec *creation_time, int origPNidNs );
     void CompleteRequest( int status );
-    bool Create (CProcess *parent, int & result);
+    bool Create (CProcess *parent, void* tag, int & result);
     bool Dump (CProcess *dumper, char *core_path);
     void DumpBegin(int nid, int pid, Verifier_t verifier, char *core_path);
     void DumpEnd(DUMPSTATUS status, char *core_file);

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/ptpclient.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/ptpclient.cxx b/core/sqf/monitor/linux/ptpclient.cxx
index 03ca514..a88e2d2 100644
--- a/core/sqf/monitor/linux/ptpclient.cxx
+++ b/core/sqf/monitor/linux/ptpclient.cxx
@@ -27,6 +27,7 @@
 
 using namespace std;
 
+#include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -41,6 +42,7 @@ using namespace std;
 #include <sys/resource.h>
 #include <errno.h>
 #include <limits.h>
+#include <unistd.h>
 
 #include "lnode.h"
 #include "pnode.h"
@@ -195,7 +197,7 @@ int CPtpClient::ProcessClone( CProcess *process )
     {
         if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
         {
-            trace_printf( "%s@%d - Not Sending InternalType_Clone request to parentNid=%d\n"
+            trace_printf( "%s@%d - Not Sending InternalType_Clone request to parentNid=%d"
                           ", process=%s (%d:%d:%d)\n"
                         , method_name, __LINE__
                         , process->GetParentNid()
@@ -209,7 +211,7 @@ int CPtpClient::ProcessClone( CProcess *process )
 
     if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
     {
-        trace_printf( "%s@%d - Sending InternalType_Clone request to %s, parentNid=%d\n"
+        trace_printf( "%s@%d - Sending InternalType_Clone request to %s, parentNid=%d"
                       ", process=%s (%d:%d:%d)\n"
                     , method_name, __LINE__
                     , parentLNode->GetNode()->GetName()
@@ -397,7 +399,7 @@ int CPtpClient::ProcessInit( CProcess *process
     {
         if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
         {
-            trace_printf( "%s@%d - Not Sending InternalType_Clone request to parentNid=%d"
+            trace_printf( "%s@%d - Not Sending InternalType_ProcessInit request to parentNid=%d"
                           ", process=%s (%d,%d:%d)\n"
                         , method_name, __LINE__
                         , process->GetParentNid()
@@ -412,14 +414,16 @@ int CPtpClient::ProcessInit( CProcess *process
     if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
     {
         trace_printf( "%s@%d" " - Sending InternalType_ProcessInit to parent node %s, parentNid=%d"
-                    ", for process %s (%d,%d:%d)\n"
+                    ", for process %s (%d,%d:%d), result=%d, tag=%p\n"
                     , method_name, __LINE__
                     , parentLNode->GetNode()->GetName()
                     , parentNid
                     , process->GetName()
                     , process->GetNid()
                     , process->GetPid()
-                    , process->GetVerifier() );
+                    , process->GetVerifier()
+                    , result
+                    , tag );
     }
 
     struct internal_msg_def msg;
@@ -923,3 +927,176 @@ int CPtpClient::SendToMon(const char *reqType, internal_msg_def *msg, int size,
     return error;
 }
 
+int CPtpClient::StdInReq( int nid
+                        , int pid
+                        , StdinReqType type
+                        , int supplierNid
+                        , int supplierPid )
+{
+    const char method_name[] = "CPtpClient::StdInReq";
+    TRACE_ENTRY;
+
+    if (trace_settings & (TRACE_REDIRECTION | TRACE_PROCESS))
+    {
+        trace_printf( "%s@%d - Sending InternalType_StdinReq request type =%d "
+                      "from (%d,%d), for supplier (%d,%d)\n"
+                    , method_name, __LINE__
+                    , type
+                    , nid
+                    , pid
+                    , supplierNid
+                    , supplierPid );
+    }
+
+    CLNode  *lnode = Nodes->GetLNode( supplierNid );
+    if (lnode == NULL)
+    {
+        char buf[MON_STRING_BUF_SIZE];
+        snprintf( buf, sizeof(buf)
+                , "[%s], Can't find supplier node nid=%d "
+                  "for stdin data request.\n"
+                , method_name
+                , supplierNid );
+        mon_log_write(PTPCLIENT_STDINREQ_1, SQ_LOG_ERR, buf);
+
+        TRACE_EXIT;
+        return -1;
+    }
+
+    CProcess *process = lnode->GetProcessL( supplierPid );
+    if (process == NULL)
+    {
+        char buf[MON_STRING_BUF_SIZE];
+        snprintf( buf, sizeof(buf)
+                , "[%s], Can't find process nid=%d, "
+                  "pid=%d for stdin data request.\n"
+                , method_name
+                , supplierNid
+                , supplierPid );
+        mon_log_write(PTPCLIENT_STDINREQ_2, SQ_LOG_ERR, buf);
+
+        TRACE_EXIT;
+        return -1;
+    }
+
+    struct internal_msg_def msg;
+    memset(&msg, 0, sizeof(msg)); 
+    msg.type = InternalType_StdinReq;
+    msg.u.stdin_req.nid = nid;
+    msg.u.stdin_req.pid = pid;
+    msg.u.stdin_req.reqType = type;
+    msg.u.stdin_req.supplier_nid = supplierNid;
+    msg.u.stdin_req.supplier_pid = supplierPid;
+
+    int size = offsetof(struct internal_msg_def, u);
+    size += sizeof(msg.u.stdin_req);
+    
+    if (trace_settings & (TRACE_REDIRECTION | TRACE_PROCESS_DETAIL))
+    {
+        trace_printf( "%s@%d - size_=%d, type =%d "
+                      "from (%d,%d), for supplier (%d,%d)\n"
+                    , method_name, __LINE__
+                    , size
+                    , msg.u.stdin_req.reqType
+                    , msg.u.stdin_req.nid
+                    , msg.u.stdin_req.pid
+                    , msg.u.stdin_req.supplier_nid
+                    , msg.u.stdin_req.supplier_pid );
+    }
+
+    int error = SendToMon("stdin"
+                         , &msg
+                         , size
+                         , process->GetNid()
+                         , lnode->GetNode()->GetName());
+    
+    TRACE_EXIT;
+    return error;
+}
+
+int CPtpClient::StdIoData( int nid
+                         , int pid
+                         , StdIoType type
+                         , ssize_t count
+                         , char *data )
+{
+    const char method_name[] = "CPtpClient::StdIoData";
+    TRACE_ENTRY;
+
+    if (trace_settings & (TRACE_REDIRECTION | TRACE_PROCESS))
+    {
+        trace_printf( "%s@%d - Sending InternalType_IoData request type =%d "
+                      "to (%d,%d), count=%ld\n"
+                    , method_name, __LINE__
+                    , type
+                    , nid
+                    , pid
+                    , count );
+    }
+
+    CLNode  *lnode = Nodes->GetLNode( nid );
+    if (lnode == NULL)
+    {
+        char buf[MON_STRING_BUF_SIZE];
+        snprintf( buf, sizeof(buf)
+                , "[%s], Can't find supplier node nid=%d "
+                  "for stdin data request.\n"
+                , method_name
+                , nid );
+        mon_log_write(PTPCLIENT_STDIODATA_1, SQ_LOG_ERR, buf);
+
+        TRACE_EXIT;
+        return -1;
+    }
+
+    CProcess *process = lnode->GetProcessL( pid );
+    if (process == NULL)
+    {
+        char buf[MON_STRING_BUF_SIZE];
+        snprintf( buf, sizeof(buf)
+                , "[%s], Can't find process nid=%d, "
+                  "pid=%d for stdin data request.\n"
+                , method_name
+                , nid
+                , pid );
+        mon_log_write(PTPCLIENT_STDIODATA_2, SQ_LOG_ERR, buf);
+
+        TRACE_EXIT;
+        return -1;
+    }
+
+    struct internal_msg_def msg;
+    memset(&msg, 0, sizeof(msg)); 
+    msg.type = InternalType_IoData;
+    msg.u.iodata.nid = nid ;
+    msg.u.iodata.pid = pid ;
+    msg.u.iodata.ioType = type ;
+    msg.u.iodata.length = count;
+    memcpy(&msg.u.iodata.data, data, count);
+
+    int size = offsetof(struct internal_msg_def, u);
+    size += sizeof(msg.u.iodata);
+    
+    if (trace_settings & (TRACE_REDIRECTION | TRACE_PROCESS_DETAIL))
+    {
+        trace_printf( "%s@%d - size_=%d, type =%d "
+                      "to (%d,%d), count=%d\n(%s)"
+                    , method_name, __LINE__
+                    , size
+                    , msg.u.iodata.ioType
+                    , msg.u.iodata.nid
+                    , msg.u.iodata.pid
+                    , msg.u.iodata.length
+                    , msg.u.iodata.length?msg.u.iodata.data:"\n" );
+    }
+
+    int error = SendToMon("stdio-data"
+                         , &msg
+                         , size
+                         , process->GetNid()
+                         , lnode->GetNode()->GetName());
+    
+    TRACE_EXIT;
+    return error;
+}
+


[38/50] [abbrv] trafodion git commit: Merge remote branch 'origin/master' into TRAFODION-2884

Posted by su...@apache.org.
Merge remote branch 'origin/master' into TRAFODION-2884


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

Branch: refs/heads/master
Commit: 2eb6b83cc3ef2530577f1e2a3f08107d37be6600
Parents: 731fd2d 609d7a4
Author: Zalo Correa <za...@esgyn.com>
Authored: Fri May 18 09:04:26 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Fri May 18 09:04:26 2018 -0700

----------------------------------------------------------------------
 .rat-excludes                                   |    3 +-
 NOTICE                                          |    2 +-
 RAT_README                                      |    3 +-
 .../java/org/trafodion/jdbc/t4/Certificate.java |    4 +-
 .../main/java/org/trafodion/jdbc/t4/Cipher.java |    8 +-
 .../trafodion/jdbc/t4/ExtractLobMessage.java    |   13 +-
 .../org/trafodion/jdbc/t4/ExtractLobReply.java  |   23 +-
 .../trafodion/jdbc/t4/InterfaceStatement.java   |   54 +-
 .../main/java/org/trafodion/jdbc/t4/Key.java    |    8 +-
 .../org/trafodion/jdbc/t4/MessageDigest.java    |    2 +-
 .../main/java/org/trafodion/jdbc/t4/SecPwd.java |    2 +-
 .../java/org/trafodion/jdbc/t4/Security.java    |    2 +-
 .../trafodion/jdbc/t4/SecurityException.java    |   11 +-
 .../org/trafodion/jdbc/t4/T4Properties.java     |   48 +-
 .../java/org/trafodion/jdbc/t4/TrafT4Blob.java  |   11 -
 .../java/org/trafodion/jdbc/t4/TrafT4Clob.java  |   13 -
 .../java/org/trafodion/jdbc/t4/TrafT4Lob.java   |   39 +-
 .../jdbc/t4/TrafT4PreparedStatement.java        |   21 +-
 .../org/trafodion/jdbc/t4/TrafT4ResultSet.java  |    8 +-
 .../jdbc_type2/native/SQLMXCommonFunctions.cpp  |    9 +
 .../org/apache/trafodion/jdbc/t2/SQLMXDesc.java |    2 +-
 .../jdbc/t2/SQLMXPreparedStatement.java         |   24 +-
 core/conn/odbc/src/odbc/Common/Global.h         |   15 +-
 core/conn/odbc/src/odbc/Common/Listener.h       |    9 +-
 .../odbc/nsksrvr/Interface/Listener_srvr.cpp    |   31 +-
 .../src/odbc/nsksrvr/Interface/Listener_srvr.h  |    4 +-
 .../Interface/linux/Listener_srvr_ps.cpp        |    7 +-
 .../nsksrvr/Interface/marshalingsrvr_srvr.cpp   |   48 +-
 .../nsksrvr/Interface/marshalingsrvr_srvr.h     |    6 +-
 .../src/odbc/nsksrvr/Interface/odbcs_srvr.cpp   |   11 +-
 .../odbc/nsksrvr/Interface/odbcs_srvr_res.cpp   |   18 +-
 .../src/odbc/nsksrvr/Interface/odbcs_srvr_res.h |    6 +-
 core/conn/odbc/src/odbc/nsksrvr/SrvrConnect.cpp |  347 ++-
 core/conn/odbc/src/odbc/nsksrvr/SrvrConnect.h   |    3 +-
 core/conn/odbc/src/odbc/nsksrvr/SrvrMain.cpp    |  107 +-
 core/conn/odbc/src/odbc/nsksrvrcore/Makefile    |    2 +-
 .../conn/odbc/src/odbc/nsksrvrcore/srvrcommon.h |    5 +-
 .../odbc/src/odbc/nsksrvrcore/srvrothers.cpp    |   94 +-
 .../java/org/trafodion/ci/SessionInterface.java |    2 +
 .../odbc/odbcclient/unixcli/cli/chandle.cpp     |    5 +-
 .../odbc/odbcclient/unixcli/cli/ctosqlconv.cpp  |    4 +-
 .../unixcli/cli/sqlexportfunc_drvr.cpp          |  470 ++-
 .../odbcclient/unixcli/cli/sqlexportfunc_drvr.h |  367 +++
 core/sqf/macros.gmk                             |    9 +
 core/sqf/sql/scripts/analyzeMessageGuide.py     |    4 +-
 core/sqf/sql/scripts/dcscheck                   |   24 +-
 core/sqf/sql/scripts/dcsstart                   |    8 +-
 core/sqf/sql/scripts/dcsstop                    |    9 +-
 core/sqf/sql/scripts/ilh_regrinit               |   27 +
 core/sqf/sql/scripts/ilh_trafinit               |    6 +-
 core/sqf/sql/scripts/install_local_hadoop       |    8 +-
 core/sqf/sql/scripts/install_traf_components    |    5 +-
 core/sqf/sql/scripts/pkillall                   |   14 +-
 core/sqf/sql/scripts/presumeall                 |    4 +-
 core/sqf/sql/scripts/psuspendall                |    4 +-
 core/sqf/sql/scripts/regrinit.sql               |   43 +
 core/sqf/sql/scripts/sqcheck                    |    6 +-
 core/sqf/sql/scripts/traf_pkill                 |    2 +-
 core/sqf/src/seabed/src/Makefile                |   20 +-
 .../tm/hbasetmlib2/javaobjectinterfacetm.cpp    |    3 +-
 .../tm/hbasetmlib2/javaobjectinterfacetm.h      |    1 +
 core/sqf/src/tm/tmlib.cpp                       |  188 +-
 core/sqf/src/tm/tmlib.h                         |   27 +-
 core/sqf/src/tm/tmtransaction.cpp               |   22 +-
 core/sqf/src/trafconf/tcdbsqlite.cpp            |    2 -
 core/sqf/src/trafconf/tctrace.cpp               |    2 +-
 core/sql/arkcmp/CmpConnection.cpp               |    4 +-
 core/sql/arkcmp/CmpContext.cpp                  |   69 +-
 core/sql/arkcmp/CmpContext.h                    |    5 +-
 core/sql/bin/SqlciErrors.txt                    |   13 +-
 core/sql/cli/Cli.cpp                            |  311 +-
 core/sql/cli/Context.cpp                        |  190 +-
 core/sql/cli/Context.h                          |   28 +-
 core/sql/cli/ExSqlComp.cpp                      |   21 +-
 core/sql/cli/Globals.cpp                        |   23 +-
 core/sql/cli/Globals.h                          |   10 +-
 core/sql/cli/Statement.cpp                      |   11 +-
 core/sql/comexe/ComCompressionInfo.cpp          |   84 +
 core/sql/comexe/ComCompressionInfo.h            |   91 +
 core/sql/comexe/ComTdbBlockingHdfsScan.h        |    1 -
 core/sql/comexe/ComTdbExeUtil.cpp               |   26 +-
 core/sql/comexe/ComTdbExeUtil.h                 |   43 +-
 core/sql/comexe/ComTdbFastTransport.cpp         |    1 +
 core/sql/comexe/ComTdbFastTransport.h           |    7 +-
 core/sql/comexe/ComTdbHdfsScan.cpp              |    1 +
 core/sql/comexe/ComTdbHdfsScan.h                |   17 +-
 core/sql/common/BaseTypes.cpp                   |    3 +-
 core/sql/common/CharType.cpp                    |    2 +-
 core/sql/common/CharType.h                      |   27 +-
 core/sql/common/ComDistribution.cpp             |    1 +
 core/sql/common/ComResWords.cpp                 |    2 -
 core/sql/common/ComRtUtils.cpp                  |    1 +
 core/sql/common/ComSecurityKey.cpp              |  114 +-
 core/sql/common/ComSecurityKey.h                |    5 +-
 core/sql/common/ComSmallDefs.h                  |   42 +-
 core/sql/common/ComUser.cpp                     |    2 +-
 core/sql/common/DTICommonType.cpp               |   12 +
 core/sql/common/ExprNode.cpp                    |   21 +-
 core/sql/common/NAString.cpp                    |    3 +-
 core/sql/common/NAType.cpp                      |   12 +-
 core/sql/common/NAType.h                        |    5 +-
 core/sql/common/OperTypeEnum.h                  |    3 +
 core/sql/common/Platform.h                      |    2 +
 core/sql/executor/ExCancel.cpp                  |    9 +-
 core/sql/executor/ExExeUtil.h                   |   36 +-
 core/sql/executor/ExExeUtilCli.cpp              |  169 +-
 core/sql/executor/ExExeUtilCli.h                |   22 +-
 core/sql/executor/ExExeUtilCommon.cpp           |   50 +-
 core/sql/executor/ExExeUtilExplain.cpp          |   48 +-
 core/sql/executor/ExExeUtilGet.cpp              | 1001 +++---
 core/sql/executor/ExExeUtilGetStats.cpp         |   20 +-
 core/sql/executor/ExExeUtilLoad.cpp             |  561 +---
 core/sql/executor/ExExeUtilMisc.cpp             |  196 +-
 core/sql/executor/ExExeUtilVolTab.cpp           |   29 +-
 core/sql/executor/ExExplain.cpp                 |    6 +-
 core/sql/executor/ExFastTransport.cpp           |   50 +-
 core/sql/executor/ExHbaseAccess.cpp             |   17 +-
 core/sql/executor/ExHbaseIUD.cpp                |    2 +-
 core/sql/executor/ExHdfsScan.cpp                |  151 +-
 core/sql/executor/ExHdfsScan.h                  |   25 +
 core/sql/executor/ExSMCommon.cpp                |    1 +
 core/sql/executor/ExSMCommon.h                  |    3 +-
 core/sql/executor/ExSMGlobals.cpp               |    1 +
 core/sql/executor/ExSMQueue.cpp                 |    2 +-
 core/sql/executor/ExSMReader.cpp                |    1 +
 core/sql/executor/ExSMShortMessage.cpp          |    2 +-
 core/sql/executor/ExSMTaskList.cpp              |    2 +-
 core/sql/executor/ExStats.cpp                   |    2 +-
 core/sql/executor/HBaseClient_JNI.cpp           |  886 +-----
 core/sql/executor/HBaseClient_JNI.h             |  106 +-
 core/sql/executor/HdfsClient_JNI.cpp            |  549 +++-
 core/sql/executor/HdfsClient_JNI.h              |   79 +-
 core/sql/executor/HiveClient_JNI.cpp            |  536 ++++
 core/sql/executor/HiveClient_JNI.h              |  113 +
 core/sql/executor/JavaObjectInterface.cpp       |  114 +-
 core/sql/executor/JavaObjectInterface.h         |   23 +-
 core/sql/executor/OrcFileReader.cpp             |   23 +-
 core/sql/executor/OrcFileReader.h               |    2 +-
 core/sql/executor/SequenceFileReader.cpp        |   61 +-
 core/sql/executor/SequenceFileReader.h          |    4 +-
 core/sql/executor/ex_control.cpp                |    5 +-
 core/sql/executor/ex_ddl.cpp                    |   25 +-
 core/sql/executor/ex_root.cpp                   |   80 +-
 core/sql/executor/hiveHook.cpp                  |   62 +-
 .../sql/executor/org_trafodion_sql_HDFSClient.h |   31 +
 core/sql/executor/sql_buffer.cpp                |    3 +-
 core/sql/exp/ExpError.cpp                       |   14 +
 core/sql/exp/ExpError.h                         |    9 +
 core/sql/exp/ExpHbaseInterface.cpp              |    5 +-
 core/sql/exp/ExpHbaseInterface.h                |    2 +
 core/sql/exp/ExpLOBaccess.cpp                   |  172 +-
 core/sql/exp/ExpLOBaccess.h                     |    8 -
 core/sql/exp/ExpLOBinterface.cpp                |    7 +-
 core/sql/exp/ExpLOBinterface.h                  |   10 +
 core/sql/exp/ExpPCodeClauseGen.cpp              |    4 +
 core/sql/exp/exp_attrs.cpp                      |   14 +-
 core/sql/exp/exp_attrs.h                        |    8 +-
 core/sql/exp/exp_function.cpp                   |  320 +-
 core/sql/exp/exp_function.h                     |   30 +-
 core/sql/export/ComDiags.cpp                    |   10 +
 core/sql/export/ComDiags.h                      |   10 +-
 core/sql/generator/GenExpGenerator.cpp          |   21 +-
 core/sql/generator/GenFastTransport.cpp         |    8 +-
 core/sql/generator/GenItemFunc.cpp              |    6 +-
 core/sql/generator/GenPreCode.cpp               |    6 +-
 core/sql/generator/GenRelExeUtil.cpp            |  224 +-
 core/sql/generator/GenRelJoin.cpp               |    8 +-
 core/sql/generator/GenRelPackedRows.cpp         |    7 +-
 core/sql/generator/GenRelScan.cpp               |   24 +-
 core/sql/generator/GenRelUpdate.cpp             |    2 +
 core/sql/generator/GenShape.cpp                 |    7 +
 core/sql/generator/Generator.h                  |    1 +
 .../java/org/trafodion/libmgmt/JDBCUDR.java     |  721 +++++
 core/sql/nskgmake/comexe/Makefile               |    3 +-
 core/sql/nskgmake/executor/Makefile             |    1 +
 core/sql/nskgmake/sqlcomp/Makefile              |    1 +
 core/sql/nskgmake/tdm_sqlexp/Makefile           |    2 +-
 core/sql/nskgmake/udr_predef/Makefile           |    1 +
 core/sql/optimizer/BindItemExpr.cpp             |  333 +-
 core/sql/optimizer/BindRelExpr.cpp              |   62 +-
 core/sql/optimizer/ColStatDesc.cpp              |    4 +
 core/sql/optimizer/ControlDB.cpp                |   10 +
 core/sql/optimizer/GroupAttr.h                  |   15 +-
 core/sql/optimizer/HDFSHook.cpp                 |   35 +-
 core/sql/optimizer/HDFSHook.h                   |   16 +-
 core/sql/optimizer/Inlining.cpp                 |   19 +-
 core/sql/optimizer/ItemCache.cpp                |    8 +
 core/sql/optimizer/ItemExpr.cpp                 |    9 +-
 core/sql/optimizer/ItemExprList.cpp             |   11 +
 core/sql/optimizer/ItemFunc.h                   |   52 +-
 core/sql/optimizer/NATable.cpp                  |   30 +-
 core/sql/optimizer/NormRelExpr.cpp              |   67 +-
 core/sql/optimizer/ObjectNames.cpp              |    9 +-
 core/sql/optimizer/ObjectNames.h                |    1 +
 core/sql/optimizer/OptPhysRelExpr.cpp           |    2 +-
 core/sql/optimizer/OptimizerSimulator.cpp       |   50 +-
 core/sql/optimizer/PartFunc.cpp                 |   52 +-
 core/sql/optimizer/RelExpr.cpp                  |   23 +-
 core/sql/optimizer/RelRoutine.cpp               |    9 +
 core/sql/optimizer/RelScan.h                    |   18 +-
 core/sql/optimizer/RelSet.h                     |    2 +-
 core/sql/optimizer/SynthType.cpp                |   57 +-
 core/sql/optimizer/ValueDesc.cpp                |   59 +-
 core/sql/optimizer/hiveHook.h                   |   11 -
 core/sql/optimizer/mdam.cpp                     |   30 +-
 core/sql/parser/ElemDDLCol.cpp                  |   41 +-
 core/sql/parser/ElemDDLColDef.h                 |    9 +
 core/sql/parser/ElemDDLColDefault.h             |   17 +
 core/sql/parser/SqlParserAux.cpp                |    4 +-
 core/sql/parser/StmtDDLCommentOn.h              |    1 +
 core/sql/parser/StmtDDLCreate.cpp               |   16 +
 core/sql/parser/sqlparser.y                     |  154 +-
 core/sql/qmscommon/QRLogger.cpp                 |    2 +-
 core/sql/regress/compGeneral/EXPECTED006.SB     |   10 +-
 core/sql/regress/compGeneral/EXPECTED015.SB     |   18 +-
 core/sql/regress/compGeneral/EXPECTED042        |  139 +-
 core/sql/regress/compGeneral/EXPECTED072        |   19 +-
 core/sql/regress/compGeneral/EXPECTEDTOK        |    7 +-
 core/sql/regress/compGeneral/FILTERTOK          |   31 +
 core/sql/regress/compGeneral/TEST072            |    5 +-
 core/sql/regress/compGeneral/TESTTOK            |   21 +
 core/sql/regress/compGeneral/TESTTOK.sh         |   51 +
 core/sql/regress/core/DIFF038.KNOWN.LINUX       |    3 +
 core/sql/regress/core/EXPECTED000.SB            |    8 +-
 core/sql/regress/core/EXPECTED005.SB            |    4 +-
 core/sql/regress/core/EXPECTED038.LINUX         |   26 +-
 core/sql/regress/core/EXPECTED116               |    6 +-
 core/sql/regress/core/EXPECTED131               |    8 +-
 core/sql/regress/core/EXPECTED163               |   63 +
 core/sql/regress/core/TEST000                   |   22 +-
 core/sql/regress/core/TEST131                   |    4 +-
 core/sql/regress/core/TEST163                   |  115 +
 core/sql/regress/executor/DIFF001.KNOWN.SB      |    9 +-
 core/sql/regress/executor/EXPECTED001           |    3 +-
 core/sql/regress/executor/EXPECTED012           |  598 +++-
 core/sql/regress/executor/EXPECTED013.SB        |    9 +-
 core/sql/regress/executor/TEST012               |  103 +-
 core/sql/regress/executor/TEST013               |    2 +-
 core/sql/regress/executor/TEST063               |    1 +
 core/sql/regress/hive/DIFF002.KNOWN             |   14 +
 core/sql/regress/hive/EXPECTED003               |    6 +-
 core/sql/regress/hive/EXPECTED005               |  112 +-
 core/sql/regress/hive/EXPECTED007               |    2 +-
 core/sql/regress/hive/EXPECTED009               |   56 +-
 core/sql/regress/hive/EXPECTED017               |   15 +-
 core/sql/regress/hive/EXPECTED018               |    2 +-
 core/sql/regress/hive/EXPECTED030               | 2902 ------------------
 core/sql/regress/hive/EXPECTED040               | 2527 ---------------
 core/sql/regress/hive/FILTER002                 |   33 +
 core/sql/regress/hive/TEST017                   |    7 +-
 core/sql/regress/privs1/EXPECTED120             |   80 +-
 core/sql/regress/privs1/EXPECTED123             |  805 +++++
 core/sql/regress/privs1/EXPECTED125             |  276 +-
 core/sql/regress/privs1/EXPECTED137             |   31 +-
 core/sql/regress/privs1/EXPECTED141             |    3 +-
 core/sql/regress/privs1/TEST120                 |   28 +-
 core/sql/regress/privs1/TEST123                 |   46 +
 core/sql/regress/privs1/TEST125                 |   20 +-
 core/sql/regress/privs1/TEST137                 |   23 +-
 core/sql/regress/privs1/TEST141                 |    3 +
 core/sql/regress/privs2/EXPECTED135             |   15 +-
 core/sql/regress/privs2/EXPECTED138             |    6 +-
 core/sql/regress/privs2/EXPECTED140             |   16 +-
 core/sql/regress/privs2/EXPECTED143             |   16 +-
 core/sql/regress/privs2/EXPECTED144             |   30 +-
 core/sql/regress/privs2/EXPECTED146             | 1656 ++++++++++
 core/sql/regress/privs2/FILTER146               |   38 +
 core/sql/regress/privs2/TEST143                 |    3 +
 core/sql/regress/privs2/TEST144                 |    3 +-
 core/sql/regress/privs2/TEST146                 |  248 ++
 core/sql/regress/seabase/EXPECTED002            |  288 +-
 core/sql/regress/seabase/EXPECTED010            |    3 +
 core/sql/regress/seabase/EXPECTED020            |  109 +
 core/sql/regress/seabase/EXPECTED022            |  129 +-
 core/sql/regress/seabase/EXPECTED026            |   34 +-
 core/sql/regress/seabase/EXPECTED030            |   14 +
 core/sql/regress/seabase/EXPECTED031            |   44 +-
 core/sql/regress/seabase/FILTER002              |    7 +-
 core/sql/regress/seabase/TEST002                |   41 +-
 core/sql/regress/seabase/TEST020                |   38 +
 core/sql/regress/seabase/TEST022                |   11 +
 core/sql/regress/seabase/TEST026                |    3 +-
 core/sql/regress/seabase/TEST026_drop_hbase     |   26 +
 core/sql/regress/seabase/TEST030                |    4 +
 core/sql/regress/seabase/TEST031                |   10 +
 core/sql/regress/tools/runallsb                 |   27 +
 core/sql/regress/tools/runregr                  |   29 +
 core/sql/regress/tools/runregr_charsets.ksh     |    5 +
 core/sql/regress/tools/runregr_checktest1.ksh   |    4 +
 core/sql/regress/tools/runregr_checktest2.ksh   |    4 +
 core/sql/regress/tools/runregr_checktests.ksh   |  528 ++++
 core/sql/regress/tools/runregr_compGeneral.ksh  |   18 +-
 core/sql/regress/tools/runregr_core.ksh         |    7 +-
 core/sql/regress/tools/runregr_executor.ksh     |    5 +
 core/sql/regress/tools/runregr_fullstack2.ksh   |    5 +
 core/sql/regress/tools/runregr_hive.ksh         |    9 +-
 core/sql/regress/tools/runregr_privs1.ksh       |    5 +
 core/sql/regress/tools/runregr_privs2.ksh       |    5 +
 core/sql/regress/tools/runregr_seabase.ksh      |    5 +
 core/sql/regress/tools/runregr_udr.ksh          |    5 +
 core/sql/regress/udr/DIFF101.KNOWN.SB           |    3 +
 core/sql/regress/udr/EXPECTED002                |   97 +-
 core/sql/regress/udr/EXPECTED102                |    2 +
 core/sql/regress/udr/TEST002                    |   58 +-
 core/sql/runtimestats/sscpipc.cpp               |    8 +
 core/sql/runtimestats/ssmpipc.cpp               |    4 +-
 core/sql/runtimestats/ssmpipc.h                 |    2 +-
 core/sql/sort/SortError.h                       |    2 +-
 core/sql/sqlci/Param.cpp                        |    8 +-
 core/sql/sqlci/Param.h                          |    2 +-
 core/sql/sqlci/SqlCmd.cpp                       |  108 +-
 core/sql/sqlci/SqlciCmd.cpp                     |    6 +-
 core/sql/sqlci/sqlcmd.h                         |    8 +-
 core/sql/sqlcomp/CmpDDLCatErrorCodes.h          |    3 +-
 core/sql/sqlcomp/CmpDescribe.cpp                |   43 +-
 core/sql/sqlcomp/CmpMain.cpp                    |    8 +-
 core/sql/sqlcomp/CmpSeabaseDDL.h                |   27 +-
 core/sql/sqlcomp/CmpSeabaseDDLauth.cpp          |    1 -
 core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp     |   43 +-
 core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp        |  265 +-
 core/sql/sqlcomp/CmpSeabaseDDLindex.cpp         |    8 +
 core/sql/sqlcomp/CmpSeabaseDDLmd.h              |    4 +-
 core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp       |  181 +-
 core/sql/sqlcomp/CmpSeabaseDDLroutine.h         |   99 +-
 core/sql/sqlcomp/CmpSeabaseDDLschema.cpp        |   21 +-
 core/sql/sqlcomp/CmpSeabaseDDLtable.cpp         |  191 +-
 core/sql/sqlcomp/CmpSeabaseDDLutil.cpp          |    6 +
 core/sql/sqlcomp/DefaultConstants.h             |   12 +
 core/sql/sqlcomp/PrivMgr.cpp                    |    9 +
 core/sql/sqlcomp/PrivMgr.h                      |    4 +
 core/sql/sqlcomp/PrivMgrCommands.cpp            |  160 +-
 core/sql/sqlcomp/PrivMgrCommands.h              |  360 +--
 core/sql/sqlcomp/PrivMgrComponentPrivileges.cpp |   18 +-
 core/sql/sqlcomp/PrivMgrComponentPrivileges.h   |    4 +-
 core/sql/sqlcomp/PrivMgrMDTable.cpp             |    4 +-
 core/sql/sqlcomp/PrivMgrPrivileges.cpp          |  142 +-
 core/sql/sqlcomp/PrivMgrPrivileges.h            |    7 +
 core/sql/sqlcomp/PrivMgrRoles.cpp               |   34 +
 core/sql/sqlcomp/PrivMgrUserPrivs.cpp           |  208 ++
 core/sql/sqlcomp/PrivMgrUserPrivs.h             |  400 +++
 core/sql/sqlcomp/QCache.cpp                     |   17 +
 core/sql/sqlcomp/nadefaults.cpp                 |   82 +-
 core/sql/sqludr/SqlUdrPredefSeries.cpp          |  112 +
 .../java/org/trafodion/sql/HBaseClient.java     |   64 +-
 .../main/java/org/trafodion/sql/HDFSClient.java |  409 ++-
 .../java/org/trafodion/sql/HTableClient.java    |   16 +-
 .../main/java/org/trafodion/sql/HdfsScan.java   |  128 +-
 .../main/java/org/trafodion/sql/HiveClient.java |  169 +-
 .../java/org/trafodion/sql/TrafRegionStats.java |   13 +-
 .../java/org/trafodion/sql/udr/LmT2Driver.java  |   12 +
 .../org/trafodion/sql/udr/predef/JDBCUDR.java   |   33 +-
 core/sql/udrserv/udrdefs.h                      |   39 +-
 core/sql/ustat/hs_cli.cpp                       |    3 +-
 core/sql/ustat/hs_globals.cpp                   |   22 +-
 core/sql/ustat/hs_log.h                         |    1 +
 core/sql/ustat/hs_parser.cpp                    |   13 -
 dcs/bin/dcs-config.sh                           |   14 +-
 dcs/bin/dcs-daemon.sh                           |   48 +-
 dcs/bin/getActiveMaster.sh                      |   80 +
 dcs/bin/master-backup.sh                        |   36 +-
 dcs/bin/scripts/dcsbind.sh                      |   64 +-
 dcs/bin/scripts/dcsunbind.sh                    |   43 +-
 dcs/bin/scripts/parse_dcs_site.py               |   18 +-
 dcs/bin/start-dcs.sh                            |    9 +-
 dcs/bin/stop-dcs.sh                             |   16 +-
 dcs/conf/backup-masters                         |    0
 dcs/conf/dcs-env.sh                             |    4 +
 dcs/conf/master                                 |    0
 dcs/conf/masters                                |    0
 .../main/asciidoc/_chapters/configuration.adoc  |  220 +-
 .../main/java/org/trafodion/dcs/Constants.java  |   30 +-
 .../org/trafodion/dcs/server/ServerManager.java |   30 +
 dcs/src/main/resources/dcs-default.xml          |   39 +
 .../org/trafodion/jdbc_test/JdbcCommon.java     |   27 +-
 .../java/org/trafodion/jdbc_test/PropTest.java  |    9 +-
 .../java/org/trafodion/jdbc_test/TestBlob.java  |   16 +-
 .../org/trafodion/jdbc_test/TestBlobBatch.java  |   12 +-
 .../java/org/trafodion/jdbc_test/TestClob.java  |   17 +-
 .../org/trafodion/jdbc_test/TestClobBatch.java  |   15 +-
 .../org/trafodion/jdbc_test/TestForeignKey.java |   87 +-
 .../trafodion/jdbc_test/TestGetIndexInfo.java   |   24 +-
 .../src/asciidoc/_chapters/odbc_windows.adoc    |   18 +-
 .../src/asciidoc/_chapters/preparation.adoc     |    2 +
 .../src/asciidoc/_chapters/commands.adoc        |    2 +-
 .../src/asciidoc/_chapters/binder_msgs.adoc     |   13 +
 .../src/asciidoc/_chapters/ddl_msgs.adoc        |   38 +-
 .../src/asciidoc/_chapters/ambari_install.adoc  |    4 +-
 .../src/asciidoc/_chapters/introduction.adoc    |   10 +-
 .../src/asciidoc/_chapters/introduction.adoc    |   11 +-
 .../sql_functions_and_expressions.adoc          | 1047 ++++++-
 .../src/asciidoc/_chapters/sql_statements.adoc  |  441 ++-
 docs/src/site/markdown/documentation.md         |   21 +
 docs/src/site/markdown/download.md              |   88 +-
 docs/src/site/markdown/release-notes-2-2-0.md   |  539 ++++
 docs/src/site/markdown/release-notes.md         |    1 +
 docs/src/site/site.xml                          |    8 +
 .../TRAFODION/2.1/configuration/dcs-env.xml     |    7 +-
 .../2.1/package/scripts/trafodionnode.py        |   13 +-
 install/python-installer/scripts/dcs_setup.py   |    9 +-
 install/python-installer/scripts/hdfs_cmds.py   |    2 +-
 install/python-installer/scripts/traf_start.py  |    8 +
 win-odbc64/odbcclient/drvr35/ctosqlconv.cpp     |    4 +-
 402 files changed, 18336 insertions(+), 11774 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/2eb6b83c/core/sqf/src/trafconf/tcdbsqlite.cpp
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/trafodion/blob/2eb6b83c/core/sqf/src/trafconf/tctrace.cpp
----------------------------------------------------------------------


[24/50] [abbrv] trafodion git commit: More monitor p2p fixes to address Seabed test failures in virtual and real cluster testing.

Posted by su...@apache.org.
More monitor p2p fixes to address Seabed test failures in virtual and real cluster testing.


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

Branch: refs/heads/master
Commit: 251f3f57d62915b14ad365af85afe29083940076
Parents: 7d6c0dd
Author: Zalo Correa <za...@esgyn.com>
Authored: Tue Apr 10 17:54:38 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Tue Apr 10 17:54:38 2018 -0700

----------------------------------------------------------------------
 core/sqf/monitor/linux/cluster.cxx         |  10 ++
 core/sqf/monitor/linux/internal.h          |  14 +++
 core/sqf/monitor/linux/monitor.cxx         |  13 ++
 core/sqf/monitor/linux/msgdef.h            |   2 +
 core/sqf/monitor/linux/nameserver.cxx      |  11 +-
 core/sqf/monitor/linux/nscommacceptmon.cxx |   2 +
 core/sqf/monitor/linux/nsreqdelproc.cxx    |  46 ++++---
 core/sqf/monitor/linux/nsreqnewproc.cxx    |   2 +-
 core/sqf/monitor/linux/pnode.h             |   3 +
 core/sqf/monitor/linux/process.cxx         |  97 +++++++++++----
 core/sqf/monitor/linux/process.h           |   2 +-
 core/sqf/monitor/linux/replicate.cxx       |  76 ++++++++++-
 core/sqf/monitor/linux/replicate.h         |  26 ++++
 core/sqf/monitor/linux/reqqueue.cxx        | 159 ++++++++++++++++++++++--
 core/sqf/monitor/linux/reqqueue.h          |  30 +++++
 core/sqf/monitor/test/monitor.env          |   2 +-
 16 files changed, 438 insertions(+), 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/251f3f57/core/sqf/monitor/linux/cluster.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/cluster.cxx b/core/sqf/monitor/linux/cluster.cxx
index aa3062c..514771d 100644
--- a/core/sqf/monitor/linux/cluster.cxx
+++ b/core/sqf/monitor/linux/cluster.cxx
@@ -1752,6 +1752,7 @@ int CCluster::SoftNodeUpPrepare( int pnid )
     {
         SMSIntegrating = true;
 #ifndef NAMESERVER_PROCESS
+        node->SetSoftNodeUp( );
         Monitor->StartPrimitiveProcesses();
 #endif
         // Let other monitors know this node is preparing to soft up
@@ -2289,7 +2290,11 @@ void CCluster::HandleOtherNodeMsg (struct internal_msg_def *recv_msg,
     case InternalType_Exit:
         if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
             trace_printf("%s@%d - Internal exit request for %s (%d, %d)\n", method_name, __LINE__, recv_msg->u.exit.name, recv_msg->u.exit.nid, recv_msg->u.exit.pid);
+#ifndef NAMESERVER_PROCESS
         ReqQueue.enqueueExitReq( &recv_msg->u.exit );
+#else
+        ReqQueue.enqueueExitNsReq( &recv_msg->u.exit_ns );
+#endif
         break;
 
 #ifndef NAMESERVER_PROCESS
@@ -2880,6 +2885,11 @@ void CCluster::HandleMyNodeMsg (struct internal_msg_def *recv_msg,
     case InternalType_Exit:
         // Final process exit logic is done in Process_Exit, not here
         // as in the past.
+        if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
+            trace_printf("%s@%d - Internal exit request for %s (%d, %d)\n", method_name, __LINE__, recv_msg->u.exit_ns.name, recv_msg->u.exit_ns.nid, recv_msg->u.exit_ns.pid);
+#ifdef NAMESERVER_PROCESS
+        ReqQueue.enqueueExitNsReq( &recv_msg->u.exit_ns );
+#endif
         break;
 
 #ifndef NAMESERVER_PROCESS

http://git-wip-us.apache.org/repos/asf/trafodion/blob/251f3f57/core/sqf/monitor/linux/internal.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/internal.h b/core/sqf/monitor/linux/internal.h
index 505e1c3..6d28b29 100644
--- a/core/sqf/monitor/linux/internal.h
+++ b/core/sqf/monitor/linux/internal.h
@@ -92,6 +92,7 @@ typedef enum {
     State_Default=0,
     State_Quiesce,                  // node quiesce state while going down
     State_SoftDown,                 // node soft down on DTM abort -> restart
+    State_SoftUp,                   // node soft up on DTM restart
     State_Ready_To_Exit
 } IntNodeState; 
 
@@ -176,6 +177,18 @@ struct exit_def
     bool abended;
 };
 
+struct exit_ns_def
+{
+    int nid;                        // Node id of process exiting
+    int pid;                        // Process id of process exiting
+    Verifier_t verifier;            // Verifier of the process exiting
+    char name[MAX_PROCESS_NAME];    // Name of process exiting
+    bool abended;
+    int sockFd;                     // monitor socket fd to reply
+    int origPNid;                   // pnid of nameserver which processed request
+    struct message_def *msg;        // requester's request buffer to reply
+};
+
 struct event_def
 {
     int  nid;                        // Nid id of process to receive event
@@ -433,6 +446,7 @@ struct internal_msg_def
         struct down_def    down;
         struct dump_def    dump;
         struct exit_def    exit;
+        struct exit_ns_def exit_ns;
         struct event_def   event;
         ioData_t           iodata;
         struct kill_def    kill;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/251f3f57/core/sqf/monitor/linux/monitor.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/monitor.cxx b/core/sqf/monitor/linux/monitor.cxx
index d97a3f0..578d158 100755
--- a/core/sqf/monitor/linux/monitor.cxx
+++ b/core/sqf/monitor/linux/monitor.cxx
@@ -1791,7 +1791,20 @@ int main (int argc, char *argv[])
 #endif
                 if (monitorPort)
                 {
+#ifdef NAMESERVER_PROCESS
+                    if ( IsRealCluster )
+                    {
+                        strcpy( IntegratingMonitorPort, MasterMonitorName);
+                    }
+                    else
+                    {
+                        char localHost[MAX_PROCESSOR_NAME];
+                        gethostname( localHost, MAX_PROCESSOR_NAME );
+                        strcpy( IntegratingMonitorPort, localHost);
+                    }
+#else
                     strcpy( IntegratingMonitorPort, MasterMonitorName);
+#endif
                     strcat( IntegratingMonitorPort, ":");
                     strcat( IntegratingMonitorPort, monitorPort);
                 }

http://git-wip-us.apache.org/repos/asf/trafodion/blob/251f3f57/core/sqf/monitor/linux/msgdef.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/msgdef.h b/core/sqf/monitor/linux/msgdef.h
index 98f11c8..4b34557 100644
--- a/core/sqf/monitor/linux/msgdef.h
+++ b/core/sqf/monitor/linux/msgdef.h
@@ -332,6 +332,7 @@ typedef enum {
                                             // types, add any new message types 
                                             // before this one
 } MSGTYPE;
+
 typedef TcProcessType_t PROCESSTYPE;
 
 typedef enum {
@@ -369,6 +370,7 @@ struct DelProcessNs_def
     int  target_pid;                        // Process id of process to delete
     Verifier_t target_verifier;             // Process verifier of processes to delete
     char target_process_name[MAX_PROCESS_NAME];    // Name of process to delete
+    bool target_abended;                    // True if process aborted
 };
 
 struct DelProcessNs_reply_def

http://git-wip-us.apache.org/repos/asf/trafodion/blob/251f3f57/core/sqf/monitor/linux/nameserver.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nameserver.cxx b/core/sqf/monitor/linux/nameserver.cxx
index 1815409..93f99b3 100644
--- a/core/sqf/monitor/linux/nameserver.cxx
+++ b/core/sqf/monitor/linux/nameserver.cxx
@@ -513,6 +513,7 @@ int CNameServer::ProcessDelete(CProcess* process )
     msgdel->target_pid = msgdel->pid;
     msgdel->target_verifier = msgdel->verifier;
     strcpy( msgdel->target_process_name, msgdel->process_name );
+    msgdel->target_abended = process->IsAbended();
 
     int error = SendReceive(&msg );
 
@@ -636,13 +637,14 @@ int CNameServer::ProcessShutdown( void )
 int CNameServer::SendReceive( struct message_def* msg )
 {
     const char method_name[] = "CNameServer::SendReceive";
-    char desc[100];
+    char desc[256];
     char* descp;
     struct DelProcessNs_def *msgdel;
     struct NewProcessNs_def *msgnew;
     struct ShutdownNs_def *msgshutdown;
     struct NameServerStart_def *msgstart;
     struct NameServerStop_def *msgstop;
+    struct ProcessInfo_def *msginfo;
 
     TRACE_ENTRY;
 
@@ -675,7 +677,12 @@ int CNameServer::SendReceive( struct message_def* msg )
         size += sizeof(msg->u.request.u.new_process_ns);
         break;
     case ReqType_ProcessInfo:
-        descp = (char *) "process-info";
+        msginfo = &msg->u.request.u.process_info;
+        sprintf( desc, "process-info (nid=%d, pid=%d, verifier=%d, name=%s)\n"
+                       "\ttarget (nid=%d, pid=%d, verifier=%d, name=%s, type=%d)\n",
+                msginfo->nid, msginfo->pid, msginfo->verifier, msginfo->process_name,
+                msginfo->target_nid, msginfo->target_pid, msginfo->target_verifier, 
+                msginfo->target_process_name, msginfo->type );
         size += sizeof(msg->u.request.u.process_info);
         break;
     case ReqType_ProcessInfoCont:

http://git-wip-us.apache.org/repos/asf/trafodion/blob/251f3f57/core/sqf/monitor/linux/nscommacceptmon.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nscommacceptmon.cxx b/core/sqf/monitor/linux/nscommacceptmon.cxx
index 763d324..3482608 100644
--- a/core/sqf/monitor/linux/nscommacceptmon.cxx
+++ b/core/sqf/monitor/linux/nscommacceptmon.cxx
@@ -85,6 +85,7 @@ void CCommAcceptMon::monReqDeleteProcess( struct message_def* msg, int sockFd )
                       "        msg.del_process_ns.target_pid=%d\n"
                       "        msg.del_process_ns.target_verifier=%d\n"
                       "        msg.del_process_ns.target_process_name=%s\n"
+                      "        msg.del_process_ns.target_abended=%d\n"
                     , method_name, __LINE__
                     , msg->u.request.u.del_process_ns.nid
                     , msg->u.request.u.del_process_ns.pid
@@ -94,6 +95,7 @@ void CCommAcceptMon::monReqDeleteProcess( struct message_def* msg, int sockFd )
                     , msg->u.request.u.del_process_ns.target_pid
                     , msg->u.request.u.del_process_ns.target_verifier
                     , msg->u.request.u.del_process_ns.target_process_name
+                    , msg->u.request.u.del_process_ns.target_abended
                     );
     }
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/251f3f57/core/sqf/monitor/linux/nsreqdelproc.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nsreqdelproc.cxx b/core/sqf/monitor/linux/nsreqdelproc.cxx
index 8de0c6a..05585cf 100644
--- a/core/sqf/monitor/linux/nsreqdelproc.cxx
+++ b/core/sqf/monitor/linux/nsreqdelproc.cxx
@@ -56,7 +56,7 @@ CExtDelProcessNsReq::~CExtDelProcessNsReq()
 
 void CExtDelProcessNsReq::populateRequestString( void )
 {
-    char strBuf[MON_STRING_BUF_SIZE/2] = { 0 };
+    char strBuf[MON_STRING_BUF_SIZE] = { 0 };
 
     snprintf( strBuf, sizeof(strBuf), 
               "ExtReq(%s) req #=%ld "
@@ -93,7 +93,7 @@ void CExtDelProcessNsReq::performRequest()
     if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
     {
         trace_printf( "%s@%d request #%ld: Delete, requester %s (%d, %d:%d), "
-                      "target %s (%d, %d:%d)\n",
+                      "target %s (%d, %d:%d), abended=%d\n",
                       method_name, __LINE__, id_,
                       msg_->u.request.u.del_process_ns.process_name,
                       msg_->u.request.u.del_process_ns.nid,
@@ -102,13 +102,15 @@ void CExtDelProcessNsReq::performRequest()
                       msg_->u.request.u.del_process_ns.target_process_name,
                       msg_->u.request.u.del_process_ns.target_nid,
                       msg_->u.request.u.del_process_ns.target_pid,
-                      msg_->u.request.u.del_process_ns.target_verifier);
+                      msg_->u.request.u.del_process_ns.target_verifier,
+                      msg_->u.request.u.del_process_ns.target_abended);
     }
 
     nid_ = msg_->u.request.u.del_process_ns.nid;
     verifier_ = msg_->u.request.u.del_process_ns.verifier;
     processName_ = msg_->u.request.u.del_process_ns.process_name;
 
+    bool      target_abended = msg_->u.request.u.del_process_ns.target_abended;
     int       target_nid = -1;
     int       target_pid = -1;
     string    target_process_name;
@@ -128,18 +130,28 @@ void CExtDelProcessNsReq::performRequest()
     if (process)
     {
         CNode * node = Nodes->GetLNode (process->GetNid())->GetNode();
-        node->DelFromNameMap ( process );
-        node->DelFromPidMap ( process );
-        process->SetState (State_Stopped);
-        // Replicate the exit to other nodes
-        CReplExit *repl = new CReplExit(process->GetNid(),
-                                        process->GetPid(),
-                                        process->GetVerifier(),
-                                        process->GetName(),
-                                        process->IsAbended());
-        Replicator.addItem(repl);
-        process->SetDeletePending ( true );
-        node->DeleteFromList( process );
+
+        // Note: process object is deletes by Exit_Process, so use 
+        //       target_* values to replicate
+        node->Exit_Process( process, target_abended, -1 );
+        // Replicate the exit to other name servers 
+        CReplExitNs *repl = new CReplExitNs(target_nid,
+                                            target_pid,
+                                            target_verifier,
+                                            target_process_name.c_str(),
+                                            target_abended,
+                                            msg_,
+                                            sockFd_,
+                                            MyPNID );
+        if (repl)
+        {
+            // we will not reply at this time ... but wait for 
+            // exit request to be processed in CIntExitNsReq
+
+            msg_->noreply = true;
+
+            Replicator.addItem(repl);
+        }
 
         msg_->u.reply.type = ReplyType_DelProcessNs;
         msg_->u.reply.u.del_process_ns.nid = msg_->u.request.u.del_process_ns.target_nid;
@@ -172,10 +184,8 @@ void CExtDelProcessNsReq::performRequest()
         msg_->u.reply.u.del_process_ns.return_code = MPI_ERR_NAME;
         if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
            trace_printf("%s@%d - unsuccessful\n", method_name, __LINE__);
+        monreply(msg_, sockFd_);
     }
 
-    // Send reply to requester
-    monreply(msg_, sockFd_);
-
     TRACE_EXIT;
 }

http://git-wip-us.apache.org/repos/asf/trafodion/blob/251f3f57/core/sqf/monitor/linux/nsreqnewproc.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nsreqnewproc.cxx b/core/sqf/monitor/linux/nsreqnewproc.cxx
index 682823b..2231fc0 100644
--- a/core/sqf/monitor/linux/nsreqnewproc.cxx
+++ b/core/sqf/monitor/linux/nsreqnewproc.cxx
@@ -148,7 +148,7 @@ void CExtNewProcNsReq::performRequest()
             if (repl)
             {
                 // we will not reply at this time ... but wait for 
-                // node add to be processed in CIntNodeAddReq
+                // new process request to be processed in CIntCloneProcNsReq
     
                 // Retain reference to requester's request buffer so can
                 // send completion message.

http://git-wip-us.apache.org/repos/asf/trafodion/blob/251f3f57/core/sqf/monitor/linux/pnode.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnode.h b/core/sqf/monitor/linux/pnode.h
index eb4829e..b13fbef 100644
--- a/core/sqf/monitor/linux/pnode.h
+++ b/core/sqf/monitor/linux/pnode.h
@@ -270,12 +270,14 @@ public:
     inline bool  IsRankFailure( void ) { return( rankFailure_ ); }
     inline bool  IsSpareNode( void ) { return( spareNode_ ); }
     inline bool  IsSoftNodeDown( void ) { return( internalState_ == State_SoftDown ); }
+    inline bool  IsSoftNodeUp( void ) { return( internalState_ == State_SoftUp ); }
 
     CNode  *Link( CNode *entry );
     void    MoveLNodes( CNode *targetNode );
     inline void ResetSpareNode( void ) { spareNode_ = false; }
     void    ResetWatchdogTimer( void );
     inline void ResetSoftNodeDown( void ) { internalState_ = State_Default; }
+    inline void ResetSoftNodeUp( void ) { internalState_ = State_Default; }
     inline void SetActivatingSpare( int activatingSpare ) { activatingSpare_ = activatingSpare; }
     void    SetAffinity( int nid, pid_t pid, PROCESSTYPE type );
     void    SetAffinity( CProcess *process );
@@ -306,6 +308,7 @@ public:
     inline void SetNumCores( int numCores ) { numCores_ = numCores; }
     inline void SetPhase( NodePhase phase ) { phase_ = phase; }
     inline void SetSoftNodeDown( void ) { internalState_ = State_SoftDown; }
+    inline void SetSoftNodeUp( void ) { internalState_ = State_SoftUp; }
     inline void SetSparePNids( PNidVector &sparePNids ) { sparePNids_ = sparePNids; }
     inline void SetRank( int rank ) { rank_ = rank; }
     inline void SetRankFailure( bool failed ) { rankFailure_ = failed; 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/251f3f57/core/sqf/monitor/linux/process.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/process.cxx b/core/sqf/monitor/linux/process.cxx
index 34ec848..fce323c 100644
--- a/core/sqf/monitor/linux/process.cxx
+++ b/core/sqf/monitor/linux/process.cxx
@@ -2915,6 +2915,7 @@ struct message_def * CProcess::DeathMessage( )
 }
 #endif
 
+#ifndef NAMESERVER_PROCESS
 void CProcess::Exit( CProcess *parent )
 {
     char la_buf[MON_STRING_BUF_SIZE];
@@ -2922,12 +2923,10 @@ void CProcess::Exit( CProcess *parent )
     const char method_name[] = "CProcess::Exit";
     TRACE_ENTRY;
 
-#ifndef NAMESERVER_PROCESS
     if ( DumpState != Dump_Ready )
     {
         DumpEnd( Dump_Failed, (char *)corefile_.c_str() );
     }
-#endif
 
     if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
        trace_printf( "%s@%d" " - Process %s (%d,%d:%d) is exiting, parent process %s (%d,%d:%d)\n"
@@ -2952,7 +2951,6 @@ void CProcess::Exit( CProcess *parent )
                                         : !node->IsKillingNode();
     }
 
-#ifndef NAMESERVER_PROCESS
     if(  NoticeHead &&
         !MyNode->IsKillingNode() &&
         !(Type == ProcessType_DTM && IsAbended()) &&
@@ -2966,7 +2964,6 @@ void CProcess::Exit( CProcess *parent )
         // Notify all local registered processes of this process' death
         NoticeHead->NotifyAll();
     }
-#endif
 
     if ( !Clone && !Paired )
     {
@@ -2974,14 +2971,11 @@ void CProcess::Exit( CProcess *parent )
         {
             case ProcessType_TSE:
             case ProcessType_ASE:
-#ifndef NAMESERVER_PROCESS
                 MyNode->delFromQuiesceExitPids( GetPid(), GetVerifier() );
-#endif
 
                 if (trace_settings & (TRACE_SYNC_DETAIL | TRACE_PROCESS_DETAIL | TRACE_REQUEST_DETAIL))
                     trace_printf("%s%d: pid %d deleted from quiesce exit list\n", method_name, __LINE__, GetPid());
 
-#ifndef NAMESERVER_PROCESS
                 if (MyNode->isInQuiesceState())
                 {
                     if (MyNode->isQuiesceExitPidsEmpty())
@@ -2989,12 +2983,9 @@ void CProcess::Exit( CProcess *parent )
                         HealthCheck.setState(MON_SCHED_NODE_DOWN);  // schedule a node down req
                     }
                 }
-#endif
                 else
                 {   // unmount volumes only if node is not quiescing.
-#ifndef NAMESERVER_PROCESS
                     Devices->UnMountVolume( Name, Backup );
-#endif
                 }
                 break;
             case ProcessType_DTM:
@@ -3022,7 +3013,6 @@ void CProcess::Exit( CProcess *parent )
                     }
                     else
                     {
-#ifndef NAMESERVER_PROCESS
                         if ( Monitor->GetTmLeader() == MyPNID )
                         {
                             // set the clean shutdown condition
@@ -3032,7 +3022,6 @@ void CProcess::Exit( CProcess *parent )
                             strcpy(value,"True");
                             Config->GetClusterGroup()->Set( key, value );
                         }
-#endif
                     }
                 }
                 break;
@@ -3100,12 +3089,10 @@ void CProcess::Exit( CProcess *parent )
                                 trace_printf("%s@%d: Queueing death notice for SSMP process for %s (%d, %d:%d)\n",
                                              method_name, __LINE__, Name, Nid, Pid, Verifier);
 
-#ifndef NAMESERVER_PROCESS
                             ssmpProcess->ssmpNoticesLock_.lock();
                             ssmpProcess->ssmpNotices_.push_back( DeathMessage() );
                             ssmpProcess->ssmpNoticesLock_.unlock();
                             SQ_theLocalIOToClient->nudgeNotifier ();
-#endif
                         }
                         else
                         {
@@ -3146,15 +3133,14 @@ void CProcess::Exit( CProcess *parent )
         // Check if we need to output a entry into the process id map log file
         if ( PidMap )
         {
-#ifndef NAMESERVER_PROCESS
             Monitor->writeProcessMapEnd( Name, Nid, Pid, Verifier,
                                          parent ? parent->GetNid() : -1,
                                          parent ? parent->GetPid() : -1,
                                          parent ? parent->GetVerifier() : -1,
                                          program() );
-#endif
         }
     }
+
     if ( Clone && Pid != -1 )
     {
         if ( Type == ProcessType_SPX &&
@@ -3168,12 +3154,10 @@ void CProcess::Exit( CProcess *parent )
                 CProcess *spxProcess = lnode->GetProcessLByType( ProcessType_SPX );
                 if ( spxProcess && MyNode->GetState() == State_Up )
                 {
-#ifndef NAMESERVER_PROCESS
                     SQ_theLocalIOToClient->putOnNoticeQueue( spxProcess->Pid
                                                            , spxProcess->Verifier
                                                            , DeathMessage()
                                                            , NULL);
-#endif
 
                     if (trace_settings & (TRACE_SYNC_DETAIL | TRACE_REQUEST_DETAIL | TRACE_PROCESS_DETAIL))
                        trace_printf( "%s@%d" " - Sending death message of %s (%d,%d:%d) to %s (%d,%d:%d)\n"
@@ -3209,12 +3193,10 @@ void CProcess::Exit( CProcess *parent )
                 CProcess *tmProcess = lnode->GetProcessLByType( ProcessType_DTM );
                 if ( tmProcess && MyNode->GetState() == State_Up )
                 {
-#ifndef NAMESERVER_PROCESS
                     SQ_theLocalIOToClient->putOnNoticeQueue( tmProcess->Pid
                                                            , tmProcess->Verifier
                                                            , DeathMessage()
                                                            , NULL);
-#endif
 
                     if (trace_settings & (TRACE_SYNC_DETAIL | TRACE_REQUEST_DETAIL | TRACE_PROCESS_DETAIL))
                        trace_printf( "%s@%d" " - Sending death message of %s (%d,%d:%d) to %s (%d,%d:%d)\n"
@@ -3246,12 +3228,10 @@ void CProcess::Exit( CProcess *parent )
                parent->GetType()  == ProcessType_DTM) &&
              supplyProcessDeathNotices )
         {
-#ifndef NAMESERVER_PROCESS
             SQ_theLocalIOToClient->putOnNoticeQueue( parent->Pid
                                                    , parent->Verifier
                                                    , DeathMessage()
                                                    , NULL);
-#endif
 
             if (trace_settings & (TRACE_SYNC_DETAIL | TRACE_REQUEST_DETAIL | TRACE_PROCESS_DETAIL))
                trace_printf( "%s@%d" " - Sending death message of %s (%d,%d:%d) to %s (%d,%d:%d) \n"
@@ -3267,7 +3247,6 @@ void CProcess::Exit( CProcess *parent )
         }
     }
 
-#ifndef NAMESERVER_PROCESS
     if (NameServerEnabled)
     {
         if ( parent )
@@ -3304,10 +3283,10 @@ void CProcess::Exit( CProcess *parent )
         }
         procExitNotifierNodes();
     }
-#endif
 
     TRACE_EXIT;
 }
+#endif
 
 #ifndef NAMESERVER_PROCESS
 void CProcess::GenerateEvent( int event_id, int length, char *data )
@@ -5371,6 +5350,72 @@ void CProcessContainer::Exit_Process (CProcess *process, bool abend, int downNod
 }
 #endif
 
+#ifdef NAMESERVER_PROCESS
+void CProcessContainer::Exit_Process (CProcess *process, bool abend, int downNode)
+{
+    const char method_name[] = "CProcessContainer::Exit_Process(process)";
+    TRACE_ENTRY;
+
+    char la_buf[MON_STRING_BUF_SIZE];
+    CProcess *parent = NULL;
+
+    if (process)
+    {
+        if (trace_settings & (TRACE_SYNC_DETAIL | TRACE_REQUEST_DETAIL | TRACE_PROCESS_DETAIL))
+            trace_printf( "%s@%d - Process %s (abended=%d) is exiting, abend=%d, downNode=%d\n"
+                        , method_name, __LINE__
+                        , process->GetName()
+                        , process->IsAbended()
+                        , abend
+                        , downNode );
+
+        if ( process->GetState() == State_Down && abend && !process->IsAbended() )
+        {
+            process->SetAbended( abend );
+        }
+        if (process->GetNid() == downNode && !process->IsAbended() )
+        {
+            process->SetAbended( abend );
+        }
+
+        if ( numProcs_ <= 0 )
+        {
+            snprintf(la_buf, sizeof(la_buf),
+                     "[%s], Node's process count is invalid, aborting\n",
+                     method_name);
+            mon_log_write(MON_PROCESSCONT_EXITPROCESS_1, SQ_LOG_ERR, la_buf);
+            abort();
+        }
+
+        if ( process->GetState() == State_Stopped )
+        {
+            if (trace_settings & (TRACE_SYNC_DETAIL | TRACE_REQUEST_DETAIL | TRACE_PROCESS_DETAIL))
+                trace_printf("%s@%d" " - Process " "%s" " already exited." "\n", method_name, __LINE__, process->GetName());
+            return;
+        }
+
+        if ( parent == NULL)
+        {
+            parent = Nodes->GetProcess( process->GetParentNid(),
+                                        process->GetParentPid() );
+        }
+
+        // Handle the process termination
+        process->Switch( parent ); // switch process pair roles if needed
+        process->SetDeletePending ( true );
+
+        CNode *node;
+        node = Nodes->GetLNode(process->GetNid())->GetNode();
+        node->DelFromNameMap ( process );
+        node->DelFromPidMap ( process );
+        node->DeleteFromList( process );
+    }
+    TRACE_EXIT;
+
+    return;
+}
+#endif
+
 CProcess *CProcessContainer::GetProcess (int pid)
 {
     const char method_name[] = "CProcessContainer::GetProcess (pid)";
@@ -5822,7 +5867,7 @@ void CProcessContainer::KillAllDownSoft()
         }
 
         // valid for virtual cluster or soft node down only.
-        if ( type != ProcessType_DTM )
+        if ( type != ProcessType_DTM && type != ProcessType_NameServer )
         {
             // Delete pid map entry
             DelFromPidMap ( process );
@@ -5859,7 +5904,7 @@ void CProcessContainer::KillAllDownSoft()
         nextProc = process->GetNext();
 
         PROCESSTYPE type = process->GetType();
-        if ( type != ProcessType_DTM )
+        if ( type != ProcessType_DTM && type != ProcessType_NameServer )
         {
             // Delete pid map entry
             DelFromPidMap ( process );

http://git-wip-us.apache.org/repos/asf/trafodion/blob/251f3f57/core/sqf/monitor/linux/process.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/process.h b/core/sqf/monitor/linux/process.h
index 90954f3..f6f22cb 100644
--- a/core/sqf/monitor/linux/process.h
+++ b/core/sqf/monitor/linux/process.h
@@ -127,9 +127,9 @@ class CProcessContainer
                              );
     bool Dump_Process( CProcess *dumper, CProcess *process, char *core_path );
     void DumpCallback( int nid, pid_t pid, int status );
+    void Exit_Process( CProcess *process, bool abend, int downNode );
 #ifndef NAMESERVER_PROCESS
     static CProcess *ParentNewProcReply ( CProcess *process, int result );
-    void Exit_Process( CProcess *process, bool abend, int downNode );
 #else
     static CProcess *MonReply ( CProcess *process, int result );
 #endif

http://git-wip-us.apache.org/repos/asf/trafodion/blob/251f3f57/core/sqf/monitor/linux/replicate.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/replicate.cxx b/core/sqf/monitor/linux/replicate.cxx
index c22c799..0b6fadb 100644
--- a/core/sqf/monitor/linux/replicate.cxx
+++ b/core/sqf/monitor/linux/replicate.cxx
@@ -91,7 +91,7 @@ int CReplObj::calcAllocSize()
                                                 sizeof(CReplExit)),
                                             sizeof(CReplKill)),
 #ifdef NAMESERVER_PROCESS
-                                        sizeof(dummy_sizeof_def)),
+                                        sizeof(CReplExitNs)),
 #else
                                         sizeof(CReplDevice)),
 #endif
@@ -929,6 +929,80 @@ bool CReplExit::replicate(struct internal_msg_def *&msg)
     return true;
 }
 
+CReplExitNs::CReplExitNs( int nid
+                        , int pid
+                        , Verifier_t verifier
+                        , const char *name
+                        , bool abended
+                        , struct message_def *msg
+                        , int  sockFd
+                        , int  origPNid )
+            : nid_(nid)
+            , pid_(pid)
+            , verifier_(verifier)
+            , abended_(abended)
+            , msg_(msg)
+            , sockFd_(sockFd)
+            , origPNid_(origPNid)
+{
+    // Add eyecatcher sequence as a debugging aid
+    memcpy(&eyecatcher_, "RPLJ", 4);
+
+    strcpy(name_, name);
+
+    // Compute message size (adjust if needed to conform to
+    // internal_msg_def structure alignment).
+    replSize_ = (MSG_HDR_SIZE + sizeof ( exit_ns_def ) + msgAlignment_)
+                & ~msgAlignment_;
+
+    if (trace_settings & (TRACE_SYNC_DETAIL | TRACE_PROCESS_DETAIL))
+    {
+        const char method_name[] = "CReplExitNs::CReplExitNs";
+        trace_printf( "%s@%d  - Queuing replicating process exit %s (%d, %d:%d),"
+                      " abended=%d, msg=%p, sockFd=%d, origPNid=%d\n"
+                    , method_name, __LINE__
+                    , name_, nid_, pid_, verifier_, abended_
+                    , msg_, sockFd_, origPNid_ );
+    }
+}
+
+CReplExitNs::~CReplExitNs()
+{
+    // Alter eyecatcher sequence as a debugging aid to identify deleted object
+    memcpy(&eyecatcher_, "rplj", 4);
+}
+
+
+bool CReplExitNs::replicate(struct internal_msg_def *&msg)
+{
+    const char method_name[] = "CReplExitNs::replicate";
+    TRACE_ENTRY;
+
+    if (trace_settings & (TRACE_SYNC | TRACE_PROCESS))
+        trace_printf("%s@%d" " - Replicating process exit %s (%d, %d:%d),"
+                     " abended=%d\n", method_name, __LINE__,
+                     name_, nid_, pid_, verifier_, abended_);
+
+    // Build message to replicate this process exit to other nodes
+    msg->type = InternalType_Exit;
+    msg->u.exit_ns.nid = nid_;
+    msg->u.exit_ns.pid = pid_;
+    msg->u.exit_ns.verifier = verifier_;
+    strcpy(msg->u.exit_ns.name, name_);
+    msg->u.exit_ns.abended = abended_;
+    msg->u.exit_ns.msg = msg_;
+    msg->u.exit_ns.sockFd = sockFd_;
+    msg->u.exit_ns.origPNid = origPNid_;
+
+    // Advance sync buffer pointer
+    Nodes->AddMsg( msg, replSize() );
+
+    TRACE_EXIT;
+
+    return true;
+}
+
+
 CReplKill::CReplKill( int nid
                     , int pid
                     , Verifier_t verifier

http://git-wip-us.apache.org/repos/asf/trafodion/blob/251f3f57/core/sqf/monitor/linux/replicate.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/replicate.h b/core/sqf/monitor/linux/replicate.h
index 966c69e..5d4a7cc 100644
--- a/core/sqf/monitor/linux/replicate.h
+++ b/core/sqf/monitor/linux/replicate.h
@@ -210,6 +210,32 @@ private:
     bool abended_;
 };
 
+class CReplExitNs: public CReplObj
+{
+public:
+    CReplExitNs( int nid
+               , int pid
+               , Verifier_t verifier
+               , const char *name
+               , bool abended
+               , struct message_def *msg
+               , int  sockFd
+               , int  origPNid );
+    virtual ~CReplExitNs();
+
+    bool replicate(struct internal_msg_def *& msg);
+
+private:
+    int nid_;
+    int pid_;
+    Verifier_t verifier_;
+    char name_[MAX_PROCESS_NAME];
+    bool abended_;
+    struct message_def *msg_;
+    int  sockFd_;
+    int  origPNid_;
+};
+
 class CReplKill: public CReplObj
 {
 public:

http://git-wip-us.apache.org/repos/asf/trafodion/blob/251f3f57/core/sqf/monitor/linux/reqqueue.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqqueue.cxx b/core/sqf/monitor/linux/reqqueue.cxx
index 530b096..6825652 100644
--- a/core/sqf/monitor/linux/reqqueue.cxx
+++ b/core/sqf/monitor/linux/reqqueue.cxx
@@ -1017,6 +1017,7 @@ void CIntDeviceReq::performRequest()
 }
 #endif
 
+#ifndef NAMESERVER_PROCESS
 CIntExitReq::CIntExitReq( )
             : CInternalReq()
             , nid_(0)
@@ -1101,12 +1102,136 @@ void CIntExitReq::performRequest()
         {
             lnode->GetNode()->DelFromNameMap ( process );
             lnode->GetNode()->DelFromPidMap ( process );
+            lnode->GetNode()->Exit_Process (process, abended_, -1);
+        }
+    }
+    else
+    {
+        char buf[MON_STRING_BUF_SIZE];
+        sprintf(buf, "[%s], Can't find process %s (%d, %d) for processing "
+                "exit.\n", method_name, name_, nid_, pid_);
+        mon_log_write(MON_CLUSTER_HANDLEOTHERNODE_5, SQ_LOG_ERR, buf);
+    }
 
-#ifdef NAMESERVER_PROCESS
-            lnode->GetNode()->DeleteFromList( process );
+    TRACE_EXIT;
+}
 #else
-            lnode->GetNode()->Exit_Process (process, abended_, -1);
-#endif
+CIntExitNsReq::CIntExitNsReq( )
+              : CInternalReq()
+              , nid_(0)
+              , pid_(0)
+              , verifier_(-1)
+{
+    // Add eyecatcher sequence as a debugging aid
+    memcpy(&eyecatcher_, "RQIE", 4);
+
+    name_[0] = '\0';
+}
+
+CIntExitNsReq::~CIntExitNsReq( )
+{
+    // Alter eyecatcher sequence as a debugging aid to identify deleted object
+    memcpy(&eyecatcher_, "rqie", 4);
+}
+
+void CIntExitNsReq::populateRequestString( void )
+{
+    char strBuf[MON_STRING_BUF_SIZE/2];
+    sprintf( strBuf, "IntReq(%s) req #=%ld (name=%s/nid=%d/pid=%d/verifier=%d)"
+                     "(msg=%p, sockFd=%d, origPNid=%d)"
+                   , CReqQueue::intReqType[InternalType_Exit]
+                   , getId(), name_, nid_, pid_, verifier_
+                   , msg_, sockFd_, origPNid_ );
+    requestString_.assign( strBuf );
+}
+
+void CIntExitNsReq::prepRequest( struct exit_ns_def *exitDef )
+{
+    const char method_name[] = "CIntExitNsReq::prepRequest";
+    TRACE_ENTRY;
+
+    nid_ = exitDef->nid;
+    pid_ = exitDef->pid;
+    verifier_ = exitDef->verifier;
+    strcpy( name_, exitDef->name );
+    abended_ = exitDef->abended;
+    msg_ = exitDef->msg;
+    sockFd_ = exitDef->sockFd;
+    origPNid_ = exitDef->origPNid;
+
+    TRACE_EXIT;
+}
+
+void CIntExitNsReq::performRequest()
+{
+    const char method_name[] = "CIntExitReq::performRequest";
+    TRACE_ENTRY;
+
+    CProcess *process = NULL;
+    CLNode  *lnode;
+
+    // Check if this name server is handling monitor request
+    // from CExtDelProcessNsReq::performRequest()
+    if (origPNid_ == MyPNID)
+    {
+        msg_->noreply = false;
+        msg_->u.reply.type = ReplyType_DelProcessNs;
+        msg_->u.reply.u.del_process_ns.nid = nid_;
+        msg_->u.reply.u.del_process_ns.pid = pid_;
+        msg_->u.reply.u.del_process_ns.verifier = verifier_;
+        strncpy(msg_->u.reply.u.del_process_ns.process_name, name_, MAX_PROCESS_NAME);
+        msg_->u.reply.u.del_process_ns.return_code = MPI_SUCCESS;
+
+        if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+        {
+           trace_printf("%s@%d - Replying to monitor sockFd_=%d, msg_=%p, deleted %s (%d, %d:%d)\n",
+                        method_name, __LINE__,
+                        sockFd_,
+                        msg_,
+                        name_,
+                        nid_,
+                        pid_,
+                        verifier_ );
+        }
+
+        // Send reply to requesting monitor
+        monreply( msg_, sockFd_ );
+        return;
+    }
+
+    lnode = Nodes->GetLNode( nid_ );
+    if ( lnode )
+    {
+        process = lnode->GetNode()->GetProcess( pid_ );
+
+        if ( ! process )
+        {
+            // Could not locate process by process id.  If the exit
+            // occurred due to an early process termination on another
+            // node we won't have the process id.  Try the look up by
+            // name instead.
+            process = lnode->GetNode()->GetProcess( name_, false );
+        }
+    }
+
+    if ( process )
+    {
+        if ( (verifier_ != -1) && (verifier_ != process->GetVerifier()) )
+        {
+            if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+            {
+               trace_printf("%s@%d - Exit %s (%d, %d:%d) failed -- verifier mismatch (%d)\n",
+                            method_name, __LINE__,
+                            name_,
+                            nid_,
+                            pid_,
+                            verifier_,
+                            process->GetVerifier());
+            }
+        }
+        else
+        {
+            lnode->GetNode()->Exit_Process( process, abended_, -1 );
         }
     }
     else
@@ -1119,6 +1244,7 @@ void CIntExitReq::performRequest()
 
     TRACE_EXIT;
 }
+#endif
 
 #ifndef NAMESERVER_PROCESS
 CIntKillReq::CIntKillReq( struct kill_def *killDef )
@@ -3583,10 +3709,17 @@ void CIntCreatePrimitiveReq::performRequest()
             {
                 startNs = true;
             }
-            if ( startNs )
+            if ( !MyNode->IsSoftNodeUp() )
+            {  // Don't restart the name server on a soft node up
+                if ( startNs )
+                {
+                    NameServer->SetLocalHost();
+                    MyNode->StartNameServerProcess();
+                }
+            }
+            else
             {
-                NameServer->SetLocalHost();
-                MyNode->StartNameServerProcess();
+                MyNode->ResetSoftNodeUp();
             }
         }
         MyNode->StartWatchdogProcess();
@@ -4246,6 +4379,7 @@ void CReqQueue::enqueueUpReq( int pnid, char *node_name, int merge_lead )
     enqueueReq ( request );
 }
 
+#ifndef NAMESERVER_PROCESS
 void CReqQueue::enqueueExitReq( struct exit_def *exitDef )
 {
     CIntExitReq * request;
@@ -4255,6 +4389,17 @@ void CReqQueue::enqueueExitReq( struct exit_def *exitDef )
 
     enqueueReq ( request );
 }
+#else
+void CReqQueue::enqueueExitNsReq( struct exit_ns_def *exitDef )
+{
+    CIntExitNsReq * request;
+
+    request = new CIntExitNsReq ( );
+    request->prepRequest( exitDef );
+
+    enqueueReq ( request );
+}
+#endif
 
 #ifndef NAMESERVER_PROCESS
 //void CReqQueue::enqueueKillReq( int nid, int pid, bool abort )

http://git-wip-us.apache.org/repos/asf/trafodion/blob/251f3f57/core/sqf/monitor/linux/reqqueue.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqqueue.h b/core/sqf/monitor/linux/reqqueue.h
index 7fa69fd..995912d 100644
--- a/core/sqf/monitor/linux/reqqueue.h
+++ b/core/sqf/monitor/linux/reqqueue.h
@@ -926,6 +926,7 @@ private:
 };
 #endif
 
+#ifndef NAMESERVER_PROCESS
 class CIntExitReq: public CInternalReq
 {
 public:
@@ -944,6 +945,31 @@ private:
     bool abended_;
     char name_[MAX_PROCESS_NAME];
 };
+#endif
+
+#ifdef NAMESERVER_PROCESS
+class CIntExitNsReq: public CInternalReq
+{
+public:
+    CIntExitNsReq();
+    virtual ~CIntExitNsReq();
+
+    void prepRequest( struct exit_ns_def *exitDef );
+    void performRequest();
+
+private:
+    void populateRequestString( void );
+
+    int nid_;
+    int pid_;
+    Verifier_t verifier_;
+    bool abended_;
+    char name_[MAX_PROCESS_NAME];
+    struct message_def *msg_;
+    int  sockFd_;
+    int  origPNid_;
+};
+#endif
 
 #ifdef NAMESERVER_PROCESS
 class CExtDelProcessNsReq: public CExternalReq
@@ -1471,7 +1497,11 @@ class CReqQueue
 #ifndef NAMESERVER_PROCESS
     void enqueueDeviceReq( char *ldevName );
 #endif
+#ifndef NAMESERVER_PROCESS
     void enqueueExitReq( struct exit_def *exitDef );
+#else
+    void enqueueExitNsReq( struct exit_ns_def *exitDef );
+#endif
 #ifdef NAMESERVER_PROCESS
     void enqueueDeleteReq( struct delete_def *deleteDef );
 #endif

http://git-wip-us.apache.org/repos/asf/trafodion/blob/251f3f57/core/sqf/monitor/test/monitor.env
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/test/monitor.env b/core/sqf/monitor/test/monitor.env
index 303dbf3..52e2341 100644
--- a/core/sqf/monitor/test/monitor.env
+++ b/core/sqf/monitor/test/monitor.env
@@ -54,7 +54,7 @@ MON_TRACE_NS=1
 #MON_TRACE_MLIO=1
 
 #MON_TRACE_REQUEST_DETAIL=1
-#MON_TRACE_PROCESS_DETAIL=1
+MON_TRACE_PROCESS_DETAIL=1
 #MON_TRACE_NOTICE_DETAIL=1
 #MON_TRACE_SYNC_DETAIL=1
 #MON_TRACE_MLIO_DETAIL=1


[06/50] [abbrv] trafodion git commit: Preliminary monitor p-2-p communication changes.

Posted by su...@apache.org.
Preliminary monitor p-2-p communication changes.


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

Branch: refs/heads/master
Commit: abf3c4291d0f54dc893925151b631fd06aab0883
Parents: 975b0f4
Author: Zalo Correa <za...@esgyn.com>
Authored: Wed Mar 28 17:02:34 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Wed Mar 28 17:02:34 2018 -0700

----------------------------------------------------------------------
 core/sqf/conf/log4cxx.monitor.trafns.config     |   2 +-
 .../export/include/common/evl_sqlog_eventnum.h  |  24 +
 core/sqf/export/include/trafconf/trafconfig.h   |   2 +-
 core/sqf/monitor/linux/cluster.cxx              | 146 ++--
 core/sqf/monitor/linux/internal.h               |  22 +-
 core/sqf/monitor/linux/makefile                 |   1 +
 core/sqf/monitor/linux/mlio.cxx                 |  10 +-
 core/sqf/monitor/linux/monitor.cxx              |  38 +-
 core/sqf/monitor/linux/montrace.cxx             |   4 +-
 core/sqf/monitor/linux/msgdef.h                 |  41 +-
 core/sqf/monitor/linux/nameserver.cxx           |  93 ++-
 core/sqf/monitor/linux/nameserver.h             |   1 +
 core/sqf/monitor/linux/notice.cxx               | 155 +++-
 core/sqf/monitor/linux/notice.h                 |   5 +
 core/sqf/monitor/linux/nscommacceptmon.cxx      |  95 ++-
 core/sqf/monitor/linux/nscommacceptmon.h        |   1 +
 core/sqf/monitor/linux/nsprocess.cxx            |  12 +-
 core/sqf/monitor/linux/nsreqnewproc.cxx         |  65 +-
 core/sqf/monitor/linux/nsreqprocinfons.cxx      | 206 +++++
 core/sqf/monitor/linux/nsreqqueue.cxx           |  10 +
 core/sqf/monitor/linux/pnode.cxx                | 149 ++++
 core/sqf/monitor/linux/pnode.h                  |   6 +
 core/sqf/monitor/linux/process.cxx              | 243 ++++--
 core/sqf/monitor/linux/process.h                |  16 +-
 core/sqf/monitor/linux/ptpclient.cxx            | 717 ++++++++++++-----
 core/sqf/monitor/linux/ptpclient.h              |  40 +-
 core/sqf/monitor/linux/ptpcommaccept.cxx        | 265 ++-----
 core/sqf/monitor/linux/ptpcommaccept.h          |   2 -
 core/sqf/monitor/linux/replicate.cxx            |  30 +-
 core/sqf/monitor/linux/reqkill.cxx              |  26 +-
 core/sqf/monitor/linux/reqnewproc.cxx           |  28 +-
 core/sqf/monitor/linux/reqnotify.cxx            | 155 +++-
 core/sqf/monitor/linux/reqopen.cxx              |  74 +-
 core/sqf/monitor/linux/reqprocinfo.cxx          |  28 +-
 core/sqf/monitor/linux/reqqueue.cxx             | 775 +++++++++++++++----
 core/sqf/monitor/linux/reqqueue.h               |  84 ++
 core/sqf/monitor/test/childExitChild.cxx        |   1 +
 core/sqf/monitor/test/childExitParent.cxx       |   1 +
 core/sqf/monitor/test/montestutil.cxx           |   4 +-
 core/sqf/monitor/test/runtest                   | 242 ++++--
 core/sqf/monitor/test/sqconfig.monitor.virtual  |   3 +-
 core/sqf/sqenvcom.sh                            |  16 +-
 core/sqf/sql/scripts/monitor.env                |  19 +-
 core/sqf/sql/scripts/pstat                      |   2 +-
 core/sqf/sql/scripts/sqconfig                   |   4 +
 core/sqf/src/trafconf/trafconf.cpp              | 152 +++-
 core/sqf/src/trafconf/trafconfig.h              |   0
 47 files changed, 3127 insertions(+), 888 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/conf/log4cxx.monitor.trafns.config
----------------------------------------------------------------------
diff --git a/core/sqf/conf/log4cxx.monitor.trafns.config b/core/sqf/conf/log4cxx.monitor.trafns.config
index 40091cb..2fd23e8 100644
--- a/core/sqf/conf/log4cxx.monitor.trafns.config
+++ b/core/sqf/conf/log4cxx.monitor.trafns.config
@@ -31,7 +31,7 @@ log4j.threshhold=ALL
 # Rolling File Appender
 #
 log4j.appender.trafnsAppender=org.apache.log4j.RollingFileAppender
-log4j.appender.trafnsAppender.file=${trafodion.log.dir}/ns${trafodion.log.filename.suffix}
+log4j.appender.trafnsAppender.file=${trafodion.log.dir}/trafns${trafodion.log.filename.suffix}
 log4j.appender.trafnsAppender.maxFileSize=100000000
 log4j.appender.trafnsAppender.maxBackupIndex=1
 log4j.appender.trafnsAppender.addPid=false

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/export/include/common/evl_sqlog_eventnum.h
----------------------------------------------------------------------
diff --git a/core/sqf/export/include/common/evl_sqlog_eventnum.h b/core/sqf/export/include/common/evl_sqlog_eventnum.h
index 8b331ff..e9186e1 100644
--- a/core/sqf/export/include/common/evl_sqlog_eventnum.h
+++ b/core/sqf/export/include/common/evl_sqlog_eventnum.h
@@ -214,6 +214,8 @@
 #define MON_CLUSTER_INITSERVERSOCK_3        101014203
 #define MON_CLUSTER_INITSERVERSOCK_4        101014204
 #define MON_CLUSTER_INITSERVERSOCK_5        101014205
+#define MON_CLUSTER_INITSERVERSOCK_6        101014206
+#define MON_CLUSTER_INITSERVERSOCK_7        101014207
 
 #define MON_CLUSTER_SOFTNODEDOWN_1          101014301
 #define MON_CLUSTER_SOFTNODEDOWN_2          101014302
@@ -435,6 +437,10 @@
 #define MON_NODE_ADDLNODES_4                101041204
 #define MON_NODE_DELETENODE_1               101041301
 #define MON_NODE_STARTNAMESERVER_1          101041401
+#define MON_NODE_GETPROCESSNS_1             101041501
+#define MON_NODE_GETPROCESSNS_2             101041502
+#define MON_NODE_GETPROCESSNS_3             101041503
+#define MON_NODE_GETPROCESSNS_4             101041504
 
 /* Module: config.cxx = 05 */
 
@@ -687,6 +693,8 @@
 #define MON_REQQUEUE_SNAPSHOT_11            101180411
 #define MON_REQQUEUE_SNAPSHOT_12            101180412
 #define MON_REQQUEUE_SNAPSHOT_13            101180413
+#define MON_REQQUEUE_SNAPSHOT_14            101180414
+#define MON_REQQUEUE_SNAPSHOT_15            101180415
 #define MON_REQQUEUE_REVIVE_1               101180501
 #define MON_REQQUEUE_REVIVE_2               101180502
 #define MON_REQQUEUE_REVIVE_3               101180503
@@ -717,6 +725,16 @@
 #define MON_REQ_NAMESERVER_DELETE_4         101181204
 #define MON_REQ_NAMESERVER_INFO_1           101181301
 
+#define MON_REQ_EVALREQ_PERFORMANCE_1       101181501
+#define MON_INTREQ_CLONEPROC_1              101181601
+#define MON_INTREQ_EXIT_1                   101181701
+#define MON_INTREQ_NEWPROC_1                101181801
+#define MON_INTREQ_NOTIFY_1                 101181901
+#define MON_INTREQ_NOTIFY_2                 101181902
+#define MON_INTREQ_NOTIFY_3                 101181903
+#define MON_INTREQ_NOTIFY_4                 101181904
+#define MON_INTREQ_OPEN_1                   101182001
+
 /* Module: clio.cxx = 19 */
 #define MON_CLIO_ACQUIRE_MSG_1              101190101
 #define MON_CLIO_ACQUIRE_LOCK_1             101190201
@@ -975,6 +993,10 @@
 /* Module: reqnodedown.cxx = 41 */
 #define MON_EXT_NAMESERVERDOWN_REQ          101410101
 
+/* Module: nsreqnewproc.cxx = 42 */
+#define NS_EXTNEWPROCNSREQ_1                101420101
+#define NS_EXTNEWPROCNSREQ_2                101420102
+
 /* Module: tcdb.cxx = 90 */
 #define TCDB_TCDB_1                         101900101
 #define TCDB_TCDB_2                         101900102
@@ -994,6 +1016,8 @@
 /* Module: tcdbsqlite.cxx = 92 */
 #define SQLITE_DB_ACCESS_ERROR              101920101
 
+/* Module ptpclient.cxx = 93 */
+#define PTPCLIENT_PTPCLIENT_1               101930101
 
 /**********************************************/
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/export/include/trafconf/trafconfig.h
----------------------------------------------------------------------
diff --git a/core/sqf/export/include/trafconf/trafconfig.h b/core/sqf/export/include/trafconf/trafconfig.h
index 65f5e3c..d68a8d0 100644
--- a/core/sqf/export/include/trafconf/trafconfig.h
+++ b/core/sqf/export/include/trafconf/trafconfig.h
@@ -50,7 +50,7 @@
 #define TC_PERSIST_KEY_MAX              64
 #define TC_PERSIST_VALUE_MAX          4096
 #define TC_PERSIST_KEYS_VALUE_MAX     4096
-#define TC_NODES_MAX                   256
+#define TC_NODES_MAX                  1024
 #define TC_SPARE_NODES_MAX             256
 #define TC_UNIQUE_STRING_VALUE_MAX    4096
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/cluster.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/cluster.cxx b/core/sqf/monitor/linux/cluster.cxx
index 480c509..101cec2 100644
--- a/core/sqf/monitor/linux/cluster.cxx
+++ b/core/sqf/monitor/linux/cluster.cxx
@@ -64,6 +64,9 @@ using namespace std;
 #include "zclient.h"
 #include "commaccept.h"
 #include "meas.h"
+#ifdef NAMESERVER_PROCESS
+#include "nscommacceptmon.h"
+#endif
 
 extern bool IAmIntegrating;
 extern bool IAmIntegrated;
@@ -79,8 +82,10 @@ extern char MyCommPort[MPI_MAX_PORT_NAME];
 extern char MyMPICommPort[MPI_MAX_PORT_NAME];
 extern char MySyncPort[MPI_MAX_PORT_NAME];
 #ifdef NAMESERVER_PROCESS
+extern CCommAcceptMon CommAcceptMon;
 extern char MyMon2NsPort[MPI_MAX_PORT_NAME];
 #else
+extern bool NameServerEnabled;
 extern char MyMon2MonPort[MPI_MAX_PORT_NAME];
 #endif
 extern bool SMSIntegrating;
@@ -250,6 +255,8 @@ void CCluster::ActivateSpare( CNode *spareNode, CNode *downNode, bool checkHealt
                     lnode->PrepareForTransactions( downNode->GetPNid() != spareNode->GetPNid() );
                 }
             }
+#else
+            ResetIntegratingPNid();
 #endif
         }
 
@@ -2714,8 +2721,18 @@ void CCluster::HandleMyNodeMsg (struct internal_msg_def *recv_msg,
         break;
 
     case InternalType_Clone:
+#ifndef NAMESERVER_PROCESS
         if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
             trace_printf("%s@%d - Internal clone request, completed replicating process (%d, %d) %s\n", method_name, __LINE__, recv_msg->u.clone.nid, recv_msg->u.clone.os_pid, (recv_msg->u.clone.backup?" Backup":""));
+#else        
+        if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
+            trace_printf("%s@%d - Internal clone request, process (%d, %d)"
+                         " %s\n", method_name, __LINE__,
+                         recv_msg->u.clone.nid, recv_msg->u.clone.os_pid,
+                         (recv_msg->u.clone.backup?" Backup":""));
+
+        ReqQueue.enqueueCloneReq( &recv_msg->u.clone );
+#endif
         break;
 
 #ifndef NAMESERVER_PROCESS
@@ -4692,6 +4709,20 @@ void CCluster::ResetIntegratingPNid( void )
 
     integratingPNid_ = -1;
 
+#ifdef NAMESERVER_PROCESS
+    if (!CommAcceptMon.isAccepting())
+    {
+        if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+        {
+            trace_printf( "%s@%d - Triggering commAcceptorMon thread to begin accepting connections\n",
+                          method_name, __LINE__ );
+        }
+
+        // Indicate to the commAcceptor thread to begin accepting connections
+        CommAcceptMon.startAccepting();
+    }
+#endif
+
     if (!CommAccept.isAccepting())
     {
         if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
@@ -8325,7 +8356,11 @@ void CCluster::InitServerSock( void )
         char ebuff[256];
         char buf[MON_STRING_BUF_SIZE];
         snprintf( buf, sizeof(buf)
+#ifdef NAMESERVER_PROCESS
+                , "[%s@%d] MkSrvSock(NS_COMM_PORT=%d) error: %s\n"
+#else
                 , "[%s@%d] MkSrvSock(MONITOR_COMM_PORT=%d) error: %s\n"
+#endif
                 , method_name, __LINE__, serverCommPort
                 , strerror_r( errno, ebuff, 256 ) );
         mon_log_write( MON_CLUSTER_INITSERVERSOCK_2, SQ_LOG_CRIT, buf );
@@ -8373,7 +8408,11 @@ void CCluster::InitServerSock( void )
         char ebuff[256];
         char buf[MON_STRING_BUF_SIZE];
         snprintf( buf, sizeof(buf)
+#ifdef NAMESERVER_PROCESS
+                , "[%s@%d] MkSrvSock(NS_SYNC_PORT=%d) error: %s\n"
+#else
                 , "[%s@%d] MkSrvSock(MONITOR_SYNC_PORT=%d) error: %s\n"
+#endif
                 , method_name, __LINE__, serverSyncPort
                 , strerror_r( errno, ebuff, 256 ) );
         mon_log_write( MON_CLUSTER_INITSERVERSOCK_3, SQ_LOG_CRIT, buf );
@@ -8443,56 +8482,63 @@ void CCluster::InitServerSock( void )
 
     }
 #else
-    env = getenv("MONITOR_COMM_PORT");
-    if ( env )
-    {
-        int val;
-        errno = 0;
-        val = strtol(env, NULL, 10);
-        if ( errno == 0) mon2monPort = val;
-    }
-    else
-    {
-       mon2monPort = 23399;
-    }
-
-    // For virtual env, add PNid to the port so we can still test without collisions of port numbers
-    if (!IsRealCluster)
+    if (NameServerEnabled)
     {
-        mon2monPort += MyNode->GetPNid();
-    }
-    mon2monSock_ = MkSrvSock( &mon2monPort );
-
-
-    if ( mon2monSock_ < 0 )
-    {
-        char ebuff[256];
-        char buf[MON_STRING_BUF_SIZE];
-        snprintf( buf, sizeof(buf)
-                , "[%s@%d] MkSrvSock(MON2MONSERVER_COMM_PORT=%d) error: %s\n"
-                , method_name, __LINE__, mon2monPort
-                , strerror_r( errno, ebuff, 256 ) );
-        mon_log_write( MON_CLUSTER_INITSERVERSOCK_4, SQ_LOG_CRIT, buf );
-        abort();
-    }
-    else
-    {
-        snprintf( MyMon2MonPort, sizeof(MyMon2MonPort)
-                , "%d.%d.%d.%d:%d"
-                , (int)((unsigned char *)addr)[0]
-                , (int)((unsigned char *)addr)[1]
-                , (int)((unsigned char *)addr)[2]
-                , (int)((unsigned char *)addr)[3]
-                , mon2monPort );
-        MyNode->SetMon2MonPort( MyMon2MonPort );
-
-        if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
-            trace_printf( "%s@%d Initialized my mon2mon socket port, "
-                          "pnid=%d (%s:%s) (mon2monPort=%s)\n"
-                        , method_name, __LINE__
-                        , MyPNID, MyNode->GetName(), MyMon2MonPort
-                        , MyNode->GetMon2MonPort() );
-
+        env = getenv("MON2MON_COMM_PORT");
+        if ( env )
+        {
+            int val;
+            errno = 0;
+            val = strtol(env, NULL, 10);
+            if ( errno == 0) mon2monPort = val;
+        }
+        else
+        {
+           char buf[MON_STRING_BUF_SIZE];
+           snprintf( buf, sizeof(buf)
+                   , "[%s@%d] MON2MON_COMM_PORT environment variable is not set!\n"
+                   , method_name, __LINE__ );
+           mon_log_write( MON_CLUSTER_INITSERVERSOCK_5, SQ_LOG_CRIT, buf );
+           abort();
+        }
+    
+        // For virtual env, add PNid to the port so we can still test without collisions of port numbers
+        if (!IsRealCluster)
+        {
+            mon2monPort += MyNode->GetPNid();
+        }
+    
+        mon2monSock_ = MkSrvSock( &mon2monPort );
+        if ( mon2monSock_ < 0 )
+        {
+            char ebuff[MON_STRING_BUF_SIZE];
+            char buf[MON_STRING_BUF_SIZE];
+            snprintf( buf, sizeof(buf)
+                    , "[%s@%d] MkSrvSock(MON2MON_COMM_PORT=%d) error: %s\n"
+                    , method_name, __LINE__, mon2monPort
+                    , strerror_r( errno, ebuff, MON_STRING_BUF_SIZE ) );
+            mon_log_write( MON_CLUSTER_INITSERVERSOCK_6, SQ_LOG_CRIT, buf );
+            abort();
+        }
+        else
+        {
+            snprintf( MyMon2MonPort, sizeof(MyMon2MonPort)
+                    , "%d.%d.%d.%d:%d"
+                    , (int)((unsigned char *)addr)[0]
+                    , (int)((unsigned char *)addr)[1]
+                    , (int)((unsigned char *)addr)[2]
+                    , (int)((unsigned char *)addr)[3]
+                    , mon2monPort );
+            MyNode->SetMon2MonPort( MyMon2MonPort );
+    
+            if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+                trace_printf( "%s@%d Initialized my mon2mon socket port, "
+                              "pnid=%d (%s:%s) (mon2monPort=%s)\n"
+                            , method_name, __LINE__
+                            , MyPNID, MyNode->GetName(), MyMon2MonPort
+                            , MyNode->GetMon2MonPort() );
+    
+        }
     }
 #endif
 
@@ -8503,7 +8549,7 @@ void CCluster::InitServerSock( void )
         char buf[MON_STRING_BUF_SIZE];
         snprintf( buf, sizeof(buf), "[%s@%d] epoll_create1() error: %s\n",
             method_name, __LINE__, strerror_r( errno, ebuff, 256 ) );
-        mon_log_write( MON_CLUSTER_INITSERVERSOCK_4, SQ_LOG_CRIT, buf );
+        mon_log_write( MON_CLUSTER_INITSERVERSOCK_7, SQ_LOG_CRIT, buf );
         MPI_Abort( MPI_COMM_SELF,99 );
     }
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/internal.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/internal.h b/core/sqf/monitor/linux/internal.h
index fab37da..505e1c3 100644
--- a/core/sqf/monitor/linux/internal.h
+++ b/core/sqf/monitor/linux/internal.h
@@ -284,12 +284,14 @@ struct node_name_def
 
 struct notify_def
 {
-    int nid;            // Node id of process being notified
-    int pid;            // Process id of process being notified
-    int canceled;                   // If true,  notice request has been canceled
-    int target_nid;         // Node id of process being monitored
-    int target_pid;         // Process id of process being monitored
-    _TM_Txid_External trans_id;             // Associated TransID
+    int nid;                    // Node id of process being notified
+    int pid;                    // Process id of process being notified
+    Verifier_t verifier;        // Verifier of the requesting process
+    int canceled;               // If true,  notice request has been canceled
+    int target_nid;             // Node id of process being monitored
+    int target_pid;             // Process id of process being monitored
+    Verifier_t target_verifier; // Verifier of the requesting process
+    _TM_Txid_External trans_id; // Associated TransID
 };
 
 
@@ -417,6 +419,9 @@ struct uniqstr_def
     char valueData;       // variable length string data
 };
 
+// Define a constant giving the "header" size of the internal_msg_def below
+#define MSG_HDR_SIZE  ( sizeof (InternalType) + sizeof (int) )
+
 struct internal_msg_def
 {
     InternalType type;
@@ -450,13 +455,10 @@ struct internal_msg_def
         struct uniqstr_def uniqstr;
         struct shutdown_def shutdown;
         struct scheddata_def scheddata;
+        char   buffer[MAX_SYNC_SIZE-MSG_HDR_SIZE];  // Limit entire buffer to MAX_SYNC_SIZE
     } u;
 } __attribute__((__may_alias__));
 
-// Define a constant giving the "header" size of the internal_msg_def above
-#define MSG_HDR_SIZE  ( sizeof (InternalType) + sizeof (int) )
-
-
 typedef struct nodeId_s
 {
     char nodeName[MPI_MAX_PROCESSOR_NAME];

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/makefile
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/makefile b/core/sqf/monitor/linux/makefile
index 0707d18..73127e4 100644
--- a/core/sqf/monitor/linux/makefile
+++ b/core/sqf/monitor/linux/makefile
@@ -266,6 +266,7 @@ NSOBJS += $(OUTDIR)/nsreqdelproc.o
 NSOBJS += $(OUTDIR)/nsreqstop.o
 NSOBJS += $(OUTDIR)/nsreqnewproc.o
 NSOBJS += $(OUTDIR)/nsreqprocinfo.o
+NSOBJS += $(OUTDIR)/nsreqprocinfons.o
 NSOBJS += $(OUTDIR)/nsreqstart.o
 NSOBJS += $(OUTDIR)/nsreqshutdown.o
 ifeq ($(USE_FORK_SUSPEND_RESUME),1)

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/mlio.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/mlio.cxx b/core/sqf/monitor/linux/mlio.cxx
index 7b7158c..0f16ea0 100644
--- a/core/sqf/monitor/linux/mlio.cxx
+++ b/core/sqf/monitor/linux/mlio.cxx
@@ -104,6 +104,7 @@ const int SQ_LocalIOToClient::serviceRequestSize[] = {
    sizeof(REQTYPE) + sizeof( NodeDelete_def ),      // ReqType_NodeDelete
    sizeof(REQTYPE) + sizeof( NodeDown_def ),        // ReqType_NodeDown
    sizeof(REQTYPE) + sizeof( NodeInfo_def ),        // ReqType_NodeInfo
+   sizeof(REQTYPE) + sizeof( NodeName_def ),        // ReqType_NodeName
    sizeof(REQTYPE) + sizeof( NodeUp_def ),          // ReqType_NodeUp
    0,                              // ReqType_Notice -- not an actual request
    sizeof(REQTYPE) + sizeof( Notify_def ),          // ReqType_Notify
@@ -122,8 +123,7 @@ const int SQ_LocalIOToClient::serviceRequestSize[] = {
    sizeof(REQTYPE) + sizeof( TmReady_def ),         // ReqType_TmReady
    sizeof(REQTYPE) + sizeof( TmSync_def ),          // ReqType_TmSync
    sizeof(REQTYPE) + sizeof( TransInfo_def ),       // ReqType_TransInfo
-   sizeof(REQTYPE) + sizeof( ZoneInfo_def ),        // ReqType_ZoneInfo
-   sizeof(REQTYPE) + sizeof( NodeName_def )         // ReqType_NodeName
+   sizeof(REQTYPE) + sizeof( ZoneInfo_def )         // ReqType_ZoneInfo
 };
 
 // The serviceReplySize array holds the size of the request messages for
@@ -137,17 +137,19 @@ const int SQ_LocalIOToClient::serviceReplySize[] = {
    sizeof(REPLYTYPE) + sizeof( MonStats_reply_def ),    // ReplyType_MonStats
    sizeof(REPLYTYPE) + sizeof( Mount_reply_def ),       // ReplyType_Mount
    sizeof(REPLYTYPE) + sizeof( NewProcess_reply_def ),  // ReplyType_NewProcess
+   sizeof(REPLYTYPE) + sizeof( NewProcessNs_reply_def ),// ReplyType_NewProcessNs
    sizeof(REPLYTYPE) + sizeof( NodeInfo_reply_def ),    // ReplyType_NodeInfo
+   sizeof(REPLYTYPE) + sizeof( NodeName_reply_def ),    // ReplyType_NodeName
    sizeof(REPLYTYPE) + sizeof( Open_reply_def ),        // ReplyType_Open
    sizeof(REPLYTYPE) + sizeof( OpenInfo_reply_def ),    // ReplyType_OpenInfo
    sizeof(REPLYTYPE) + sizeof( PNodeInfo_reply_def ),   // ReplyType_PNodeInfo
    sizeof(REPLYTYPE) + sizeof( ProcessInfo_reply_def ), // ReplyType_ProcessInfo
+   sizeof(REPLYTYPE) + sizeof( ProcessInfoNs_reply_def ),// ReplyType_ProcessInfoNs
    sizeof(REPLYTYPE) + sizeof( Stfsd_reply_def ),       // ReplyType_Stfsd
    sizeof(REPLYTYPE) + sizeof( Startup_reply_def ),     // ReplyType_Startup
    sizeof(REPLYTYPE) + sizeof( TmSync_reply_def ),      // ReplyType_TmSync 
    sizeof(REPLYTYPE) + sizeof( TransInfo_reply_def ),   // ReplyType_TransInfo 
-   sizeof(REPLYTYPE) + sizeof( ZoneInfo_reply_def ),    // ReplyType_ZoneInfo
-   sizeof(REPLYTYPE) + sizeof( NodeName_reply_def )     // ReplyType_NodeName
+   sizeof(REPLYTYPE) + sizeof( ZoneInfo_reply_def )     // ReplyType_ZoneInfo
 };
 
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/monitor.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/monitor.cxx b/core/sqf/monitor/linux/monitor.cxx
index 1e623a4..4c67b15 100755
--- a/core/sqf/monitor/linux/monitor.cxx
+++ b/core/sqf/monitor/linux/monitor.cxx
@@ -565,9 +565,10 @@ bool CMonitor::CompleteProcessStartup (struct message_def * msg)
                          msg->u.request.u.startup.process_name,
                          msg->u.request.u.startup.port_name);
         }
-
+#ifndef NAMESERVER_PROCESS
         CProcessContainer::ParentNewProcReply( process, MPI_SUCCESS);
         status = SUCCESS;
+#endif
     }
     else
     {
@@ -1191,6 +1192,14 @@ int main (int argc, char *argv[])
 #endif
     }
 
+#ifndef NAMESERVER_PROCESS
+    env = getenv("SQ_NAMESERVER_ENABLE");
+    if ( env && isdigit(*env) )
+    {
+        NameServerEnabled = atoi(env);
+    }
+#endif
+
     if ( IsAgentMode || IsNameServer )
     {
         MON_Props xprops( true );
@@ -1813,12 +1822,11 @@ int main (int argc, char *argv[])
         Monitor = new CMonitor (procTermSig);
 #endif
 #ifndef NAMESERVER_PROCESS
-        env = getenv("SQ_NAMESERVER_ENABLED");
-        if ( env && isdigit(*env) )
-            NameServerEnabled = atoi(env);
-
-        NameServer = new CNameServer ();
-        PtpClient = new CPtpClient ();
+        if (NameServerEnabled)
+        {
+            NameServer = new CNameServer ();
+            PtpClient = new CPtpClient ();
+        }
 #endif
 
         if ( IsAgentMode )
@@ -1937,9 +1945,18 @@ int main (int argc, char *argv[])
         // Create thread to accept connections from other monitors
         CommAccept.start();
 #ifdef NAMESERVER_PROCESS
+        // Create thread to accept connections from other name servers
         CommAcceptMon.start();
+        if (IsMaster)
+        {
+            CommAcceptMon.startAccepting();
+        }
 #else
-        PtpCommAccept.start();
+        if (NameServerEnabled)
+        {
+            // Create thread to accept point-2-point connections from other monitors
+            PtpCommAccept.start();
+        }
 #endif
 #ifndef NAMESERVER_PROCESS
         // Open file used to record process start/end times
@@ -2284,7 +2301,10 @@ int main (int argc, char *argv[])
 #ifndef NAMESERVER_PROCESS
     // Tell the LIO worker threads to exit
     SQ_theLocalIOToClient->shutdownWork();
-    PtpCommAccept.shutdownWork();
+    if (NameServerEnabled)
+    {
+        PtpCommAccept.shutdownWork();
+    }
 #endif
 
     CommAccept.shutdownWork();

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/montrace.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/montrace.cxx b/core/sqf/monitor/linux/montrace.cxx
index d294724..96eab05 100644
--- a/core/sqf/monitor/linux/montrace.cxx
+++ b/core/sqf/monitor/linux/montrace.cxx
@@ -61,7 +61,9 @@ const CMonTrace::TraceArea_t CMonTrace::traceAreaList_[] =
   {"MON_TRACE_REDIRECTION",    TRACE_REDIRECTION},
   {"MON_TRACE_TRAFCONFIG",     TRACE_TRAFCONFIG},
   {"MON_TRACE_HEALTH",         TRACE_HEALTH},
-  {"MON_TRACE_SIG_HANDLER",    TRACE_SIG_HANDLER}
+  {"MON_TRACE_SIG_HANDLER",    TRACE_SIG_HANDLER},
+  {"MON_TRACE_NS",             TRACE_NS},
+  {"MON_TRACE_MEAS",           TRACE_MEAS}
 };
 
 // Global trace flags

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/msgdef.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/msgdef.h b/core/sqf/monitor/linux/msgdef.h
index b76862d..d974462 100644
--- a/core/sqf/monitor/linux/msgdef.h
+++ b/core/sqf/monitor/linux/msgdef.h
@@ -251,6 +251,7 @@ typedef enum {
     ReqType_PNodeInfo,                      // physical node information request 
     ReqType_ProcessInfo,                    // process information request
     ReqType_ProcessInfoCont,                // process information request (continuation)
+    ReqType_ProcessInfoNs,                  // process information request (monitor)
     ReqType_Set,                            // add configuration information to the registry 
     ReqType_Shutdown,                       // request cluster shutdown
     ReqType_ShutdownNs,                     // request nameserver shutdown
@@ -286,6 +287,7 @@ typedef enum {
     ReplyType_OpenInfo,                     // reply with list of opens for a process
     ReplyType_PNodeInfo,                    // reply with info on list of physical nodes
     ReplyType_ProcessInfo,                  // reply with info on list of processes
+    ReplyType_ProcessInfoNs,                // reply with info of process
     ReplyType_Stfsd,                        // reply with stfsd info
     ReplyType_Startup,                      // reply with startup info
     ReplyType_TmSync,                       // reply from unsolicited TmSync message
@@ -576,14 +578,16 @@ struct NewProcessNs_def
     bool event_messages;                    // true if want event messages
     bool system_messages;                   // true if want system messages
     long long tag;                          // user defined tag to be sent in completion notice
-    char path[MAX_SEARCH_PATH];             // process's object lookup path to program
-    char ldpath[MAX_SEARCH_PATH];           // process's library load path for program
-    char program[MAX_PROCESS_PATH];         // full path to object file
+    strId_t pathStrId;                      // program lookup path (string id)
+    strId_t ldpathStrId;                    // library load path (string id)
+    strId_t programStrId;                   // full path to object file (string id)
     char process_name[MAX_PROCESS_NAME];    // process name
+    char port_name[MPI_MAX_PORT_NAME];      // mpi port name from MPI_Open_port
     int  argc;                              // number of additional command line argument
     char argv[MAX_ARGS][MAX_ARG_SIZE];      // array of additional command line arguments
     char infile[MAX_PROCESS_PATH];          // if null then use monitor's infile
     char outfile[MAX_PROCESS_PATH];         // if null then use monitor's outfile
+    struct timespec creation_time;          // creation time
     int  fill1;                             // filler to fill out struct
 };
 
@@ -958,6 +962,36 @@ struct ProcessInfo_reply_def
     bool more_data;                         // true if have additional process data
 };
 
+struct ProcessInfoNs_reply_def
+{
+    int  nid;                               // node id
+    int  pid;                               // process id
+    Verifier_t verifier;                    // process verifier
+    char process_name[MAX_PROCESS_NAME];    // process name
+    PROCESSTYPE type;                       // Identifies the process handling catagory
+    int   parent_nid;                       // parent's node id
+    int   parent_pid;                       // parent's process id
+    Verifier_t parent_verifier;             // parent's process verifier
+    int  priority;                          // Linux system priority
+    int  backup;                            // if non-zero, starts process as backup
+    STATE state;                            // process's current state
+    bool unhooked;                          // if hooked, parent process dies will trigger child process exits
+    bool event_messages;                    // true if want event messages
+    bool system_messages;                   // true if want system messages
+    long long tag;                          // user defined tag to be sent in completion notice
+    char  program[MAX_PROCESS_PATH];        // process's object file name
+    strId_t pathStrId;                      // program lookup path (string id)
+    strId_t ldpathStrId;                    // library load path (string id)
+    strId_t programStrId;                   // full path to object file (string id)
+    char port_name[MPI_MAX_PORT_NAME];      // mpi port name from MPI_Open_port
+    int  argc;                              // number of additional command line argument
+    char argv[MAX_ARGS][MAX_ARG_SIZE];      // array of additional command line arguments
+    char infile[MAX_PROCESS_PATH];          // if null then use monitor's infile
+    char outfile[MAX_PROCESS_PATH];         // if null then use monitor's outfile
+    struct timespec creation_time;          // creation time
+    int  return_code;                       // mpi error code of error
+};
+
 struct ProcessInfoCont_def
 {
     int  nid;                               // requesting process's node id
@@ -1233,6 +1267,7 @@ struct reply_def
         struct OpenInfo_reply_def      open_info;
         struct PNodeInfo_reply_def     pnode_info;
         struct ProcessInfo_reply_def   process_info;
+        struct ProcessInfoNs_reply_def process_info_ns;
         struct Startup_reply_def       startup_info;
 #ifdef SQ_STFSD
         struct Stfsd_reply_def         stfsd;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/nameserver.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nameserver.cxx b/core/sqf/monitor/linux/nameserver.cxx
index 1e32972..b201ae6 100644
--- a/core/sqf/monitor/linux/nameserver.cxx
+++ b/core/sqf/monitor/linux/nameserver.cxx
@@ -534,6 +534,17 @@ int CNameServer::ProcessInfoCont( struct message_def* msg )
     return error;
 }
 
+int CNameServer::ProcessInfoNs( struct message_def* msg )
+{
+    const char method_name[] = "CNameServer::ProcessInfoNs";
+    TRACE_ENTRY;
+
+    int error = SendReceive( msg );
+
+    TRACE_EXIT;
+    return error;
+}
+
 int CNameServer::ProcessNew(CProcess* process )
 {
     const char method_name[] = "CNameServer::ProcessNew";
@@ -564,10 +575,20 @@ int CNameServer::ProcessNew(CProcess* process )
     msgnew->verifier = process->GetVerifier();
     msgnew->type = process->GetType();
     msgnew->priority = process->GetPriority();
+    msgnew->backup = process->IsBackup();
+    msgnew->unhooked = process->IsUnhooked();
     msgnew->event_messages = process->IsEventMessages();
     msgnew->system_messages = process->IsSystemMessages();
+    msgnew->pathStrId = process->pathStrId();
+    msgnew->ldpathStrId = process->ldPathStrId();
+    msgnew->programStrId = process->programStrId();
     strcpy( msgnew->process_name, process->GetName() );
-    strcpy( msgnew->program, process->program() );
+    strcpy( msgnew->port_name, process->GetPort() );
+    msgnew->argc = process->argc();
+    memcpy(msgnew->argv, process->userArgv(), process->userArgvLen());
+    strcpy( msgnew->infile, process->infile() );
+    strcpy( msgnew->outfile, process->outfile() );
+    msgnew->creation_time = process->GetCreationTime();
 
     int error = SendReceive(&msg );
 
@@ -650,6 +671,10 @@ int CNameServer::SendReceive( struct message_def* msg )
         descp = (char *) "process-info-cont";
         size += sizeof(msg->u.request.u.process_info_cont);
         break;
+    case ReqType_ProcessInfoNs:
+        descp = (char *) "process-info-ns";
+        size += sizeof(msg->u.request.u.process_info);
+        break;
     case ReqType_ShutdownNs:
         msgshutdown = &msg->u.request.u.shutdown_ns;
         sprintf( desc, "shutdown (nid=%d, pid=%d, level=%d)",
@@ -670,7 +695,7 @@ int CNameServer::SendReceive( struct message_def* msg )
     {
         if ( trace_settings & ( TRACE_NS | TRACE_PROCESS ) )
         {
-            char desc[200];
+            char desc[2048];
             char* descp = desc;
             switch ( msg->u.reply.type )
             {
@@ -704,6 +729,70 @@ int CNameServer::SendReceive( struct message_def* msg )
                          msg->u.reply.u.process_info.return_code,
                          msg->u.reply.u.process_info.more_data );
                 break;
+            case ReplyType_ProcessInfoNs:
+//                int argvLen = sizeof(msg->u.reply.u.process_info_ns.argv);
+                sprintf( desc, 
+                         "process-info-ns reply:\n"
+                         "        process_info_ns.nid=%d\n"
+                         "        process_info_ns.pid=%d\n"
+                         "        process_info_ns.verifier=%d\n"
+                         "        process_info_ns.process_name=%s\n"
+                         "        process_info_ns.type=%d\n"
+                         "        process_info_ns.parent_nid=%d\n"
+                         "        process_info_ns.parent_pid=%d\n"
+                         "        process_info_ns.parent_verifier=%d\n"
+                         "        process_info_ns.priority=%d\n"
+                         "        process_info_ns.backup=%d\n"
+                         "        process_info_ns.state=%d\n"
+                         "        process_info_ns.unhooked=%d\n"
+                         "        process_info_ns.event_messages=%d\n"
+                         "        process_info_ns.system_messages=%d\n"
+                         "        process_info_ns.program=%s\n"
+                         "        process_info_ns.pathStrId=%d:%d\n"
+                         "        process_info_ns.ldpathStrId=%d:%d\n"
+                         "        process_info_ns.programStrId=%d:%d\n"
+                         "        process_info_ns.port_name=%s\n"
+                         "        process_info_ns.argc=%d\n"
+//                         "        process_info_ns.argv=[%.*s]\n"
+                         "        process_info_ns.infile=%s\n"
+                         "        process_info_ns.outfile=%s\n"
+//#if 0
+//                         "        process_info_ns.creation_time=%ld(secs)\n",
+//                         "        process_info_ns.creation_time=%ld(secs):%ld(nsecs)\n",
+//#endif
+                         "        process_info_ns.return_code=%d"
+                         , msg->u.reply.u.process_info_ns.nid
+                         , msg->u.reply.u.process_info_ns.pid
+                         , msg->u.reply.u.process_info_ns.verifier
+                         , msg->u.reply.u.process_info_ns.process_name
+                         , msg->u.reply.u.process_info_ns.type
+                         , msg->u.reply.u.process_info_ns.parent_nid
+                         , msg->u.reply.u.process_info_ns.parent_pid
+                         , msg->u.reply.u.process_info_ns.parent_verifier
+                         , msg->u.reply.u.process_info_ns.priority
+                         , msg->u.reply.u.process_info_ns.backup
+                         , msg->u.reply.u.process_info_ns.state
+                         , msg->u.reply.u.process_info_ns.unhooked
+                         , msg->u.reply.u.process_info_ns.event_messages
+                         , msg->u.reply.u.process_info_ns.system_messages
+                         , msg->u.reply.u.process_info_ns.program
+                         , msg->u.reply.u.process_info_ns.pathStrId.nid
+                         , msg->u.reply.u.process_info_ns.pathStrId.id
+                         , msg->u.reply.u.process_info_ns.ldpathStrId.nid
+                         , msg->u.reply.u.process_info_ns.ldpathStrId.id
+                         , msg->u.reply.u.process_info_ns.programStrId.nid
+                         , msg->u.reply.u.process_info_ns.programStrId.id
+                         , msg->u.reply.u.process_info_ns.port_name
+                         , msg->u.reply.u.process_info_ns.argc
+//                         , &msg->u.reply.u.process_info_ns.argv
+                         , msg->u.reply.u.process_info_ns.infile
+                         , msg->u.reply.u.process_info_ns.outfile
+//#if 0
+//                         , msg->u.reply.u.process_info_ns.creation_time.tv_sec
+//                         , msg->u.reply.u.process_info_ns.creation_time.tv_nsec
+//#endif
+                         , msg->u.reply.u.process_info_ns.return_code );
+                break;
             default:
                 descp = (char *) "UNKNOWN";
                 break;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/nameserver.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nameserver.h b/core/sqf/monitor/linux/nameserver.h
index e3ee6eb..a8ccb4b 100644
--- a/core/sqf/monitor/linux/nameserver.h
+++ b/core/sqf/monitor/linux/nameserver.h
@@ -44,6 +44,7 @@ public:
     int  ProcessDelete(CProcess* process );
     int  ProcessInfo( struct message_def* msg );
     int  ProcessInfoCont( struct message_def* msg );
+    int  ProcessInfoNs( struct message_def* msg );
     int  ProcessNew(CProcess* process );
     int  ProcessShutdown( void );
     void SetLocalHost( void );

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/notice.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/notice.cxx b/core/sqf/monitor/linux/notice.cxx
index 4695210..85a9eab 100644
--- a/core/sqf/monitor/linux/notice.cxx
+++ b/core/sqf/monitor/linux/notice.cxx
@@ -38,11 +38,17 @@ using namespace std;
 #include "pnode.h"
 #include "notice.h"
 #include "mlio.h"
-
 #include "replicate.h"
+#include "ptpclient.h"
+#include "nameserver.h"
 
 extern int trace_level;
 extern CMonitor *Monitor;
+extern int NameServerEnabled;
+extern CNameServer *NameServer;
+extern CPtpClient *PtpClient;
+extern CNode *MyNode;
+
 extern CNodeContainer *Nodes;
 extern CMonStats *MonStats;
 extern int MyPNID;
@@ -283,10 +289,10 @@ void CNotice::Notify( SQ_LocalIOToClient::bcastPids_t *bcastPids )
                         trace_printf( "%s@%d - Process %s (%d, %d:%d)" 
                                       " doesn't want Death message" "\n"
                                     , method_name, __LINE__
-                                    , Process->GetName()
-                                    , Process->GetNid()
-                                    , Process->GetPid()
-                                    , Process->GetVerifier() );
+                                    , notify->GetName()
+                                    , notify->GetNid()
+                                    , notify->GetPid()
+                                    , notify->GetVerifier() );
                 }
             }
             else
@@ -294,10 +300,10 @@ void CNotice::Notify( SQ_LocalIOToClient::bcastPids_t *bcastPids )
                 if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
                     trace_printf( "%s@%d - Not processed for clone Process %s (%d, %d:%d)\n"
                                 , method_name, __LINE__
-                                , Process->GetName()
-                                , Process->GetNid()
-                                , Process->GetPid()
-                                , Process->GetVerifier() );
+                                , notify->GetName()
+                                , notify->GetNid()
+                                , notify->GetPid()
+                                , notify->GetVerifier() );
             }
         }
         else
@@ -373,3 +379,134 @@ void CNotice::NotifyAll( void )
     TRACE_EXIT;
 }
 
+void CNotice::NotifyRemote( void )
+{
+    const char method_name[] = "CNotice::NotifyRemote";
+    TRACE_ENTRY;
+
+    int      targetNid = -1;
+    CNotice *entry = NULL;
+    NidQueue_t *nidQueue = new NidQueue_t;
+
+    // build the nid queue of nodes to notify
+    for( entry=this; entry; entry=entry->Next )
+    {
+        entry->NotifyNid( nidQueue );
+    }
+
+    while ( !nidQueue->empty() )
+    {
+        targetNid = nidQueue->front();
+        CLNode *targetLNode = Nodes->GetLNode( targetNid );
+    
+        int rc = -1;
+        // Send the process exit to the target node
+        rc = PtpClient->ProcessExit( Process
+                                   , targetNid
+                                   , targetLNode->GetNode()->GetName() );
+        if (rc)
+        {
+            // TODO: Error handling
+        }
+        nidQueue->pop();
+    }
+
+    delete nidQueue;
+
+    TRACE_EXIT;
+}
+
+void CNotice::NotifyNid( NidQueue_t *nidQueue )
+{
+    const char method_name[] = "CNotice::NotifyNid";
+    TRACE_ENTRY;
+
+    CProcess *remoteProcess;
+    
+    if ( canceled_ )
+    {
+        if (trace_settings & (TRACE_REQUEST_DETAIL | TRACE_PROCESS_DETAIL))
+            trace_printf( "%s@%d - Process death notice for process %s (%d, %d:%d) "
+                          "was canceled so not delivered to process %s (%d, %d:%d)\n"
+                        , method_name, __LINE__
+                        , Process->GetName()
+                        , Process->GetNid()
+                        , Process->GetPid()
+                        , Process->GetVerifier()
+                        , name_.c_str()
+                        , Nid
+                        , Pid
+                        , verifier_);
+    }
+    else
+    {
+        if ( !MyNode->IsMyNode(Nid) )
+        {
+            // find by nid (check node state, check process state, backup is Ok)
+            remoteProcess = Nodes->GetProcess( Nid
+                                             , Pid
+                                             , verifier_
+                                             , true, true, true );
+            if( remoteProcess )
+            {
+                if (remoteProcess->IsSystemMessages() )
+                {
+                    // Add this process' nid to the queue
+                    nidQueue->push( Nid);
+                    if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+                    {
+                        CLNode *lnode = Nodes->GetLNode( Nid );
+                        trace_printf( "%s@%d - Sending process %s (%d, %d:%d) "
+                                      "exit message to %s (nid=%d)\n"
+                                    , method_name, __LINE__
+                                    , Process->GetName()
+                                    , Process->GetNid()
+                                    , Process->GetPid()
+                                    , Process->GetVerifier()
+                                    , lnode?lnode->GetNode()->GetName():""
+                                    , lnode?lnode->GetNode()->GetPNid():Nid);
+                    }
+                }
+                else
+                {
+                    if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+                    {
+                        trace_printf( "%s@%d - Process %s (%d, %d:%d)" 
+                                      " doesn't want Death message\n"
+                                    , method_name, __LINE__
+                                    , remoteProcess->GetName()
+                                    , remoteProcess->GetNid()
+                                    , remoteProcess->GetPid()
+                                    , remoteProcess->GetVerifier() );
+                    }
+                }
+            }
+            else
+            {
+                if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+               {
+                   trace_printf( "%s@%d - Can't find process %s (%d, %d:%d)\n"
+                               , method_name, __LINE__
+                               , name_.c_str()
+                               , Nid
+                               , Pid
+                               , verifier_ );
+               }
+            }
+        }
+        else
+        {
+            if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+            {
+                trace_printf( "%s@%d - Not processed for local Process %s (%d, %d:%d)\n"
+                            , method_name, __LINE__
+                            , Process->GetName()
+                            , Process->GetNid()
+                            , Process->GetPid()
+                            , Process->GetVerifier() );
+            }
+        }
+    }
+    TRACE_EXIT;
+}
+

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/notice.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/notice.h b/core/sqf/monitor/linux/notice.h
index c3888a0..c2ad3ff 100644
--- a/core/sqf/monitor/linux/notice.h
+++ b/core/sqf/monitor/linux/notice.h
@@ -27,8 +27,11 @@
 #define NOTICE_H_
 #ifndef NAMESERVER_PROCESS
 
+#include <queue>
 #include "mlio.h"
 
+typedef queue<int> NidQueue_t;  // (nid)
+
 class CProcess;
 
 class CNotice
@@ -60,11 +63,13 @@ public:
                       , _TM_Txid_External trans_id );
     CNotice *Link( CNotice *entry );
     void NotifyAll( void );
+    void NotifyRemote( void );
     bool isCanceled ( void ) { return canceled_; }
 
 protected:
 private:
     void Notify( SQ_LocalIOToClient::bcastPids_t *bcastPids );
+    void NotifyNid( NidQueue_t *nidQueue );
     bool canceled_;             // true if notice request has been canceled
     CProcess *Process;         // process that is being monitored
     CNotice *Next;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/nscommacceptmon.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nscommacceptmon.cxx b/core/sqf/monitor/linux/nscommacceptmon.cxx
index 39213f7..633eb2d 100644
--- a/core/sqf/monitor/linux/nscommacceptmon.cxx
+++ b/core/sqf/monitor/linux/nscommacceptmon.cxx
@@ -50,7 +50,7 @@ extern CReqQueue ReqQueue;
 static void *mon2nsProcess(void *arg);
 
 CCommAcceptMon::CCommAcceptMon()
-           : accepting_(true)
+           : accepting_(false)
            , shutdown_(false)
            , thread_id_(0)
 {
@@ -242,6 +242,46 @@ void CCommAcceptMon::monReqProcessInfoCont( struct message_def* msg, int sockFd
     TRACE_EXIT;
 }
 
+void CCommAcceptMon::monReqProcessInfoNs( struct message_def* msg, int sockFd )
+{
+    const char method_name[] = "CCommAcceptMon::monReqProcessInfoNs";
+    TRACE_ENTRY;
+
+    if ( trace_settings & ( TRACE_NS | TRACE_REQUEST) )
+    {
+        trace_printf( "%s@%d - Received monitor request process-info-ns data.\n"
+                      "        msg.info.nid=%d\n"
+                      "        msg.info.pid=%d\n"
+                      "        msg.info.verifier=%d\n"
+                      "        msg.info.target_nid=%d\n"
+                      "        msg.info.target_pid=%d\n"
+                      "        msg.info.target_verifier=%d\n"
+                      "        msg.info.target_process_name=%s\n"
+                      "        msg.info.target_process_pattern=%s\n"
+                      "        msg.info.type=%d\n"
+                    , method_name, __LINE__
+                    , msg->u.request.u.process_info.nid
+                    , msg->u.request.u.process_info.pid
+                    , msg->u.request.u.process_info.verifier
+                    , msg->u.request.u.process_info.target_nid
+                    , msg->u.request.u.process_info.target_pid
+                    , msg->u.request.u.process_info.target_verifier
+                    , msg->u.request.u.process_info.target_process_name
+                    , msg->u.request.u.process_info.target_process_pattern
+                    , msg->u.request.u.process_info.type
+                    );
+    }
+
+    CExternalReq::reqQueueMsg_t msgType;
+    msgType = CExternalReq::NonStartupMsg;
+    int nid = msg->u.request.u.process_info.nid;
+    int pid = msg->u.request.u.process_info.pid;
+    // Place new request on request queue
+    ReqQueue.enqueueReq(msgType, nid, pid, sockFd, msg);
+
+    TRACE_EXIT;
+}
+
 void CCommAcceptMon::monReqNewProcess( struct message_def* msg, int sockFd )
 {
     const char method_name[] = "CCommAcceptMon::monReqNewProcess";
@@ -249,25 +289,55 @@ void CCommAcceptMon::monReqNewProcess( struct message_def* msg, int sockFd )
     if ( trace_settings & ( TRACE_NS | TRACE_REQUEST) )
     {
         trace_printf( "%s@%d - Received monitor request new-process data.\n"
-                      "        msg.new_process_ns.parent_nid=%d\n"
-                      "        msg.new_process_ns.parent_pid=%d\n"
-                      "        msg.new_process_ns.parent_verifier=%d\n"
+                      "        msg.new_process_ns.process_name=%s\n"
                       "        msg.new_process_ns.nid=%d\n"
                       "        msg.new_process_ns.pid=%d\n"
                       "        msg.new_process_ns.verifier=%d\n"
                       "        msg.new_process_ns.type=%d\n"
+                      "        msg.new_process_ns.parent_nid=%d\n"
+                      "        msg.new_process_ns.parent_pid=%d\n"
+                      "        msg.new_process_ns.parent_verifier=%d\n"
                       "        msg.new_process_ns.priority=%d\n"
-                      "        msg.new_process_ns.process_name=%s\n"
+                      "        msg.new_process_ns.backup=%d\n"
+                      "        msg.new_process_ns.unhooked=%d\n"
+                      "        msg.new_process_ns.event_messages=%d\n"
+                      "        msg.new_process_ns.system_messages=%d\n"
+                      "        msg.new_process_ns.pathStrId=%d:%d\n"
+                      "        msg.new_process_ns.ldpathStrId=%d:%d\n"
+                      "        msg.new_process_ns.programStrId=%d:%d\n"
+                      "        msg.new_process_ns.port=%s\n"
+                      "        msg.new_process_ns.argc=%d\n"
+                      //"        msg.new_process_ns.argv=%s\n"
+                      "        msg.new_process_ns.infile=%s\n"
+                      "        msg.new_process_ns.outfile=%s\n"
+                      "        msg.new_process_ns.creation_time=%ld(secs):%ld(nsecs)\n"
                     , method_name, __LINE__
-                    , msg->u.request.u.new_process_ns.parent_nid
-                    , msg->u.request.u.new_process_ns.parent_pid
-                    , msg->u.request.u.new_process_ns.parent_verifier
+                    , msg->u.request.u.new_process_ns.process_name
                     , msg->u.request.u.new_process_ns.nid
                     , msg->u.request.u.new_process_ns.pid
                     , msg->u.request.u.new_process_ns.verifier
                     , msg->u.request.u.new_process_ns.type
+                    , msg->u.request.u.new_process_ns.parent_nid
+                    , msg->u.request.u.new_process_ns.parent_pid
+                    , msg->u.request.u.new_process_ns.parent_verifier
                     , msg->u.request.u.new_process_ns.priority
-                    , msg->u.request.u.new_process_ns.process_name
+                    , msg->u.request.u.new_process_ns.backup
+                    , msg->u.request.u.new_process_ns.unhooked
+                    , msg->u.request.u.new_process_ns.event_messages
+                    , msg->u.request.u.new_process_ns.system_messages
+                    , msg->u.request.u.new_process_ns.pathStrId.nid
+                    , msg->u.request.u.new_process_ns.pathStrId.id
+                    , msg->u.request.u.new_process_ns.ldpathStrId.nid
+                    , msg->u.request.u.new_process_ns.ldpathStrId.id
+                    , msg->u.request.u.new_process_ns.programStrId.nid
+                    , msg->u.request.u.new_process_ns.programStrId.id
+                    , msg->u.request.u.new_process_ns.port_name
+                    , msg->u.request.u.new_process_ns.argc
+                    //, msg->u.request.u.new_process_ns.argv
+                    , msg->u.request.u.new_process_ns.infile
+                    , msg->u.request.u.new_process_ns.outfile
+                    , msg->u.request.u.new_process_ns.creation_time.tv_sec
+                    , msg->u.request.u.new_process_ns.creation_time.tv_nsec
                     );
     }
 
@@ -469,6 +539,9 @@ void CCommAcceptMon::processMonReqs( int sockFd )
             case ReqType_ProcessInfoCont:
                 rtype = "ProcessInfoCont";
                 break;
+            case ReqType_ProcessInfoNs:
+                rtype = "ProcessInfoNs";
+                break;
             case ReqType_NameServerStop:
                 rtype = "NameServerStop";
                 break;
@@ -515,6 +588,10 @@ void CCommAcceptMon::processMonReqs( int sockFd )
             monReqProcessInfoCont(&msg, sockFd);
             break;
 
+        case ReqType_ProcessInfoNs:
+            monReqProcessInfoNs(&msg, sockFd);
+            break;
+
         case ReqType_NewProcessNs:
             monReqNewProcess(&msg, sockFd);
             break;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/nscommacceptmon.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nscommacceptmon.h b/core/sqf/monitor/linux/nscommacceptmon.h
index 6caf699..30daa92 100644
--- a/core/sqf/monitor/linux/nscommacceptmon.h
+++ b/core/sqf/monitor/linux/nscommacceptmon.h
@@ -48,6 +48,7 @@ public:
     void monReqNewProcess( struct message_def* msg, int sockFd );
     void monReqProcessInfo( struct message_def* msg, int sockFd );
     void monReqProcessInfoCont( struct message_def* msg, int sockFd );
+    void monReqProcessInfoNs( struct message_def* msg, int sockFd );
     void monReqShutdown( struct message_def* msg, int sockFd );
     void monReqUnknown( struct message_def* msg, int sockFd );
     void startAccepting( void );

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/nsprocess.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nsprocess.cxx b/core/sqf/monitor/linux/nsprocess.cxx
index bbcb853..62523ae 100644
--- a/core/sqf/monitor/linux/nsprocess.cxx
+++ b/core/sqf/monitor/linux/nsprocess.cxx
@@ -95,20 +95,14 @@ void CProcess::CompleteProcessStartup (char *port, int os_pid, bool event_messag
 
     if (trace_settings & (TRACE_SYNC_DETAIL | TRACE_PROCESS_DETAIL | TRACE_REQUEST_DETAIL))
         trace_printf("%s@%d: process %s (%d, %d), preclone=%d"
-                     ", clone=%d\n",
+                     ", clone=%d, origPNidNs=%d, MyPNID=%d\n",
                      method_name, __LINE__, Name,
-                     Nid, os_pid, preclone, Clone);
+                     Nid, os_pid, preclone, Clone, origPNidNs, MyPNID );
     StartupCompleted = true;
     if (creation_time != NULL)
         CreationTime = *creation_time;
 
-    if ( MyPNID == GetOrigPNidNs() )
-    {
-        // Replicate to other nodes
-        CReplClone *repl = new CReplClone(this);
-        Replicator.addItem(repl);
-    }
-    else
+    if ( MyPNID != GetOrigPNidNs() )
     {
         Clone = true;
     }

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/nsreqnewproc.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nsreqnewproc.cxx b/core/sqf/monitor/linux/nsreqnewproc.cxx
index 105ff95..92a7634 100644
--- a/core/sqf/monitor/linux/nsreqnewproc.cxx
+++ b/core/sqf/monitor/linux/nsreqnewproc.cxx
@@ -26,11 +26,14 @@
 #include "nstype.h"
 
 #include <stdio.h>
+#include "replicate.h"
 #include "reqqueue.h"
 #include "montrace.h"
 #include "monsonar.h"
 
+extern int MyPNID;
 extern CNodeContainer *Nodes;
+extern CReplicate Replicator;
 
 extern const char *ProcessTypeString( PROCESSTYPE type );
 
@@ -76,16 +79,13 @@ void CExtNewProcNsReq::performRequest()
     CNode *node;
     CLNode *parent_lnode;
     CNode *parent_node;
-    int result;
+    int result = MPI_SUCCESS;
     lnode = Nodes->GetLNode( nid_ );
     node = lnode->GetNode();
     parent_lnode = Nodes->GetLNode( msg_->u.request.u.new_process_ns.parent_nid );
     parent_node = NULL;
     if ( parent_lnode )
         parent_node = parent_lnode->GetNode();
-    strId_t pathStrId = node->GetStringId ( msg_->u.request.u.new_process_ns.path );
-    strId_t ldpathStrId = node->GetStringId (msg_->u.request.u.new_process_ns.ldpath );
-    strId_t programStrId = node->GetStringId ( msg_->u.request.u.new_process_ns.program );
     CProcess *parent = NULL;
     if ( parent_node )
         parent = parent_node->GetProcess( msg_->u.request.u.new_process_ns.parent_pid );
@@ -101,25 +101,56 @@ void CExtNewProcNsReq::performRequest()
                                               msg_->u.request.u.new_process_ns.backup,
                                               msg_->u.request.u.new_process_ns.unhooked,
                                               msg_->u.request.u.new_process_ns.process_name,
-                                              pathStrId,
-                                              ldpathStrId,
-                                              programStrId,
+                                              msg_->u.request.u.new_process_ns.pathStrId,
+                                              msg_->u.request.u.new_process_ns.ldpathStrId,
+                                              msg_->u.request.u.new_process_ns.programStrId,
                                               msg_->u.request.u.new_process_ns.infile,
                                               msg_->u.request.u.new_process_ns.outfile,
                                               result
                                             );
-    process = process; // touch
-    // TODO replicate
+    if (process)
+    {
+        if ( MyPNID == process->GetOrigPNidNs() )
+        {
+            process->userArgs (  msg_->u.request.u.new_process_ns.argc,
+                                 msg_->u.request.u.new_process_ns.argv );
 
-    msg_->u.reply.type = ReplyType_NewProcessNs;
-    msg_->u.reply.u.new_process_ns.nid = msg_->u.request.u.new_process_ns.nid;
-    msg_->u.reply.u.new_process_ns.pid = msg_->u.request.u.new_process_ns.pid;
-    msg_->u.reply.u.new_process_ns.verifier = msg_->u.request.u.new_process_ns.verifier;
-    strncpy(msg_->u.reply.u.new_process_ns.process_name, msg_->u.request.u.new_process_ns.process_name, MAX_PROCESS_NAME);
-    msg_->u.reply.u.new_process_ns.return_code = MPI_SUCCESS;
+            process->CompleteProcessStartup( msg_->u.request.u.new_process_ns.port_name
+                                           , msg_->u.request.u.new_process_ns.pid
+                                           , msg_->u.request.u.new_process_ns.event_messages
+                                           , msg_->u.request.u.new_process_ns.system_messages
+                                           , false
+                                           , &msg_->u.request.u.new_process_ns.creation_time
+                                           , process->GetOrigPNidNs() );
 
-    // Send reply to requester
-    monreply(msg_, sockFd_);
+            // Replicate to other nodes
+            CReplClone *repl = new CReplClone(process);
+            if (repl)
+            {
+                // we will not reply at this time ... but wait for 
+                // node add to be processed in CIntNodeAddReq
+    
+                // Retain reference to requester's request buffer so can
+                // send completion message.
+                process->SetMonContext( msg_ );
+                process->SetMonSockFd( sockFd_ );
+                msg_->noreply = true;
+    
+                Replicator.addItem(repl);
+            }
+        }
+    }
+    else
+    {
+        char la_buf[MON_STRING_BUF_SIZE];
+        msg_->u.reply.type = ReplyType_NewProcessNs;
+        msg_->u.reply.u.new_process_ns.return_code = MPI_ERR_SPAWN;
+        sprintf(la_buf, "[%s], Unsuccessful!\n", method_name);
+        mon_log_write(NS_EXTNEWPROCNSREQ_1, SQ_LOG_CRIT, la_buf);
+
+        // Send reply to requester
+        monreply(msg_, sockFd_);
+    }
 
     TRACE_EXIT;
 }

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/nsreqprocinfons.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nsreqprocinfons.cxx b/core/sqf/monitor/linux/nsreqprocinfons.cxx
new file mode 100644
index 0000000..3be8ddb
--- /dev/null
+++ b/core/sqf/monitor/linux/nsreqprocinfons.cxx
@@ -0,0 +1,206 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#include "nstype.h"
+
+#include <stdio.h>
+#include "reqqueue.h"
+#include "montrace.h"
+#include "monsonar.h"
+#include "monlogging.h"
+#include "replicate.h"
+#include "mlio.h"
+
+extern CMonitor *Monitor;
+extern CMonStats *MonStats;
+extern CNodeContainer *Nodes;
+extern CReplicate Replicator;
+extern int MyPNID;
+
+CExtProcInfoNsReq::CExtProcInfoNsReq( reqQueueMsg_t msgType,
+                                      int nid, int pid, int sockFd,
+                                      struct message_def *msg )
+                 : CExternalReq(msgType, nid, pid, sockFd, msg)
+{
+    // Add eyecatcher sequence as a debugging aid
+    memcpy(&eyecatcher_, "RqEB", 4);
+}
+
+CExtProcInfoNsReq::~CExtProcInfoNsReq()
+{
+    // Alter eyecatcher sequence as a debugging aid to identify deleted object
+    memcpy(&eyecatcher_, "rQeb", 4);
+}
+
+// Copy information for a specific process into the reply message buffer.
+void CExtProcInfoNsReq::copyInfo(CProcess *process, ProcessInfoNs_reply_def &processInfo)
+{
+    CProcess *parent;
+
+    processInfo.nid = process->GetNid();
+    processInfo.pid = process->GetPid();
+    processInfo.verifier = process->GetVerifier();
+    strncpy( processInfo.process_name, process->GetName(), MAX_PROCESS_NAME );
+    processInfo.type = process->GetType();
+
+    parent = process->GetParent();
+    if (parent)
+    {
+        processInfo.parent_nid = parent->GetNid();
+        processInfo.parent_pid = parent->GetPid();
+        processInfo.parent_verifier = parent->GetVerifier();
+//        strncpy(processInfo.parent_name, parent->GetName(), MAX_PROCESS_NAME );
+    }
+    else
+    {
+        processInfo.parent_nid = -1;
+        processInfo.parent_pid = -1;
+        processInfo.parent_verifier = -1;
+//        processInfo.parent_name[0] = '\0';
+    }
+
+    processInfo.priority = process->GetPriority();
+    processInfo.backup = process->IsBackup();
+    processInfo.state = process->GetState();
+    processInfo.unhooked = process->IsUnhooked();
+    processInfo.event_messages = process->IsEventMessages();
+    processInfo.system_messages = process->IsSystemMessages();
+    strncpy( processInfo.program, process->program(), MAX_PROCESS_PATH );
+    processInfo.pathStrId = process->pathStrId();
+    processInfo.ldpathStrId = process->ldPathStrId();
+    processInfo.programStrId = process->programStrId();
+    strncpy( processInfo.port_name, process->GetPort(), MPI_MAX_PORT_NAME );
+    processInfo.argc = process->argc();
+    memcpy( processInfo.argv, process->userArgv(), process->userArgvLen() );
+    strncpy( processInfo.infile, process->infile(), MAX_PROCESS_PATH );
+    strncpy( processInfo.outfile, process->outfile(), MAX_PROCESS_PATH );
+    processInfo.creation_time = process->GetCreationTime();
+}
+
+void CExtProcInfoNsReq::populateRequestString( void )
+{
+    char strBuf[MON_STRING_BUF_SIZE/2] = { 0 };
+
+    snprintf( strBuf, sizeof(strBuf), 
+              "ExtReq(%s) req #=%ld "
+              "requester(name=%s/nid=%d/pid=%d/os_pid=%d/verifier=%d) "
+              "target(name=%s/nid=%d/pid=%d/verifier=%d) pattern(name=%s)"
+            , CReqQueue::svcReqType[reqType_], getId()
+            , msg_->u.request.u.process_info.process_name
+            , msg_->u.request.u.process_info.nid
+            , msg_->u.request.u.process_info.pid
+            , pid_
+            , msg_->u.request.u.process_info.verifier
+            , msg_->u.request.u.process_info.target_process_name
+            , msg_->u.request.u.process_info.target_nid
+            , msg_->u.request.u.process_info.target_pid
+            , msg_->u.request.u.process_info.target_verifier
+            , msg_->u.request.u.process_info.target_process_pattern );
+    requestString_.assign( strBuf );
+}
+
+void CExtProcInfoNsReq::performRequest()
+{
+    CProcess *process = NULL;
+
+    const char method_name[] = "CExtProcInfoNsReq::performRequest";
+    TRACE_ENTRY;
+
+#if 0 // TODO
+    // Record statistics (sonar counters)
+    if (sonar_verify_state(SONAR_ENABLED | SONAR_MONITOR_ENABLED))
+       MonStats->req_type_kill_Incr();
+#endif
+
+    nid_ = msg_->u.request.u.process_info.nid;
+    verifier_ = msg_->u.request.u.process_info.verifier;
+    processName_ = msg_->u.request.u.process_info.process_name;
+
+    int       target_nid = -1;
+    int       target_pid = -1;
+    string    target_process_name;
+    Verifier_t target_verifier = -1;
+    
+    target_nid = msg_->u.request.u.process_info.target_nid;
+    target_pid = msg_->u.request.u.process_info.target_pid;
+    target_process_name = (const char *) msg_->u.request.u.process_info.target_process_name;
+    target_verifier  = msg_->u.request.u.process_info.target_verifier;
+
+    if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+    {
+        trace_printf( "%s@%d request #%ld: ProcessInfoNs, for (%d, %d:%d), "
+                      "process type=%d\n"
+                    , method_name, __LINE__, id_
+                    , target_nid, target_pid, target_verifier
+                    , msg_->u.request.u.process_info.type);
+    }
+
+    if ( target_process_name.size() )
+    { // find by name (don't check node state, don't check process state, not backup)
+        process = Nodes->GetProcess( target_process_name.c_str()
+                                   , target_verifier
+                                   , false, false, false );
+    }
+    else
+    { // find by nid (don't check node state, don't check process state, backup is Ok)
+        process = Nodes->GetProcess( target_nid
+                                   , target_pid
+                                   , target_verifier
+                                   , false, false, true );
+    }
+
+
+    if (process)
+    {
+        msg_->u.reply.type = ReplyType_ProcessInfoNs;
+        msg_->u.reply.u.process_info_ns.return_code = MPI_SUCCESS;
+        copyInfo( process, msg_->u.reply.u.process_info_ns );
+    }
+    else
+    {
+        if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+        {
+           trace_printf( "%s@%d - Kill %s (%d, %d:%d) -- can't find target process\n"
+                       , method_name, __LINE__
+                       , msg_->u.request.u.process_info.target_process_name
+                       , msg_->u.request.u.process_info.target_nid
+                       , msg_->u.request.u.process_info.target_pid
+                       , msg_->u.request.u.process_info.target_verifier);
+        }
+        msg_->u.reply.type = ReplyType_ProcessInfoNs;
+        msg_->u.reply.u.process_info_ns.nid = target_nid;
+        msg_->u.reply.u.process_info_ns.pid = target_pid;
+        msg_->u.reply.u.process_info_ns.verifier = target_verifier;
+        strncpy(msg_->u.reply.u.process_info_ns.process_name, target_process_name.c_str(), MAX_PROCESS_NAME);
+        msg_->u.reply.u.process_info_ns.return_code = MPI_ERR_NAME;
+        if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+           trace_printf("%s@%d - unsuccessful\n", method_name, __LINE__);
+    }
+
+    // Send reply to requester
+    monreply(msg_, sockFd_);
+
+    TRACE_EXIT;
+}

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/nsreqqueue.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nsreqqueue.cxx b/core/sqf/monitor/linux/nsreqqueue.cxx
index aa92ead..e189929 100644
--- a/core/sqf/monitor/linux/nsreqqueue.cxx
+++ b/core/sqf/monitor/linux/nsreqqueue.cxx
@@ -77,6 +77,16 @@ void CRequest::monreply(struct message_def *msg, int sockFd, int *error)
                              msg->u.reply.u.process_info.return_code);
             }
             break;
+        case ReplyType_ProcessInfoNs:
+            size += sizeof(struct ProcessInfoNs_reply_def);
+            if (trace_settings & (TRACE_PROCESS_DETAIL))
+            {
+                trace_printf("%s@%d reply type=%d(ProcessInfoNs), size=%d, sock=%d\n", method_name, __LINE__,
+                             msg->u.reply.type, size, sockFd);
+                trace_printf("%s@%d process-info reply. rc=%d\n", method_name, __LINE__,
+                             msg->u.reply.u.process_info.return_code);
+            }
+            break;
         default:
             if (trace_settings & (TRACE_PROCESS_DETAIL))
             {

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/pnode.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnode.cxx b/core/sqf/monitor/linux/pnode.cxx
index 997b2a5..e3923a0 100644
--- a/core/sqf/monitor/linux/pnode.cxx
+++ b/core/sqf/monitor/linux/pnode.cxx
@@ -1639,6 +1639,39 @@ void CNodeContainer::AddedNode( CNode *node )
     TRACE_EXIT;
 }
 
+CProcess *CNodeContainer::AddCloneProcess( ProcessInfoNs_reply_def *processInfo )
+{
+    const char method_name[] = "CNodeContainer::AddNode";
+    TRACE_ENTRY;
+
+    CLNode   *lnode = Nodes->GetLNode(processInfo->nid);
+    CNode    *node = lnode->GetNode();
+    CProcess *process = node->CloneProcess( processInfo->nid
+                                          , processInfo->type
+                                          , processInfo->priority
+                                          , processInfo->backup
+                                          , processInfo->unhooked
+                                          , processInfo->process_name
+                                          , processInfo->port_name
+                                          , processInfo->pid
+                                          , processInfo->verifier
+                                          , processInfo->parent_nid
+                                          , processInfo->parent_pid
+                                          , processInfo->parent_verifier
+                                          , processInfo->event_messages
+                                          , processInfo->system_messages
+                                          , processInfo->pathStrId
+                                          , processInfo->ldpathStrId
+                                          , processInfo->programStrId
+                                          , processInfo->infile
+                                          , processInfo->outfile
+                                          , &processInfo->creation_time
+                                          , -1 );//processInfo->origPNidNs_);
+
+    TRACE_EXIT;
+    return(process);
+}
+
 CNode *CNodeContainer::AddNode( int pnid )
 {
     const char method_name[] = "CNodeContainer::AddNode";
@@ -2914,6 +2947,122 @@ CProcess *CNodeContainer::GetProcessByName( const char *name, bool checkstate )
 }
 
 #ifndef NAMESERVER_PROCESS
+CProcess *CNodeContainer::GetProcessNs( int nid
+                                      , int pid
+                                      , Verifier_t verifier )
+{
+    const char method_name[] = "CNodeContainer::GetProcessNs";
+    TRACE_ENTRY;
+
+    CProcess *process = NULL;
+
+    struct message_def msg;
+    memset(&msg, 0, sizeof(msg) ); // TODO: remove!
+    msg.type = MsgType_Service;
+    msg.noreply = false;
+    msg.reply_tag = REPLY_TAG;
+    msg.u.request.type = ReqType_ProcessInfoNs;
+    struct ProcessInfo_def *processInfo = &msg.u.request.u.process_info;
+    processInfo->nid = -1;
+    processInfo->pid = -1;
+    processInfo->verifier = -1;
+    processInfo->process_name[0] = 0;
+    processInfo->target_nid = nid;
+    processInfo->target_pid = pid;
+    processInfo->target_verifier = verifier;
+    processInfo->target_process_name[0] = 0;
+    
+    int error = NameServer->ProcessInfoNs(&msg); // in reqQueue thread (CExternalReq)
+    if (error == 0)
+    {
+        if ( (msg.type == MsgType_Service) &&
+             (msg.u.reply.type == ReplyType_ProcessInfoNs) )
+        {
+            if ( msg.u.reply.u.process_info_ns.return_code == MPI_SUCCESS )
+            {
+                process = AddCloneProcess( &msg.u.reply.u.process_info_ns );
+            }
+            else
+            {
+                char buf[MON_STRING_BUF_SIZE];
+                snprintf( buf, sizeof(buf),
+                          "[%s] ProcessInfo failed, rc=%d\n"
+                        , method_name, msg.u.reply.u.process_info_ns.return_code );
+                mon_log_write( MON_NODE_GETPROCESSNS_1, SQ_LOG_ERR, buf );
+            }
+        }
+        else
+        {
+            char buf[MON_STRING_BUF_SIZE];
+            snprintf( buf, sizeof(buf),
+                      "[%s], Invalid MsgType(%d)/ReplyType(%d) for "
+                      "ProcessInfoNs\n"
+                    , method_name, msg.type, msg.u.reply.type );
+            mon_log_write( MON_NODE_GETPROCESSNS_2, SQ_LOG_ERR, buf );
+        }
+    }
+
+    TRACE_EXIT;
+    return( process );
+}
+
+CProcess *CNodeContainer::GetProcessNs( const char *name, Verifier_t verifier )
+{
+    const char method_name[] = "CNodeContainer::GetProcessNs";
+    TRACE_ENTRY;
+
+    CProcess *process = NULL;
+
+    struct message_def msg;
+    memset(&msg, 0, sizeof(msg) ); // TODO: remove!
+    msg.type = MsgType_Service;
+    msg.noreply = false;
+    msg.reply_tag = REPLY_TAG;
+    msg.u.request.type = ReqType_ProcessInfoNs;
+    struct ProcessInfo_def *processInfo = &msg.u.request.u.process_info;
+    processInfo->nid = -1;
+    processInfo->pid = -1;
+    processInfo->verifier = -1;
+    processInfo->process_name[0] = 0;
+    processInfo->target_nid = -1;
+    processInfo->target_pid = -1;
+    processInfo->target_verifier = verifier;
+    STRCPY( processInfo->target_process_name, name);
+
+    int error = NameServer->ProcessInfoNs(&msg); // in reqQueue thread (CExternalReq)
+    if (error == 0)
+    {
+        if ( (msg.type == MsgType_Service) &&
+             (msg.u.reply.type == ReplyType_ProcessInfoNs) )
+        {
+            if ( msg.u.reply.u.process_info_ns.return_code == MPI_SUCCESS )
+            {
+                process = AddCloneProcess( &msg.u.reply.u.process_info_ns );
+            }
+            else
+            {
+                char buf[MON_STRING_BUF_SIZE];
+                snprintf( buf, sizeof(buf),
+                          "[%s] ProcessInfo failed, rc=%d\n"
+                        , method_name, msg.u.reply.u.process_info_ns.return_code );
+                mon_log_write( MON_NODE_GETPROCESSNS_3, SQ_LOG_ERR, buf );
+            }
+        }
+        else
+        {
+            char buf[MON_STRING_BUF_SIZE];
+            snprintf( buf, sizeof(buf),
+                      "[%s], Invalid MsgType(%d)/ReplyType(%d) for "
+                      "ProcessInfo\n"
+                    , method_name, msg.type, msg.u.reply.type );
+            mon_log_write( MON_NODE_GETPROCESSNS_4, SQ_LOG_ERR, buf );
+        }
+    }
+
+    TRACE_EXIT;
+    return( process );
+}
+
 SyncState CNodeContainer::GetTmState ( SyncState check_state )
 {
     SyncState state = check_state;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/pnode.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnode.h b/core/sqf/monitor/linux/pnode.h
index 39b012b..48af3bc 100644
--- a/core/sqf/monitor/linux/pnode.h
+++ b/core/sqf/monitor/linux/pnode.h
@@ -66,6 +66,7 @@ public:
     ~CNodeContainer( void );
 
     void    AddedNode( CNode *node );
+    CProcess *AddCloneProcess( ProcessInfoNs_reply_def *processInfo );
     CNode  *AddNode( int pnid );
     void    AddNodes( void );
     void    AddToSpareNodesList( int pnid );
@@ -111,6 +112,11 @@ public:
                         , bool checkstate=true
                         , bool backupOk=false );
     CProcess *GetProcessByName( const char *name, bool checkstate=true );
+    CProcess *GetProcessNs( int nid
+                          , int pid
+                          , Verifier_t verifier );
+    CProcess *GetProcessNs( const char *name
+                          , Verifier_t verifier );
     SyncState GetTmState( SyncState check_state );
     CNode  *GetZoneNode( int zid );
 


[48/50] [abbrv] trafodion git commit: Code review change.

Posted by su...@apache.org.
Code review change.


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

Branch: refs/heads/master
Commit: 46bba6304ac279f340c801b6b7038290c0751a53
Parents: c036ba9
Author: Zalo Correa <za...@esgyn.com>
Authored: Wed Jun 13 11:33:20 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Wed Jun 13 11:33:20 2018 -0700

----------------------------------------------------------------------
 core/sqf/sqenvcom.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/46bba630/core/sqf/sqenvcom.sh
----------------------------------------------------------------------
diff --git a/core/sqf/sqenvcom.sh b/core/sqf/sqenvcom.sh
index 84b2e1f..cd2ea37 100644
--- a/core/sqf/sqenvcom.sh
+++ b/core/sqf/sqenvcom.sh
@@ -693,10 +693,10 @@ export SQ_STARTUP=r
 # Uncomment the next environment variable
 #export SQ_NAMESERVER_ENABLED=1
 if [[ "$SQ_NAMESERVER_ENABLED" == "1" ]]; then
-  export NS_COMM_PORT=23370
-  export NS_SYNC_PORT=23360
-  export NS_M2N_COMM_PORT=23350
-  export MON2MON_COMM_PORT=23340
+  export NS_COMM_PORT=${NS_COMM_PORT:-23370}
+  export NS_SYNC_PORT=${NS_SYNC_PORT:-23360}
+  export NS_M2N_COMM_PORT=${NS_M2N_COMM_PORT:-23350}
+  export MON2MON_COMM_PORT=${MON2MON_COMM_PORT:-23340}
 fi
 
 # Alternative logging capability in monitor


[25/50] [abbrv] trafodion git commit: Unique string fix.

Posted by su...@apache.org.
Unique string fix.


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

Branch: refs/heads/master
Commit: 2d774d9a17972ab7ad40b72e260a623697c99c13
Parents: 251f3f5
Author: Zalo Correa <za...@esgyn.com>
Authored: Wed Apr 11 09:01:34 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Wed Apr 11 09:01:34 2018 -0700

----------------------------------------------------------------------
 core/sqf/monitor/linux/pnode.cxx | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/2d774d9a/core/sqf/monitor/linux/pnode.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnode.cxx b/core/sqf/monitor/linux/pnode.cxx
index 5da34cd..b5fa4ed 100644
--- a/core/sqf/monitor/linux/pnode.cxx
+++ b/core/sqf/monitor/linux/pnode.cxx
@@ -1031,8 +1031,9 @@ strId_t CNode::GetStringId( char *candidate, CLNode *targetLNode )
 
         if (trace_settings & TRACE_PROCESS)
         {
-            trace_printf("%s@%d - Adding unique string id=[%d,%d] (%s), targetLnode=%p\n",
-                         method_name, __LINE__, id.nid, id.id, candidate, targetLNode );
+            trace_printf("%s@%d - Adding unique string id=[%d,%d] (%s), targetLnode=%p, targetNid=%d\n",
+                         method_name, __LINE__, id.nid, id.id, candidate, 
+                         targetLNode, targetLNode?targetLNode->GetNid():-1 );
         }
 
         Config->addUniqueString(id.nid, id.id, candidate);
@@ -1069,6 +1070,22 @@ strId_t CNode::GetStringId( char *candidate, CLNode *targetLNode )
             trace_printf("%s@%d - unique string id=[%d,%d] (%s)\n",
                          method_name, __LINE__, id.nid, id.id, candidate );
         }
+
+#ifndef NAMESERVER_PROCESS
+        if (NameServerEnabled)
+        {
+            if (targetLNode != NULL &&
+                !MyNode->IsMyNode(targetLNode->GetNid()))
+            {
+                // Forward the unique string to the target node
+                PtpClient->AddUniqStr( id.nid
+                                     , id.id
+                                     , candidate
+                                     , targetLNode->GetNid()
+                                     , targetLNode->GetNode()->GetName());
+            }
+        }
+#endif
     }
 
     TRACE_EXIT;


[17/50] [abbrv] trafodion git commit: Fixes to SQ_NAMESERVER_ENABLED token in scripts.

Posted by su...@apache.org.
Fixes to SQ_NAMESERVER_ENABLED token in scripts.


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

Branch: refs/heads/master
Commit: 5d982b8a954e2afe323a75e750c41d828e9d8ec4
Parents: 9467a47
Author: Zalo Correa <za...@esgyn.com>
Authored: Thu Apr 5 08:44:40 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Thu Apr 5 08:44:40 2018 -0700

----------------------------------------------------------------------
 core/sqf/monitor/linux/reqopen.cxx   |  4 ++--
 core/sqf/monitor/test/monitor.env    |  6 ++++--
 core/sqf/sqenvcom.sh                 |  2 +-
 core/sqf/src/trafconf/tcdbsqlite.cpp | 10 ++++++++++
 4 files changed, 17 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/5d982b8a/core/sqf/monitor/linux/reqopen.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqopen.cxx b/core/sqf/monitor/linux/reqopen.cxx
index 88022b9..a84e55f 100644
--- a/core/sqf/monitor/linux/reqopen.cxx
+++ b/core/sqf/monitor/linux/reqopen.cxx
@@ -287,7 +287,7 @@ bool CExtOpenReq::prepare()
                                          , true, false, false );
     }
     else
-    { // find by nid (check node state, don't check process state, backup is Ok)
+    { // find by pid (check node state, don't check process state, backup is Ok)
         openerProcess = Nodes->GetProcess( msg_->u.request.u.open.nid
                                          , msg_->u.request.u.open.pid
                                          , msg_->u.request.u.open.verifier
@@ -315,7 +315,7 @@ bool CExtOpenReq::prepare()
                                          , true, false, false );
     }
     else
-    { // find by nid (check node state, don't check process state, backup is Ok)
+    { // find by pid (check node state, don't check process state, backup is Ok)
         openedProcess = Nodes->GetProcess( msg_->u.request.u.open.target_nid
                                          , msg_->u.request.u.open.target_pid
                                          , msg_->u.request.u.open.target_verifier

http://git-wip-us.apache.org/repos/asf/trafodion/blob/5d982b8a/core/sqf/monitor/test/monitor.env
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/test/monitor.env b/core/sqf/monitor/test/monitor.env
index dd2cbb3..303dbf3 100644
--- a/core/sqf/monitor/test/monitor.env
+++ b/core/sqf/monitor/test/monitor.env
@@ -31,7 +31,7 @@ MONITOR_SYNC_PORT=23380
 #   NAME-SERVER - to disable process replication and enable name-server
 #
 # Uncomment the next six environment variables
-SQ_NAMESERVER_ENABLE=1
+SQ_NAMESERVER_ENABLED=1
 NS_COMM_PORT=23370
 NS_SYNC_PORT=23360
 NS_M2N_COMM_PORT=23350
@@ -54,11 +54,12 @@ MON_TRACE_NS=1
 #MON_TRACE_MLIO=1
 
 #MON_TRACE_REQUEST_DETAIL=1
-MON_TRACE_PROCESS_DETAIL=1
+#MON_TRACE_PROCESS_DETAIL=1
 #MON_TRACE_NOTICE_DETAIL=1
 #MON_TRACE_SYNC_DETAIL=1
 #MON_TRACE_MLIO_DETAIL=1
 
+MON_TRACE_MEAS
 #MON_TRACE_TMSYNC=1
 #MON_TRACE_STATS=1
 #MON_TRACE_ENTRY_EXIT=1
@@ -77,3 +78,4 @@ MON_TRACE_PROCESS_DETAIL=1
 #TC_TRACE_INIT=1
 #TC_TRACE_LOG_MSG=1
 #TC_TRACE_ENTRY_EXIT=1
+

http://git-wip-us.apache.org/repos/asf/trafodion/blob/5d982b8a/core/sqf/sqenvcom.sh
----------------------------------------------------------------------
diff --git a/core/sqf/sqenvcom.sh b/core/sqf/sqenvcom.sh
index b8f425c..59d30cd 100644
--- a/core/sqf/sqenvcom.sh
+++ b/core/sqf/sqenvcom.sh
@@ -692,7 +692,7 @@ export SQ_STARTUP=r
 #   NAME-SERVER - to disable process replication and enable name-server
 #
 # Uncomment the next six environment variables
-#export SQ_NAMESERVER_ENABLE=1
+#export SQ_NAMESERVER_ENABLED=1
 #export NS_COMM_PORT=23370
 #export NS_SYNC_PORT=23360
 #export NS_M2N_COMM_PORT=23350

http://git-wip-us.apache.org/repos/asf/trafodion/blob/5d982b8a/core/sqf/src/trafconf/tcdbsqlite.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/trafconf/tcdbsqlite.cpp b/core/sqf/src/trafconf/tcdbsqlite.cpp
index 4c1865a..9976c7a 100644
--- a/core/sqf/src/trafconf/tcdbsqlite.cpp
+++ b/core/sqf/src/trafconf/tcdbsqlite.cpp
@@ -1372,6 +1372,11 @@ int CTcdbSqlite::Initialize( void )
         snprintf( dbase, sizeof(dbase)
                 , "%s/sql/scripts/sqconfig.db", getenv("TRAF_HOME"));
     }
+    if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+    {
+        trace_printf( "%s@%d Opening SQLite database file %s\n"
+                    , method_name, __LINE__, dbase );
+    }
     int rc = sqlite3_open_v2( dbase, &db_
                             , SQLITE_OPEN_READWRITE | SQLITE_OPEN_FULLMUTEX
                             , NULL);
@@ -1379,6 +1384,11 @@ int CTcdbSqlite::Initialize( void )
     {
         db_ = NULL;
 
+        if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+        {
+            trace_printf( "%s@%d Opening SQLite database file sqconfig.db in current directory\n"
+                        , method_name, __LINE__ );
+        }
         // See if database is in current directory
         int rc2 = sqlite3_open_v2( "sqconfig.db", &db_
                                  , SQLITE_OPEN_READWRITE | SQLITE_OPEN_FULLMUTEX


[13/50] [abbrv] trafodion git commit: Merge branch 'TRAFODION-2884' of github.com:zcorrea/trafodion into TRAFODION-2884

Posted by su...@apache.org.
Merge branch 'TRAFODION-2884' of github.com:zcorrea/trafodion into TRAFODION-2884

Conflicts:
	core/sqf/monitor/linux/nameserver.cxx
	core/sqf/monitor/linux/nscommacceptmon.cxx
	core/sqf/monitor/linux/nsreqnewproc.cxx
	core/sqf/monitor/linux/process.cxx
	core/sqf/monitor/linux/reqqueue.cxx


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

Branch: refs/heads/master
Commit: 010e563d4320a802d992dc7f69683105c463c603
Parents: 8b025ea 6dc990f
Author: Dave George <de...@gmail.com>
Authored: Tue Apr 3 23:28:50 2018 +0000
Committer: Dave George <de...@gmail.com>
Committed: Tue Apr 3 23:28:50 2018 +0000

----------------------------------------------------------------------
 core/sqf/conf/log4cxx.monitor.trafns.config     |   2 +-
 .../export/include/common/evl_sqlog_eventnum.h  |  24 +
 core/sqf/export/include/seabed/ms.h             |   1 +
 core/sqf/export/include/trafconf/trafconfig.h   |   2 +-
 core/sqf/monitor/linux/cluster.cxx              | 183 +++--
 core/sqf/monitor/linux/cluster.h                |   8 +-
 core/sqf/monitor/linux/internal.h               |  22 +-
 core/sqf/monitor/linux/makefile                 |   1 +
 core/sqf/monitor/linux/mlio.cxx                 |  10 +-
 core/sqf/monitor/linux/monitor.cxx              |  45 +-
 core/sqf/monitor/linux/montrace.cxx             |   4 +-
 core/sqf/monitor/linux/msgdef.h                 |  41 +-
 core/sqf/monitor/linux/nameserver.cxx           |  92 ++-
 core/sqf/monitor/linux/nameserver.h             |   1 +
 core/sqf/monitor/linux/notice.cxx               | 188 ++++-
 core/sqf/monitor/linux/notice.h                 |   5 +
 core/sqf/monitor/linux/nscommacceptmon.cxx      |  87 ++-
 core/sqf/monitor/linux/nscommacceptmon.h        |   1 +
 core/sqf/monitor/linux/nsprocess.cxx            |  12 +-
 core/sqf/monitor/linux/nsreqnewproc.cxx         |  63 +-
 core/sqf/monitor/linux/nsreqprocinfons.cxx      | 206 +++++
 core/sqf/monitor/linux/nsreqqueue.cxx           |  10 +
 core/sqf/monitor/linux/pnode.cxx                | 151 ++++
 core/sqf/monitor/linux/pnode.h                  |  15 +-
 core/sqf/monitor/linux/process.cxx              | 262 ++++++-
 core/sqf/monitor/linux/process.h                |  21 +-
 core/sqf/monitor/linux/ptpclient.cxx            | 747 +++++++++++++------
 core/sqf/monitor/linux/ptpclient.h              |  46 +-
 core/sqf/monitor/linux/ptpcommaccept.cxx        | 269 ++-----
 core/sqf/monitor/linux/ptpcommaccept.h          |   2 -
 core/sqf/monitor/linux/replicate.cxx            |  30 +-
 core/sqf/monitor/linux/reqkill.cxx              |  26 +-
 core/sqf/monitor/linux/reqnewproc.cxx           |  28 +-
 core/sqf/monitor/linux/reqnotify.cxx            | 155 +++-
 core/sqf/monitor/linux/reqopen.cxx              |  74 +-
 core/sqf/monitor/linux/reqprocinfo.cxx          |  28 +-
 core/sqf/monitor/linux/reqqueue.cxx             | 724 +++++++++++++++---
 core/sqf/monitor/linux/reqqueue.h               |  84 +++
 core/sqf/monitor/linux/shell.cxx                |  38 +-
 core/sqf/monitor/test/childExitChild.cxx        |   1 +
 core/sqf/monitor/test/childExitParent.cxx       |   1 +
 core/sqf/monitor/test/monitor.env               |  79 ++
 core/sqf/monitor/test/montestutil.cxx           |   4 +-
 core/sqf/monitor/test/runtest                   | 258 +++++--
 core/sqf/monitor/test/sqconfig.monitor.cluster  |  39 -
 core/sqf/monitor/test/sqconfig.monitor.virtual  |   4 +
 core/sqf/sqenvcom.sh                            |  20 +-
 core/sqf/sql/scripts/monitor.env                |   1 +
 core/sqf/sql/scripts/pstat                      |   2 +-
 core/sqf/sql/scripts/sqconfig                   |   4 +
 core/sqf/src/seabed/src/labelmaps.cpp           |   4 +
 core/sqf/src/trafconf/trafconf.cpp              | 152 +++-
 core/sqf/src/trafconf/trafconfig.h              |   0
 53 files changed, 3363 insertions(+), 914 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/010e563d/core/sqf/monitor/linux/msgdef.h
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/trafodion/blob/010e563d/core/sqf/monitor/linux/nameserver.cxx
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/trafodion/blob/010e563d/core/sqf/monitor/linux/nscommacceptmon.cxx
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/nscommacceptmon.cxx
index 9b60f90,633eb2d..3e02e62
--- a/core/sqf/monitor/linux/nscommacceptmon.cxx
+++ b/core/sqf/monitor/linux/nscommacceptmon.cxx
@@@ -258,28 -293,51 +298,62 @@@ void CCommAcceptMon::monReqNewProcess( 
                        "        msg.new_process_ns.nid=%d\n"
                        "        msg.new_process_ns.pid=%d\n"
                        "        msg.new_process_ns.verifier=%d\n"
 +                      "        msg.new_process_ns.backup=%d\n"
 +                      "        msg.new_process_ns.event_messages=%d\n"
 +                      "        msg.new_process_ns.system_messages=%d\n"
                        "        msg.new_process_ns.type=%d\n"
+                       "        msg.new_process_ns.parent_nid=%d\n"
+                       "        msg.new_process_ns.parent_pid=%d\n"
+                       "        msg.new_process_ns.parent_verifier=%d\n"
                        "        msg.new_process_ns.priority=%d\n"
-                       "        msg.new_process_ns.process_name=%s\n"
+                       "        msg.new_process_ns.backup=%d\n"
+                       "        msg.new_process_ns.unhooked=%d\n"
+                       "        msg.new_process_ns.event_messages=%d\n"
+                       "        msg.new_process_ns.system_messages=%d\n"
+                       "        msg.new_process_ns.pathStrId=%d:%d\n"
+                       "        msg.new_process_ns.ldpathStrId=%d:%d\n"
+                       "        msg.new_process_ns.programStrId=%d:%d\n"
+                       "        msg.new_process_ns.port=%s\n"
+                       "        msg.new_process_ns.argc=%d\n"
+                       //"        msg.new_process_ns.argv=%s\n"
+                       "        msg.new_process_ns.infile=%s\n"
+                       "        msg.new_process_ns.outfile=%s\n"
+                       "        msg.new_process_ns.creation_time=%ld(secs):%ld(nsecs)\n"
                      , method_name, __LINE__
 -                    , msg->u.request.u.new_process_ns.process_name
 +                    , msg->u.request.u.new_process_ns.parent_nid
 +                    , msg->u.request.u.new_process_ns.parent_pid
 +                    , msg->u.request.u.new_process_ns.parent_verifier
 +                    , msg->u.request.u.new_process_ns.pair_parent_nid
 +                    , msg->u.request.u.new_process_ns.pair_parent_pid
 +                    , msg->u.request.u.new_process_ns.pair_parent_verifier
                      , msg->u.request.u.new_process_ns.nid
                      , msg->u.request.u.new_process_ns.pid
                      , msg->u.request.u.new_process_ns.verifier
 +                    , msg->u.request.u.new_process_ns.backup
 +                    , msg->u.request.u.new_process_ns.event_messages
 +                    , msg->u.request.u.new_process_ns.system_messages
                      , msg->u.request.u.new_process_ns.type
+                     , msg->u.request.u.new_process_ns.parent_nid
+                     , msg->u.request.u.new_process_ns.parent_pid
+                     , msg->u.request.u.new_process_ns.parent_verifier
                      , msg->u.request.u.new_process_ns.priority
-                     , msg->u.request.u.new_process_ns.process_name
+                     , msg->u.request.u.new_process_ns.backup
+                     , msg->u.request.u.new_process_ns.unhooked
+                     , msg->u.request.u.new_process_ns.event_messages
+                     , msg->u.request.u.new_process_ns.system_messages
+                     , msg->u.request.u.new_process_ns.pathStrId.nid
+                     , msg->u.request.u.new_process_ns.pathStrId.id
+                     , msg->u.request.u.new_process_ns.ldpathStrId.nid
+                     , msg->u.request.u.new_process_ns.ldpathStrId.id
+                     , msg->u.request.u.new_process_ns.programStrId.nid
+                     , msg->u.request.u.new_process_ns.programStrId.id
+                     , msg->u.request.u.new_process_ns.port_name
+                     , msg->u.request.u.new_process_ns.argc
+                     //, msg->u.request.u.new_process_ns.argv
+                     , msg->u.request.u.new_process_ns.infile
+                     , msg->u.request.u.new_process_ns.outfile
+                     , msg->u.request.u.new_process_ns.creation_time.tv_sec
+                     , msg->u.request.u.new_process_ns.creation_time.tv_nsec
                      );
      }
  

http://git-wip-us.apache.org/repos/asf/trafodion/blob/010e563d/core/sqf/monitor/linux/nsreqnewproc.cxx
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/nsreqnewproc.cxx
index 76d289c,92a7634..682823b
--- a/core/sqf/monitor/linux/nsreqnewproc.cxx
+++ b/core/sqf/monitor/linux/nsreqnewproc.cxx
@@@ -81,34 -83,12 +84,31 @@@ void CExtNewProcNsReq::performRequest(
      lnode = Nodes->GetLNode( nid_ );
      node = lnode->GetNode();
      parent_lnode = Nodes->GetLNode( msg_->u.request.u.new_process_ns.parent_nid );
 -    parent_node = NULL;
      if ( parent_lnode )
          parent_node = parent_lnode->GetNode();
 -    CProcess *parent = NULL;
 +    else
 +        parent_node = NULL;
-     strId_t pathStrId = node->GetStringId ( msg_->u.request.u.new_process_ns.path );
-     strId_t ldpathStrId = node->GetStringId (msg_->u.request.u.new_process_ns.ldpath );
-     strId_t programStrId = node->GetStringId ( msg_->u.request.u.new_process_ns.program );
      if ( parent_node )
          parent = parent_node->GetProcess( msg_->u.request.u.new_process_ns.parent_pid );
 +    else
 +        parent = NULL;
 +    if ( parent )
 +    {
 +        int parentVerifier = msg_->u.request.u.new_process_ns.parent_verifier;
 +
 +        if ( (parentVerifier == -1) || 
 +             (parentVerifier == parent->GetVerifier()) )
 +        {
 +            if ( msg_->u.request.u.new_process_ns.backup && 
 +                (parent->GetPairParentNid() == -1 && 
 +                 parent->GetPairParentPid() == -1))
 +            {
 +                parent->SetPairParentNid( msg_->u.request.u.new_process_ns.pair_parent_nid );
 +                parent->SetPairParentPid( msg_->u.request.u.new_process_ns.pair_parent_pid );
 +                parent->SetPairParentVerifier( msg_->u.request.u.new_process_ns.pair_parent_verifier );
 +            }
 +        }
 +    }
      CProcess *process = node->CreateProcess ( parent,
                                                msg_->u.request.u.new_process_ns.nid,
                                                msg_->u.request.u.new_process_ns.pid,

http://git-wip-us.apache.org/repos/asf/trafodion/blob/010e563d/core/sqf/monitor/linux/nsreqqueue.cxx
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/trafodion/blob/010e563d/core/sqf/monitor/linux/process.cxx
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/process.cxx
index 29a115b,017ce76..b599840
--- a/core/sqf/monitor/linux/process.cxx
+++ b/core/sqf/monitor/linux/process.cxx
@@@ -542,14 -545,17 +543,17 @@@ bool CProcess::procExitReg(CProcess *ta
      {   // This process is not the parent of the target process (parent
          // processes automatically get process death notifications.)
  
-         // Add entry to list of processes that are being monitored
-         // by this process.
          nidPid_t target = { targetProcess->Nid, targetProcess->Pid };
          deathInterestLock_.lock();
-         deathInterest_.push_back ( target );
+         // Add entry to list of processes that are being monitored
+         // by this process.
+         deathInterest_.push_back( target );
+         // Add entry to set of nids of processes that are being monitored
+         // by this process.
+         deathInterestNid_.insert( targetProcess->Nid );
          deathInterestLock_.unlock();
  
 -        // Register interest with the target process 
 +        // Register interest with the target process
          targetProcess->RegisterDeathNotification( Nid
                                                  , Pid
                                                  , Verifier
@@@ -4411,13 -4598,13 +4594,13 @@@ void CProcessContainer::Child_Exit ( CP
              {
  
                  if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
 -                    trace_printf("%s@%d - Child process %s (%d, %d:%d) exits due "
 -                                 "to parent death (%d, %d:%d)\n",
 +                    trace_printf("%s@%d - Child process %s (%d, %d) exits due "
 +                                 "to parent death (%d, %d)\n",
                                   method_name, __LINE__, process->GetName(),
 -                                 process->GetNid(), process->GetPid(), process->GetVerifier(),
 -                                 parent->GetNid(), parent->GetPid(), parent->GetVerifier());
 -                
 +                                 process->GetNid(), process->GetPid(),
 +                                 parent->GetNid(), parent->GetPid());
 +
-                 childNode->SetProcessState( process, State_Down, true );
+                 childLNode->SetProcessState( process, State_Down, true );
                  if ( !process->IsClone() )
                  {
                      if ( parent->GetType() == ProcessType_SPX )
@@@ -4426,9 -4613,22 +4609,22 @@@
                      }
                      else
                      {
 -                        kill (process->GetPid(), Monitor->GetProcTermSig()); 
 +                        kill (process->GetPid(), Monitor->GetProcTermSig());
                      }
                  }
+                 else
+                 {
+                     if (NameServerEnabled)
+                     {
 -                        CNode  *childNode = childLNode->GetNode();
++                        CNode  *childNode = childNode->GetNode();
+                         // Forward the process create to the target node
+                         PtpClient->ProcessKill( process
+                                               , process->GetAbort()
+                                               , childLNode->GetNid()
+                                               , childNode->GetName());
+                     }
+                 }
+                 
                  if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
                      trace_printf("%s@%d - Completed kill for child process %s (%d, %d)\n", method_name, __LINE__, process->GetName(), process->GetNid(), process->GetPid());
              }
@@@ -4964,13 -5165,11 +5161,11 @@@ CProcess * CProcessContainer::ParentNew
      // If we have a parent process then it is expecting a reply
      if (parent && !parent->IsClone() && !parent->IsPaired())
      {
- #ifndef NAMESERVER_PROCESS
          if (!process->IsNowait())
          {   // The new process request was "waited" so send reply now
- #endif
              struct message_def *reply_msg;
              reply_msg = process->parentContext();
 - 
 +
              if ( reply_msg )
              {
                  // send reply to the parent
@@@ -4985,8 -5183,7 +5179,7 @@@
          {   // The new process request was "no-wait" so send notice now
              process->SendProcessCreatedNotice(parent, result);
          }
- #endif
 -    }  
 +    }
  
      TRACE_EXIT;
  
@@@ -5096,14 -5293,9 +5289,9 @@@ void CProcessContainer::Exit_Process (C
              {
                  if (!process->IsClone() && !MyNode->isInQuiesceState())
                  {
 -                    if (!NameServerEnabled)
 +                    // Replicate the exit to other nodes
- //TRK-TODO
-             //        if (NameServerEnabled)
-                     {
-                         //message to monitor
-                     }
-             //        else
                      {
+                         // Replicate the exit to other nodes
                          CReplExit *repl = new CReplExit(process->GetNid(),
                                                      process->GetPid(),
                                                      process->GetVerifier(),

http://git-wip-us.apache.org/repos/asf/trafodion/blob/010e563d/core/sqf/monitor/linux/reqprocinfo.cxx
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/trafodion/blob/010e563d/core/sqf/monitor/linux/reqqueue.cxx
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/reqqueue.cxx
index a6b22a3,5c0c77f..184c694
--- a/core/sqf/monitor/linux/reqqueue.cxx
+++ b/core/sqf/monitor/linux/reqqueue.cxx
@@@ -1208,16 -1408,18 +1408,20 @@@ void CIntNewProcReq::performRequest(
                      MyNode->AddToNameMap( newProcess );
                      MyNode->AddToPidMap( newProcess->GetPid(),  newProcess );
  
 -                    // Successfully forked process
 -                    if (NameServerEnabled)
 +                    // Successfully forked process.  Replicate actual process
 +                    // id and process name.
 +
 +//TRK-TODO
 +              /*      if (NameServerEnabled)
                      {
-                         PtpClient->ProcessInit(newProcess, reqTag_, 0, parentNid_, lnode->GetNode()->GetName());
+                         // Send actual pid and process name back to parent
+                         PtpClient->ProcessInit( newProcess
+                                               , reqTag_
+                                               , 0
+                                               , parentNid_ );
                      }
                      else
 -                    {                    
 -                        // Replicate actual pid and process name
 +             */       {
                          CReplProcInit *repl
                              = new CReplProcInit(newProcess, reqTag_, 0, parentNid_);
                          Replicator.addItem(repl);
@@@ -1230,14 -1432,23 +1434,23 @@@
                  }
              }
  
- //TRK-TODO
              if (  newProcess == NULL )
 -            {  
 +            {
                  // Process creation failure, relay error code to node
                  // that requested process creation.
-                 CReplProcInit *repl = new CReplProcInit(newProcess, reqTag_,
-                                                         result, parentNid_);
-                 Replicator.addItem(repl);
+                 if (NameServerEnabled)
+                 {
+                     PtpClient->ProcessInit( newProcess
+                                           , reqTag_
+                                           , result
+                                           , parentNid_ );
+                 }
+                 else
+                 {
+                     CReplProcInit *repl = new CReplProcInit(newProcess, reqTag_,
+                                                             result, parentNid_);
+                     Replicator.addItem(repl);
+                 }
              }
  #endif
          }
@@@ -4380,89 -4863,91 +4900,91 @@@ const bool CReqQueue::reqConcurrent[] 
  
  // Request names used for trace output
  const char * CReqQueue::svcReqType[] = {
-     "",
-     "Close",
-     "DeleteNs",
-     "Dump",
-     "Event",
-     "Exit",
-     "Get",
-     "Kill",
-     "MonStats",
-     "Mount",
-     "NameServerAdd",
-     "NameServerDelete",
-     "NameServerStart",
-     "NameServerStop",
-     "NewProcess",
-     "NewProcessNs",
-     "NodeAdd",
-     "NodeDelete",
-     "NodeDown",
-     "NodeInfo",
-     "NodeName",
-     "NodeUp",
-     "Notice",
-     "Notify",
-     "Open",
-     "OpenInfo",
-     "PersistAdd",
-     "PersistDelete",
-     "PNodeInfo",
-     "ProcessInfo",
-     "ProcessInfoCont",
-     "Set",
-     "Shutdown",
-     "ShutdownNs",
-     "Startup",
-     "Stfsd",
-     "TmLeader",
-     "TmReady",
-     "TmSync",
-     "TransInfo",
-     "ZoneInfo"
+     "",                 // unused, request types start at 1
+     "Close",            // ReqType_Close
+     "DelProcessNs",     // ReqType_DelProcessNs
+     "Dump",             // ReqType_Dump
+     "Event",            // ReqType_Event
+     "Exit",             // ReqType_Exit
+     "Get",              // ReqType_Get
+     "Kill",             // ReqType_Kill
+     "MonStats",         // ReqType_MonStats
+     "Mount",            // ReqType_Mount
+     "NameServerAdd",    // ReqType_NameServerAdd
+     "NameServerDelete", // ReqType_NameServerDelete
+     "NameServerStart",  // ReqType_NameServerStart
+     "NameServerStop",   // ReqType_NameServerStop
+     "NewProcess",       // ReqType_NewProcess
+     "NewProcessNs",     // ReqType_NewProcessNs
+     "NodeAdd",          // ReqType_NodeAdd
+     "NodeDelete",       // ReqType_NodeDelete
+     "NodeDown",         // ReqType_NodeDown
+     "NodeInfo",         // ReqType_NodeInfo
+     "NodeName",         // ReqType_NodeName
+     "NodeUp",           // ReqType_NodeUp
+     "Notice",           // ReqType_Notice -- not an actual request
+     "Notify",           // ReqType_Notify
+     "Open",             // ReqType_Open
+     "OpenInfo",         // ReqType_OpenInfo
+     "PersistAdd",       // ReqType_PersistAdd
+     "PersistDelete",    // ReqType_PersistDelete
+     "PNodeInfo",        // ReqType_PNodeInfo
+     "ProcessInfo",      // ReqType_ProcessInfo
+     "ProcessInfoCont",  // ReqType_ProcessInfoCont
+     "ProcessInfoNs",    // ReqType_ProcessInfoNs
+     "Set",              // ReqType_Set
+     "Shutdown",         // ReqType_Shutdown
+     "ShutdownNs",       // ReqType_ShutdownNs
+     "Startup",          // ReqType_Startup
+     "Stfsd",            // ReqType_Stfsd
+     "TmLeader",         // ReqType_TmLeader
+     "TmReady",          // ReqType_TmReady
+     "TmSync",           // ReqType_TmSync
+     "TransInfo",        // ReqType_TransInfo
+     "ZoneInfo"          // ReqType_ZoneInfo
+     "Invalid"           // ReqType_Invalid
  };
  
 -// Must match internal.h:InternalType 
 +// Must match internal.h:InternalType
  const char * CReqQueue::intReqType[] = {
-       ""
-     , "ActivateSpare"
-     , "Clone"
-     , "Device"
-     , "Down"
-     , "Dump"
-     , "DumpComplete"
-     , "Event"
-     , "Exit"
-     , "IoData"
-     , "Kill"
-     , "NameServerAdd"
-     , "NameServerDelete"
-     , "NodeAdd"
-     , "NodeAdded"
-     , "NodeDelete"
-     , "NodeDeleted"
-     , "NodeName"
-     , "Notify"
-     , "PersistAdd"
-     , "PersistDelete"
-     , "Process"
-     , "ProcessInit"
-     , "Open"
-     , "Set"
-     , "StdinReq"
-     , "Sync"
-     , "Up"
-     , "CreatePrimitives"
-     , "Quiesce"
-     , "PostQuiesce"
-     , "Revive"
-     , "Snapshot"
-     , "UniqStr"
-     , "TMReady"
-     , "Shutdown"
-     , "SchedData"
-     , "SoftNodeDown"
-     , "SoftNodeUp"
+       ""                  // InternalType_Null
+     , "ActivateSpare"     // InternalType_ActivateSpare
+     , "Clone"             // InternalType_Clone
+     , "Device"            // InternalType_Device
+     , "Down"              // InternalType_Down
+     , "Dump"              // InternalType_Dump
+     , "DumpComplete"      // InternalType_DumpComplete
+     , "Event"             // InternalType_Event
+     , "Exit"              // InternalType_Exit
+     , "IoData"            // InternalType_IoData
+     , "Kill"              // InternalType_Kill
+     , "NameServerAdd"     // InternalType_NameServerAdd
+     , "NameServerDelete"  // InternalType_NameServerDelete
+     , "NodeAdd"           // InternalType_NodeAdd
+     , "NodeAdded"         // InternalType_NodeAdded
+     , "NodeDelete"        // InternalType_NodeDelete
+     , "NodeDeleted"       // InternalType_NodeDeleted
+     , "NodeName"          // InternalType_NodeName
+     , "Notify"            // InternalType_Notify
+     , "PersistAdd"        // InternalType_PersistAdd
+     , "PersistDelete"     // InternalType_PersistDelete
+     , "Process"           // InternalType_Process
+     , "ProcessInit"       // InternalType_ProcessInit
+     , "Open"              // InternalType_Open
+     , "Set"               // InternalType_Set
+     , "StdinReq"          // InternalType_StdinReq
+     , "Sync"              // InternalType_Sync
+     , "Up"                // InternalType_Up
+     , "CreatePrimitives"  // InternalType_CreatePrimitives
+     , "Quiesce"           // InternalType_Quiesce
+     , "PostQuiesce"       // InternalType_PostQuiece
+     , "Revive"            // InternalType_Revive
+     , "Snapshot"          // InternalType_Snapshot
+     , "UniqStr"           // InternalType_UniqStr
+     , "TMReady"           // InternalType_TmReady
+     , "Shutdown"          // InternalType_Shutdown
+     , "SchedData"         // InternalType_SchedData
+     , "SoftNodeDown"      // InternalType_SoftNodeDown
+     , "SoftNodeUp"        // InternalType_SoftNodeUp
  };
  


[23/50] [abbrv] trafodion git commit: Merge branch 'TRAFODION-2884' of github.com:zcorrea/trafodion into TRAFODION-2884

Posted by su...@apache.org.
Merge branch 'TRAFODION-2884' of github.com:zcorrea/trafodion into TRAFODION-2884


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

Branch: refs/heads/master
Commit: 7d6c0dd3f28dfd3edae5bf2a9f5cd16adad651a3
Parents: 297681c d5742be
Author: Zalo Correa <za...@esgyn.com>
Authored: Fri Apr 6 14:19:20 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Fri Apr 6 14:19:20 2018 -0700

----------------------------------------------------------------------
 core/sqf/monitor/linux/nscommacceptmon.cxx | 2 ++
 core/sqf/monitor/linux/process.cxx         | 5 +++++
 core/sqf/src/seabed/test/gosetupcl3        | 5 ++++-
 3 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/7d6c0dd3/core/sqf/monitor/linux/process.cxx
----------------------------------------------------------------------


[36/50] [abbrv] trafodion git commit: Fixes to Name Server replication logic.

Posted by su...@apache.org.
Fixes to Name Server replication logic.


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

Branch: refs/heads/master
Commit: 1f7eabb0b8327e07eda4727071f8dcda1d307df8
Parents: 3931a75
Author: Zalo Correa <za...@esgyn.com>
Authored: Wed May 16 19:12:26 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Wed May 16 19:12:26 2018 -0700

----------------------------------------------------------------------
 .../export/include/common/evl_sqlog_eventnum.h  |   1 +
 core/sqf/export/include/trafconf/trafconfig.h   |   2 -
 core/sqf/monitor/linux/cluster.cxx              |  65 +++-
 core/sqf/monitor/linux/cluster.h                |   2 +
 core/sqf/monitor/linux/internal.h               |  22 +-
 core/sqf/monitor/linux/monitor.cxx              | 188 ++++++++--
 core/sqf/monitor/linux/msgdef.h                 |  36 +-
 core/sqf/monitor/linux/nameserver.cxx           |  96 ++++-
 core/sqf/monitor/linux/nscommacceptmon.cxx      |  56 ++-
 core/sqf/monitor/linux/nsprocess.cxx            |  29 +-
 core/sqf/monitor/linux/nsreqnewproc.cxx         |   9 +-
 core/sqf/monitor/linux/nsreqprocinfons.cxx      |  30 +-
 core/sqf/monitor/linux/pnode.cxx                |  25 +-
 core/sqf/monitor/linux/pnode.h                  |   2 +
 core/sqf/monitor/linux/process.cxx              |  76 +++-
 core/sqf/monitor/linux/process.h                |  36 +-
 core/sqf/monitor/linux/replicate.cxx            | 130 ++++++-
 core/sqf/monitor/linux/replicate.h              |  10 +
 core/sqf/monitor/linux/reqqueue.cxx             | 357 ++++++++++++++++---
 core/sqf/monitor/linux/reqqueue.h               | 128 +++++--
 core/sqf/monitor/linux/zclient.cxx              |   5 +-
 21 files changed, 1079 insertions(+), 226 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/1f7eabb0/core/sqf/export/include/common/evl_sqlog_eventnum.h
----------------------------------------------------------------------
diff --git a/core/sqf/export/include/common/evl_sqlog_eventnum.h b/core/sqf/export/include/common/evl_sqlog_eventnum.h
index 2d630c9..1f4d166 100644
--- a/core/sqf/export/include/common/evl_sqlog_eventnum.h
+++ b/core/sqf/export/include/common/evl_sqlog_eventnum.h
@@ -738,6 +738,7 @@
 #define MON_INTREQ_EXIT_1                   101181701
 #define MON_INTREQ_NEWPROC_1                101181801
 #define MON_INTREQ_NEWPROC_2                101181802
+#define MON_INTREQ_NEWPROC_3                101181803
 #define MON_INTREQ_NOTIFY_1                 101181901
 #define MON_INTREQ_NOTIFY_2                 101181902
 #define MON_INTREQ_NOTIFY_3                 101181903

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1f7eabb0/core/sqf/export/include/trafconf/trafconfig.h
----------------------------------------------------------------------
diff --git a/core/sqf/export/include/trafconf/trafconfig.h b/core/sqf/export/include/trafconf/trafconfig.h
index 2eba1c8..4661840 100644
--- a/core/sqf/export/include/trafconf/trafconfig.h
+++ b/core/sqf/export/include/trafconf/trafconfig.h
@@ -111,7 +111,6 @@ typedef enum {
 } TcZoneType_t;
 
 typedef enum {
-//enum TC_STORAGE_TYPE {
       TCDBSTOREUNDEFINED = 0     
     , TCDBMYSQL          = 1 // MySQL Database
     , TCDBPOSTGRESQL     = 2 // PostgresQL Database   [TBD]
@@ -119,7 +118,6 @@ typedef enum {
 } TcStorageType_t;
 
 typedef enum {
-//enum TC_ERRORS {
       TCSUCCESS = 0         // Successful operation
     , TCNOTIMPLEMENTED = -1 // Not implemented
     , TCNOTINIT = -2        // Database not open

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1f7eabb0/core/sqf/monitor/linux/cluster.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/cluster.cxx b/core/sqf/monitor/linux/cluster.cxx
index a7ccdf1..8768d2e 100644
--- a/core/sqf/monitor/linux/cluster.cxx
+++ b/core/sqf/monitor/linux/cluster.cxx
@@ -863,6 +863,8 @@ CCluster::CCluster (void)
       ,myMonConnCount_(0)
       ,minMonConnCount_(0)
       ,minMonConnPnid_(-1)
+#else
+      ,clusterProcCount_(0)
 #endif
 {
     int i;
@@ -2644,7 +2646,12 @@ void CCluster::HandleOtherNodeMsg (struct internal_msg_def *recv_msg,
         if ( MyNode->IsMyNode(recv_msg->u.process.nid) )
         {   // Need to create process on this node.
             // Queue process creation request for handling by worker thread
+#ifdef NAMESERVER_PROCESS
+            ReqQueue.enqueueNewProcNsReq( &recv_msg->u.process );
+#endif
+#ifndef NAMESERVER_PROCESS
             ReqQueue.enqueueNewProcReq( &recv_msg->u.process );
+#endif
         }
         break;
 
@@ -7056,6 +7063,8 @@ void CCluster::UpdateClusterState( bool &doShutdown,
             }
 #ifdef NAMESERVER_PROCESS
             nodestate[index].monConnCount = -1;
+#else
+            nodestate[index].monProcCount = 0;
 #endif
 
             continue;
@@ -7081,6 +7090,8 @@ void CCluster::UpdateClusterState( bool &doShutdown,
         nodestate[index].nodeMask    = recvBuf->nodeInfo.nodeMask;
 #ifdef NAMESERVER_PROCESS
         nodestate[index].monConnCount = recvBuf->nodeInfo.monConnCount;
+#else
+        nodestate[index].monProcCount = recvBuf->nodeInfo.monProcCount;
 #endif
 
         for ( int i =0; i < MAX_NODE_MASKS ; i++ )
@@ -7199,6 +7210,8 @@ void CCluster::UpdateClusterState( bool &doShutdown,
     nodestate[MyPNID].nodeMask = upNodes_;
 #ifdef NAMESERVER_PROCESS
     nodestate[MyPNID].monConnCount = Node[MyPNID]->GetMonConnCount();
+#else
+    nodestate[MyPNID].monProcCount = Node[MyPNID]->GetNumProcs();
 #endif
 
     // Examine status returned from MPI receive requests
@@ -7263,6 +7276,8 @@ void CCluster::UpdateClusterState( bool &doShutdown,
                 }
 #ifdef NAMESERVER_PROCESS
                 nodestate[index].monConnCount = -1;
+#else
+                nodestate[index].monProcCount = 0;
 #endif
 
                 if ( validateNodeDown_ )
@@ -7466,6 +7481,15 @@ void CCluster::UpdateClusterState( bool &doShutdown,
     myMonConnCount_ = nodestate[MyPNID].monConnCount;
     minMonConnCount_ = minConnCount;
     minMonConnPnid_ = minConnPnid;
+#else
+    if (NameServerEnabled)
+    {
+        clusterProcCount_ = 0;
+        for (int index = 0; index < GetConfigPNodesMax(); index++)
+        {
+            clusterProcCount_ += nodestate[index].monProcCount;
+        }
+    }
 #endif
 
     TRACE_EXIT;
@@ -7667,17 +7691,32 @@ bool CCluster::checkIfDone (  )
                      nameServerCount );
 
 #else
-    if (trace_settings & (TRACE_PROCESS | TRACE_PROCESS_DETAIL | TRACE_SYNC))
-        trace_printf("%s@%d - Node %d shutdown level=%d, state=%s.  Process "
-                     "count=%d, internal state=%d, currentNodes_=%d, "
-                     "local process count=%d\n",
-                     method_name, __LINE__, MyNode->GetPNid(),
-                     MyNode->GetShutdownLevel(),
-                     StateString(MyNode->GetState()),
-                     Nodes->ProcessCount(),
-                     MyNode->getInternalState(),
-                     currentNodes_, MyNode->GetNumProcs());
-
+    if (NameServerEnabled)
+    {
+        if (trace_settings & (TRACE_PROCESS | TRACE_PROCESS_DETAIL | TRACE_SYNC))
+            trace_printf("%s@%d - Node %d shutdown level=%d, state=%s.  Cluster process "
+                         "count=%d, internal state=%d, currentNodes_=%d, "
+                         "local process count=%d\n",
+                         method_name, __LINE__, MyNode->GetPNid(),
+                         MyNode->GetShutdownLevel(),
+                         StateString(MyNode->GetState()),
+                         clusterProcCount_,
+                         MyNode->getInternalState(),
+                         currentNodes_, MyNode->GetNumProcs());
+    }
+    else
+    {
+        if (trace_settings & (TRACE_PROCESS | TRACE_PROCESS_DETAIL | TRACE_SYNC))
+            trace_printf("%s@%d - Node %d shutdown level=%d, state=%s.  Process "
+                         "count=%d, internal state=%d, currentNodes_=%d, "
+                         "local process count=%d\n",
+                         method_name, __LINE__, MyNode->GetPNid(),
+                         MyNode->GetShutdownLevel(),
+                         StateString(MyNode->GetState()),
+                         Nodes->ProcessCount(),
+                         MyNode->getInternalState(),
+                         currentNodes_, MyNode->GetNumProcs());
+    }
 #endif            
     // Check if we are also done
     if (( MyNode->GetState() != State_Down    ) &&
@@ -7704,7 +7743,7 @@ bool CCluster::checkIfDone (  )
             if ( NameServerEnabled )
             {
                 
-                if ( Nodes->ProcessCount() == 0 )  // all Name Servers exited
+                if ( clusterProcCount_ == 0 )  // all Name Servers exited
                 {
                     if (trace_settings & (TRACE_PROCESS | TRACE_PROCESS_DETAIL | TRACE_SYNC))
                        trace_printf("%s@%d - Monitor signaled to exit.\n", method_name, __LINE__);
@@ -7714,7 +7753,7 @@ bool CCluster::checkIfDone (  )
                     // we need to sync one more time so other nodes see our state
                     return false;
                 }
-                else if ( (Nodes->ProcessCount() <= 
+                else if ( (clusterProcCount_ <= 
                             (currentNodes_ * (MAX_PRIMITIVES+1)) ) // only WDGs and Name Servers alive
                           && (MyNode->GetNumProcs() <=
                             (MAX_PRIMITIVES+1) )                   // only WDGs and Name Servers alive

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1f7eabb0/core/sqf/monitor/linux/cluster.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/cluster.h b/core/sqf/monitor/linux/cluster.h
index 9d0925f..1d7e1ac 100644
--- a/core/sqf/monitor/linux/cluster.h
+++ b/core/sqf/monitor/linux/cluster.h
@@ -388,6 +388,8 @@ private:
     int myMonConnCount_;
     int minMonConnCount_;
     int minMonConnPnid_;
+#else
+    int clusterProcCount_;
 #endif
 
     int Allgather(int nbytes, void *sbuf, char *rbuf, int tag, MPI_Status *stats);

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1f7eabb0/core/sqf/monitor/linux/internal.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/internal.h b/core/sqf/monitor/linux/internal.h
index 6329fc7..35fa32a 100644
--- a/core/sqf/monitor/linux/internal.h
+++ b/core/sqf/monitor/linux/internal.h
@@ -127,9 +127,15 @@ struct clone_def
     int  argc;             // number of command line arguments
     struct timespec creation_time;      // process creation time
 
+#ifdef NAMESERVER_PROCESS
+    int  pathLen;
+    int  ldpathLen;
+    int  programLen;
+#else
     strId_t pathStrId;     // program lookup path (string id)
     strId_t ldpathStrId;   // library load path (string id)
     strId_t programStrId;  // full path to object file (string id)
+#endif
 
     int  nameLen;
     int  portLen;
@@ -296,7 +302,6 @@ struct node_name_def
     char new_name[MPI_MAX_PROCESSOR_NAME];
 };
 
-
 struct notify_def
 {
     int nid;                    // Node id of process being notified
@@ -309,7 +314,6 @@ struct notify_def
     _TM_Txid_External trans_id; // Associated TransID
 };
 
-
 struct process_def
 {
     bool backup;           // true for a backup process
@@ -328,12 +332,16 @@ struct process_def
     int pair_parent_pid;   // process id of real process pair parent process
     Verifier_t pair_parent_verifier; // process id of real process pair parent process
     int  argc;             // number of command line arguments
-
+    void *tag;             // process tag
+#ifdef NAMESERVER_PROCESS
+    int  pathLen;
+    int  ldpathLen;
+    int  programLen;
+#else
     strId_t pathStrId;     // program lookup path (string id)
     strId_t ldpathStrId;   // library load path (string id)
     strId_t programStrId;  // full path to object file (string id)
-
-    void *tag;             // process tag
+#endif
     int  nameLen;
     int  argvLen;
     int  infileLen;
@@ -341,8 +349,6 @@ struct process_def
     char stringData;       // variable length string data
 };
 
-
-
 struct process_init_def
 {
     int nid;             // Node id of child process
@@ -513,6 +519,8 @@ typedef struct cluster_state_def
     upNodes_t nodeMask;                 // Set of nodes currently "up"
 #ifdef NAMESERVER_PROCESS
     int monConnCount;                   // monitor connections
+#else
+    int monProcCount;                   // number of processes
 #endif
 } cluster_state_def_t;
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1f7eabb0/core/sqf/monitor/linux/monitor.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/monitor.cxx b/core/sqf/monitor/linux/monitor.cxx
index 17ed27d..6757f2c 100755
--- a/core/sqf/monitor/linux/monitor.cxx
+++ b/core/sqf/monitor/linux/monitor.cxx
@@ -606,9 +606,11 @@ char * CMonitor::ProcCopy(char *bufPtr, CProcess *process)
     procObj->priority = process->GetPriority();
     procObj->backup = process->IsBackup();
     procObj->unhooked = process->IsUnhooked();
+#ifndef NAMESERVER_PROCESS
     procObj->pathStrId = process->pathStrId();
     procObj->ldpathStrId = process->ldPathStrId();
     procObj->programStrId = process->programStrId();
+#endif
     procObj->os_pid = process->GetPid();
     procObj->verifier = process->GetVerifier();
     procObj->prior_pid = process->GetPriorPid ();
@@ -658,6 +660,47 @@ char * CMonitor::ProcCopy(char *bufPtr, CProcess *process)
         procObj->portLen = 0;
     }
 
+#ifdef NAMESERVER_PROCESS
+    if (strlen(process->path()))
+    {
+        // Copy the path
+        procObj->pathLen = strlen(process->path()) + 1;
+        memcpy(stringData, process->path(),  procObj->pathLen );
+        stringData += procObj->pathLen;
+        stringDataLen = procObj->pathLen;
+    }
+    else
+    {
+        procObj->pathLen = 0;
+    }
+
+    if (strlen(process->ldpath()))
+    {
+        // Copy the ldpath
+        procObj->ldpathLen = strlen(process->ldpath()) + 1;
+        memcpy(stringData, process->ldpath(),  procObj->ldpathLen );
+        stringData += procObj->ldpathLen;
+        stringDataLen = procObj->ldpathLen;
+    }
+    else
+    {
+        procObj->ldpathLen = 0;
+    }
+
+    if (strlen(process->program()))
+    {
+        // Copy the program
+        procObj->programLen = strlen(process->program()) + 1;
+        memcpy(stringData, process->program(),  procObj->programLen );
+        stringData += procObj->programLen;
+        stringDataLen = procObj->programLen;
+    }
+    else
+    {
+        procObj->programLen = 0;
+    }
+#endif
+    
     if (process->IsPersistent())
     {
         if (strlen(process->infile()))
@@ -696,28 +739,6 @@ char * CMonitor::ProcCopy(char *bufPtr, CProcess *process)
         }
 
         procObj->persistent = true;
-
-        if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
-                trace_printf( "%s@%d - Packing process string data:\n"
-                              "        name(%d)       =%s\n"
-                              "        port(%d)       =%s\n"
-                              "        infile(%d)     =%s\n"
-                              "        outfile(%d)    =%s\n"
-                              "        userArgv(%d)   =%s\n"
-                              "        stringData(%d) =%s\n"
-                            , method_name, __LINE__
-                            , procObj->nameLen
-                            , process->GetName()
-                            , procObj->portLen
-                            , process->GetPort()
-                            , procObj->infileLen
-                            , process->infile()
-                            , procObj->outfileLen
-                            , process->outfile()
-                            , procObj->argvLen
-                            , procObj->argvLen?process->userArgv():""
-                            , stringDataLen
-                            , stringDataLen?&procObj->stringData:"" );
     }
     else
     {
@@ -727,6 +748,61 @@ char * CMonitor::ProcCopy(char *bufPtr, CProcess *process)
         procObj->persistent = false;
     }
 
+#ifdef NAMESERVER_PROCESS
+    if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
+            trace_printf( "%s@%d - Packing process string data:\n"
+                          "        name(%d)       =%s\n"
+                          "        port(%d)       =%s\n"
+                          "        path(%d)       =%s\n"
+                          "        ldpath(%d)     =%s\n"
+                          "        program(%d)    =%s\n"
+                          "        infile(%d)     =%s\n"
+                          "        outfile(%d)    =%s\n"
+                          "        userArgv(%d)   =%s\n"
+                          "        stringData(%d) =%s\n"
+                        , method_name, __LINE__
+                        , procObj->nameLen
+                        , process->GetName()
+                        , procObj->portLen
+                        , process->GetPort()
+                        , procObj->pathLen
+                        , process->path()
+                        , procObj->ldpathLen
+                        , process->ldpath()
+                        , procObj->programLen
+                        , process->program()
+                        , procObj->infileLen
+                        , process->infile()
+                        , procObj->outfileLen
+                        , process->outfile()
+                        , procObj->argvLen
+                        , procObj->argvLen?process->userArgv():""
+                        , stringDataLen
+                        , stringDataLen?&procObj->stringData:"" );
+#else
+    if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
+            trace_printf( "%s@%d - Packing process string data:\n"
+                          "        name(%d)       =%s\n"
+                          "        port(%d)       =%s\n"
+                          "        infile(%d)     =%s\n"
+                          "        outfile(%d)    =%s\n"
+                          "        userArgv(%d)   =%s\n"
+                          "        stringData(%d) =%s\n"
+                        , method_name, __LINE__
+                        , procObj->nameLen
+                        , process->GetName()
+                        , procObj->portLen
+                        , process->GetPort()
+                        , procObj->infileLen
+                        , process->infile()
+                        , procObj->outfileLen
+                        , process->outfile()
+                        , procObj->argvLen
+                        , procObj->argvLen?process->userArgv():""
+                        , stringDataLen
+                        , stringDataLen?&procObj->stringData:"" );
+#endif
+
     TRACE_EXIT;
     return stringData;
 }
@@ -802,6 +878,11 @@ void CMonitor::UnpackProcObjs( char *&buffer, int procCount )
     CNode * node = NULL;
     CProcess * process = NULL;
     int  stringDataLen;
+#ifdef NAMESERVER_PROCESS
+    char *path = NULL;
+    char *ldpath = NULL;
+    char *program = NULL;
+#endif
     char *name = NULL;
     char *port = NULL;
     char *infile = NULL;
@@ -824,7 +905,7 @@ void CMonitor::UnpackProcObjs( char *&buffer, int procCount )
 
         if (procObj->nameLen)
         {
-            name = &procObj->stringData;
+            name = &stringData[stringDataLen];
             stringDataLen += procObj->nameLen;
         }
 
@@ -834,6 +915,26 @@ void CMonitor::UnpackProcObjs( char *&buffer, int procCount )
             stringDataLen += procObj->portLen;
         }
 
+#ifdef NAMESERVER_PROCESS
+        if (procObj->pathLen)
+        {
+            path = &stringData[stringDataLen];
+            stringDataLen += procObj->pathLen;
+        }
+
+        if (procObj->ldpathLen)
+        {
+            ldpath = &stringData[stringDataLen];
+            stringDataLen += procObj->ldpathLen;
+        }
+
+        if (procObj->programLen)
+        {
+            program = &stringData[stringDataLen];
+            stringDataLen += procObj->programLen;
+        }
+#endif
+
         if (procObj->infileLen)
         {
             infile = &stringData[stringDataLen];
@@ -852,6 +953,40 @@ void CMonitor::UnpackProcObjs( char *&buffer, int procCount )
             stringDataLen += procObj->argvLen;
         }
 
+#ifdef NAMESERVER_PROCESS
+        if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
+                trace_printf( "%s@%d - Unpacking process string data:\n"
+                              "        stringData(%d) =%s\n"
+                              "        name(%d)       =%s\n"
+                              "        port(%d)       =%s\n"
+                              "        path(%d)       =%s\n"
+                              "        ldpath(%d)     =%s\n"
+                              "        program(%d)    =%s\n"
+                              "        infile(%d)     =%s\n"
+                              "        outfile(%d)    =%s\n"
+                              "        userArgc       =%d\n"
+                              "        userArgv(%d)   =%s\n"
+                            , method_name, __LINE__
+                            , stringDataLen
+                            , stringDataLen?&procObj->stringData:""
+                            , procObj->nameLen
+                            , procObj->nameLen?name:""
+                            , procObj->portLen
+                            , procObj->portLen?port:""
+                            , procObj->pathLen
+                            , procObj->pathLen?path:""
+                            , procObj->ldpathLen
+                            , procObj->ldpathLen?ldpath:""
+                            , procObj->programLen
+                            , procObj->programLen?program:""
+                            , procObj->infileLen
+                            , procObj->infileLen?infile:""
+                            , procObj->outfileLen
+                            , procObj->outfileLen?outfile:""
+                            , procObj->argc
+                            , procObj->argvLen
+                            , procObj->argvLen?userargv:"" );
+#else
         if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
                 trace_printf( "%s@%d - Unpacking process string data:\n"
                               "        stringData(%d) =%s\n"
@@ -875,6 +1010,7 @@ void CMonitor::UnpackProcObjs( char *&buffer, int procCount )
                             , procObj->argc
                             , procObj->argvLen
                             , procObj->argvLen?userargv:"" );
+#endif
 
         process = node->CloneProcess (procObj->nid,
                                       procObj->type,
@@ -890,9 +1026,15 @@ void CMonitor::UnpackProcObjs( char *&buffer, int procCount )
                                       procObj->parent_verifier,
                                       procObj->event_messages,
                                       procObj->system_messages,
+#ifdef NAMESERVER_PROCESS
+                                      path,
+                                      ldpath,
+                                      program,
+#else
                                       procObj->pathStrId,
                                       procObj->ldpathStrId,
                                       procObj->programStrId,
+#endif
                                       procObj->infileLen?infile:(char *)"",
                                       procObj->outfileLen?outfile:(char *)"",
                                       &procObj->creation_time,

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1f7eabb0/core/sqf/monitor/linux/msgdef.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/msgdef.h b/core/sqf/monitor/linux/msgdef.h
index ca76fc1..639c15c 100644
--- a/core/sqf/monitor/linux/msgdef.h
+++ b/core/sqf/monitor/linux/msgdef.h
@@ -566,16 +566,17 @@ struct NewProcess_def
 
 struct NewProcessNs_def
 {
-    int   parent_nid;                       // parent's node id
-    int   parent_pid;                       // parent's process id
-    Verifier_t parent_verifier;             // parent's process verifier
-    int  pair_parent_nid;                   // node id of real process pair parent process
-    int  pair_parent_pid;                   // process id of real process pair parent process
-    Verifier_t pair_parent_verifier;        // process id of real process pair parent process
     int  nid;                               // node id
     int  pid;                               // process id
     Verifier_t verifier;                    // process verifier
+    char process_name[MAX_PROCESS_NAME];    // process name
     PROCESSTYPE type;                       // Identifies the process handling catagory
+    int  parent_nid;                        // parent's node id
+    int  parent_pid;                        // parent's process id
+    Verifier_t parent_verifier;             // parent's process verifier
+    int  pair_parent_nid;                   // node id of real process pair parent process
+    int  pair_parent_pid;                   // process id of real process pair parent process
+    Verifier_t pair_parent_verifier;        // process id of real process pair parent process
     int  priority;                          // Linux system priority
     int  debug;                             // if non-zero, starts processing using GDB
     int  backup;                            // if non-zero, starts process as backup
@@ -584,10 +585,12 @@ struct NewProcessNs_def
     bool event_messages;                    // true if want event messages
     bool system_messages;                   // true if want system messages
     long long tag;                          // user defined tag to be sent in completion notice
-    strId_t pathStrId;                      // program lookup path (string id)
-    strId_t ldpathStrId;                    // library load path (string id)
-    strId_t programStrId;                   // full path to object file (string id)
-    char process_name[MAX_PROCESS_NAME];    // process name
+//    strId_t pathStrId;                      // program lookup path (string id)
+//    strId_t ldpathStrId;                    // library load path (string id)
+//    strId_t programStrId;                   // full path to object file (string id)
+    char path[MAX_SEARCH_PATH];             // process's object lookup path to program
+    char ldpath[MAX_SEARCH_PATH];           // process's library load path for program
+    char program[MAX_PROCESS_PATH];         // full path to object file
     char port_name[MPI_MAX_PORT_NAME];      // mpi port name from MPI_Open_port
     int  argc;                              // number of additional command line argument
     char argv[MAX_ARGS][MAX_ARG_SIZE];      // array of additional command line arguments
@@ -978,6 +981,9 @@ struct ProcessInfoNs_reply_def
     int   parent_nid;                       // parent's node id
     int   parent_pid;                       // parent's process id
     Verifier_t parent_verifier;             // parent's process verifier
+    int  pair_parent_nid;                   // node id of real process pair parent process
+    int  pair_parent_pid;                   // process id of real process pair parent process
+    Verifier_t pair_parent_verifier;        // process id of real process pair parent process
     int  priority;                          // Linux system priority
     int  backup;                            // if non-zero, starts process as backup
     STATE state;                            // process's current state
@@ -985,10 +991,12 @@ struct ProcessInfoNs_reply_def
     bool event_messages;                    // true if want event messages
     bool system_messages;                   // true if want system messages
     long long tag;                          // user defined tag to be sent in completion notice
-    char  program[MAX_PROCESS_PATH];        // process's object file name
-    strId_t pathStrId;                      // program lookup path (string id)
-    strId_t ldpathStrId;                    // library load path (string id)
-    strId_t programStrId;                   // full path to object file (string id)
+//    strId_t pathStrId;                      // program lookup path (string id)
+//    strId_t ldpathStrId;                    // library load path (string id)
+//    strId_t programStrId;                   // full path to object file (string id)
+    char path[MAX_SEARCH_PATH];             // process's object lookup path to program
+    char ldpath[MAX_SEARCH_PATH];           // process's library load path for program
+    char program[MAX_PROCESS_PATH];         // program file name
     char port_name[MPI_MAX_PORT_NAME];      // mpi port name from MPI_Open_port
     int  argc;                              // number of additional command line argument
     char argv[MAX_ARGS][MAX_ARG_SIZE];      // array of additional command line arguments

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1f7eabb0/core/sqf/monitor/linux/nameserver.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nameserver.cxx b/core/sqf/monitor/linux/nameserver.cxx
index 690e23d..e9f1900 100644
--- a/core/sqf/monitor/linux/nameserver.cxx
+++ b/core/sqf/monitor/linux/nameserver.cxx
@@ -599,17 +599,83 @@ int CNameServer::ProcessNew(CProcess* process )
     msgnew->unhooked = process->IsUnhooked();
     msgnew->event_messages = process->IsEventMessages();
     msgnew->system_messages = process->IsSystemMessages();
-    msgnew->pathStrId = process->pathStrId();
-    msgnew->ldpathStrId = process->ldPathStrId();
-    msgnew->programStrId = process->programStrId();
+//    msgnew->pathStrId = process->pathStrId();
+//    msgnew->ldpathStrId = process->ldPathStrId();
+//    msgnew->programStrId = process->programStrId();
+    strcpy( msgnew->path, process->path() );
+    strcpy( msgnew->ldpath, process->ldpath() );
+    strcpy( msgnew->program, process->program() );
     strcpy( msgnew->process_name, process->GetName() );
     strcpy( msgnew->port_name, process->GetPort() );
     msgnew->argc = process->argc();
-    memcpy(msgnew->argv, process->userArgv(), process->userArgvLen());
+    process->getUserArgs(msgnew->argv);
     strcpy( msgnew->infile, process->infile() );
     strcpy( msgnew->outfile, process->outfile() );
     msgnew->creation_time = process->GetCreationTime();
 
+    if ( trace_settings & ( TRACE_NS | TRACE_REQUEST) )
+    {
+        trace_printf( "%s@%d - Received monitor request new-process data.\n"
+                      "        msg.new_process_ns.nid=%d\n"
+                      "        msg.new_process_ns.pid=%d\n"
+                      "        msg.new_process_ns.verifier=%d\n"
+                      "        msg.new_process_ns.process_name=%s\n"
+                      "        msg.new_process_ns.type=%d\n"
+                      "        msg.new_process_ns.parent_nid=%d\n"
+                      "        msg.new_process_ns.parent_pid=%d\n"
+                      "        msg.new_process_ns.parent_verifier=%d\n"
+                      "        msg.new_process_ns.pair_parent_nid=%d\n"
+                      "        msg.new_process_ns.pair_parent_pid=%d\n"
+                      "        msg.new_process_ns.pair_parent_verifier=%d\n"
+                      "        msg.new_process_ns.priority=%d\n"
+                      "        msg.new_process_ns.backup=%d\n"
+                      "        msg.new_process_ns.unhooked=%d\n"
+                      "        msg.new_process_ns.event_messages=%d\n"
+                      "        msg.new_process_ns.system_messages=%d\n"
+                      "        msg.new_process_ns.path=%s\n"
+                      "        msg.new_process_ns.ldpath=%s\n"
+                      "        msg.new_process_ns.program=%s\n"
+                      "        msg.new_process_ns.port=%s\n"
+                      "        msg.new_process_ns.infile=%s\n"
+                      "        msg.new_process_ns.outfile=%s\n"
+                      "        msg.new_process_ns.creation_time=%ld(secs):%ld(nsecs)\n"
+                    , method_name, __LINE__
+                    , msgnew->nid
+                    , msgnew->pid
+                    , msgnew->verifier
+                    , msgnew->process_name
+                    , msgnew->type
+                    , msgnew->parent_nid
+                    , msgnew->parent_pid
+                    , msgnew->parent_verifier
+                    , msgnew->pair_parent_nid
+                    , msgnew->pair_parent_pid
+                    , msgnew->pair_parent_verifier
+                    , msgnew->priority
+                    , msgnew->backup
+                    , msgnew->unhooked
+                    , msgnew->event_messages
+                    , msgnew->system_messages
+                    , msgnew->path
+                    , msgnew->ldpath
+                    , msgnew->program
+                    , msgnew->port_name
+                    , msgnew->infile
+                    , msgnew->outfile
+                    , msgnew->creation_time.tv_sec
+                    , msgnew->creation_time.tv_nsec
+                    );
+        trace_printf("%s@%d - msg.new_process_ns.argc=%d\n"
+                    , method_name, __LINE__
+                    , msgnew->argc );
+        for (int i=0; i < msgnew->argc; i++)
+        {
+            trace_printf("%s@%d - msg.new_process_ns.argv[%d]=%s\n"
+                        , method_name, __LINE__
+                        , i, msgnew->argv[i]);
+        }
+    }
+
     int error = SendReceive(&msg );
 
     TRACE_EXIT;
@@ -778,10 +844,12 @@ int CNameServer::SendReceive( struct message_def* msg )
                          "        process_info_ns.unhooked=%d\n"
                          "        process_info_ns.event_messages=%d\n"
                          "        process_info_ns.system_messages=%d\n"
+                         "        process_info_ns.path=%s\n"
+                         "        process_info_ns.ldpath=%s\n"
                          "        process_info_ns.program=%s\n"
-                         "        process_info_ns.pathStrId=%d:%d\n"
-                         "        process_info_ns.ldpathStrId=%d:%d\n"
-                         "        process_info_ns.programStrId=%d:%d\n"
+//                         "        process_info_ns.pathStrId=%d:%d\n"
+//                         "        process_info_ns.ldpathStrId=%d:%d\n"
+//                         "        process_info_ns.programStrId=%d:%d\n"
                          "        process_info_ns.port_name=%s\n"
                          "        process_info_ns.argc=%d\n"
 //                         "        process_info_ns.argv=[%.*s]\n"
@@ -806,13 +874,15 @@ int CNameServer::SendReceive( struct message_def* msg )
                          , msg->u.reply.u.process_info_ns.unhooked
                          , msg->u.reply.u.process_info_ns.event_messages
                          , msg->u.reply.u.process_info_ns.system_messages
+                         , msg->u.reply.u.process_info_ns.path
+                         , msg->u.reply.u.process_info_ns.ldpath
                          , msg->u.reply.u.process_info_ns.program
-                         , msg->u.reply.u.process_info_ns.pathStrId.nid
-                         , msg->u.reply.u.process_info_ns.pathStrId.id
-                         , msg->u.reply.u.process_info_ns.ldpathStrId.nid
-                         , msg->u.reply.u.process_info_ns.ldpathStrId.id
-                         , msg->u.reply.u.process_info_ns.programStrId.nid
-                         , msg->u.reply.u.process_info_ns.programStrId.id
+//                         , msg->u.reply.u.process_info_ns.pathStrId.nid
+//                         , msg->u.reply.u.process_info_ns.pathStrId.id
+//                         , msg->u.reply.u.process_info_ns.ldpathStrId.nid
+//                         , msg->u.reply.u.process_info_ns.ldpathStrId.id
+//                         , msg->u.reply.u.process_info_ns.programStrId.nid
+//                         , msg->u.reply.u.process_info_ns.programStrId.id
                          , msg->u.reply.u.process_info_ns.port_name
                          , msg->u.reply.u.process_info_ns.argc
 //                         , &msg->u.reply.u.process_info_ns.argv

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1f7eabb0/core/sqf/monitor/linux/nscommacceptmon.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nscommacceptmon.cxx b/core/sqf/monitor/linux/nscommacceptmon.cxx
index 6282b0a..edddca7 100644
--- a/core/sqf/monitor/linux/nscommacceptmon.cxx
+++ b/core/sqf/monitor/linux/nscommacceptmon.cxx
@@ -292,74 +292,64 @@ void CCommAcceptMon::monReqNewProcess( struct message_def* msg, int sockFd )
     if ( trace_settings & ( TRACE_NS | TRACE_REQUEST) )
     {
         trace_printf( "%s@%d - Received monitor request new-process data.\n"
-                      "        msg.new_process_ns.parent_nid=%d\n"
-                      "        msg.new_process_ns.parent_pid=%d\n"
-                      "        msg.new_process_ns.parent_verifier=%d\n"
-                      "        msg.new_process_ns.pair_parent_nid=%d\n"
-                      "        msg.new_process_ns.pair_parent_pid=%d\n"
-                      "        msg.new_process_ns.pair_parent_verifier=%d\n"
                       "        msg.new_process_ns.nid=%d\n"
                       "        msg.new_process_ns.pid=%d\n"
                       "        msg.new_process_ns.verifier=%d\n"
-                      "        msg.new_process_ns.backup=%d\n"
-                      "        msg.new_process_ns.event_messages=%d\n"
-                      "        msg.new_process_ns.system_messages=%d\n"
+                      "        msg.new_process_ns.process_name=%s\n"
                       "        msg.new_process_ns.type=%d\n"
                       "        msg.new_process_ns.parent_nid=%d\n"
                       "        msg.new_process_ns.parent_pid=%d\n"
                       "        msg.new_process_ns.parent_verifier=%d\n"
+                      "        msg.new_process_ns.pair_parent_nid=%d\n"
+                      "        msg.new_process_ns.pair_parent_pid=%d\n"
+                      "        msg.new_process_ns.pair_parent_verifier=%d\n"
                       "        msg.new_process_ns.priority=%d\n"
                       "        msg.new_process_ns.backup=%d\n"
                       "        msg.new_process_ns.unhooked=%d\n"
                       "        msg.new_process_ns.event_messages=%d\n"
                       "        msg.new_process_ns.system_messages=%d\n"
-                      "        msg.new_process_ns.pathStrId=%d:%d\n"
-                      "        msg.new_process_ns.ldpathStrId=%d:%d\n"
-                      "        msg.new_process_ns.programStrId=%d:%d\n"
-                      "        msg.new_process_ns.process_name=%s\n"
+                      "        msg.new_process_ns.path=%s\n"
+                      "        msg.new_process_ns.ldpath=%s\n"
+                      "        msg.new_process_ns.program=%s\n"
                       "        msg.new_process_ns.port=%s\n"
-                      "        msg.new_process_ns.argc=%d\n"
-                      //"        msg.new_process_ns.argv=%s\n"
                       "        msg.new_process_ns.infile=%s\n"
                       "        msg.new_process_ns.outfile=%s\n"
                       "        msg.new_process_ns.creation_time=%ld(secs):%ld(nsecs)\n"
                     , method_name, __LINE__
-                    , msg->u.request.u.new_process_ns.parent_nid
-                    , msg->u.request.u.new_process_ns.parent_pid
-                    , msg->u.request.u.new_process_ns.parent_verifier
-                    , msg->u.request.u.new_process_ns.pair_parent_nid
-                    , msg->u.request.u.new_process_ns.pair_parent_pid
-                    , msg->u.request.u.new_process_ns.pair_parent_verifier
                     , msg->u.request.u.new_process_ns.nid
                     , msg->u.request.u.new_process_ns.pid
                     , msg->u.request.u.new_process_ns.verifier
-                    , msg->u.request.u.new_process_ns.backup
-                    , msg->u.request.u.new_process_ns.event_messages
-                    , msg->u.request.u.new_process_ns.system_messages
+                    , msg->u.request.u.new_process_ns.process_name
                     , msg->u.request.u.new_process_ns.type
                     , msg->u.request.u.new_process_ns.parent_nid
                     , msg->u.request.u.new_process_ns.parent_pid
                     , msg->u.request.u.new_process_ns.parent_verifier
+                    , msg->u.request.u.new_process_ns.pair_parent_nid
+                    , msg->u.request.u.new_process_ns.pair_parent_pid
+                    , msg->u.request.u.new_process_ns.pair_parent_verifier
                     , msg->u.request.u.new_process_ns.priority
                     , msg->u.request.u.new_process_ns.backup
                     , msg->u.request.u.new_process_ns.unhooked
                     , msg->u.request.u.new_process_ns.event_messages
                     , msg->u.request.u.new_process_ns.system_messages
-                    , msg->u.request.u.new_process_ns.pathStrId.nid
-                    , msg->u.request.u.new_process_ns.pathStrId.id
-                    , msg->u.request.u.new_process_ns.ldpathStrId.nid
-                    , msg->u.request.u.new_process_ns.ldpathStrId.id
-                    , msg->u.request.u.new_process_ns.programStrId.nid
-                    , msg->u.request.u.new_process_ns.programStrId.id
-                    , msg->u.request.u.new_process_ns.process_name
+                    , msg->u.request.u.new_process_ns.path
+                    , msg->u.request.u.new_process_ns.ldpath
+                    , msg->u.request.u.new_process_ns.program
                     , msg->u.request.u.new_process_ns.port_name
-                    , msg->u.request.u.new_process_ns.argc
-                    //, msg->u.request.u.new_process_ns.argv
                     , msg->u.request.u.new_process_ns.infile
                     , msg->u.request.u.new_process_ns.outfile
                     , msg->u.request.u.new_process_ns.creation_time.tv_sec
                     , msg->u.request.u.new_process_ns.creation_time.tv_nsec
                     );
+        trace_printf("%s@%d - msg.new_process_ns.argc=%d\n"
+                    , method_name, __LINE__
+                    , msg->u.request.u.new_process_ns.argc );
+        for (int i=0; i < msg->u.request.u.new_process_ns.argc; i++)
+        {
+            trace_printf("%s@%d - msg.new_process_ns.argv[%d]=%s\n"
+                        , method_name, __LINE__
+                        , i, msg->u.request.u.new_process_ns.argv[i]);
+        }
     }
 
     CExternalReq::reqQueueMsg_t msgType;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1f7eabb0/core/sqf/monitor/linux/nsprocess.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nsprocess.cxx b/core/sqf/monitor/linux/nsprocess.cxx
index dd2ab68..1faa5b5 100644
--- a/core/sqf/monitor/linux/nsprocess.cxx
+++ b/core/sqf/monitor/linux/nsprocess.cxx
@@ -39,9 +39,12 @@ CProcess *CProcessContainer::CreateProcess (CProcess * parent,
                                             int backup,
                                             bool unhooked,
                                             char *process_name,
-                                            strId_t pathStrId, 
-                                            strId_t ldpathStrId,
-                                            strId_t programStrId,
+                                            char *path, 
+                                            char *ldpath, 
+                                            char *program, 
+//                                            strId_t pathStrId, 
+//                                            strId_t ldpathStrId,
+//                                            strId_t programStrId,
                                             char *infile,
                                             char *outfile,
                                             void *tag,
@@ -62,8 +65,24 @@ CProcess *CProcessContainer::CreateProcess (CProcess * parent,
     }
 
     process =
-        new CProcess (parent, nid, pid, verifier, type, priority, backup, debug, unhooked, process_name, 
-                      pathStrId, ldpathStrId, programStrId, infile, outfile);
+        new CProcess( parent
+                    , nid
+                    , pid
+                    , verifier
+                    , type
+                    , priority
+                    , backup
+                    , debug
+                    , unhooked
+                    , process_name
+                    , path
+                    , ldpath
+                    , program
+//                    , pathStrId
+//                    , ldpathStrId
+//                    , programStrId
+                    , infile
+                    , outfile);
     if (process)
     {
         AddToList( process );

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1f7eabb0/core/sqf/monitor/linux/nsreqnewproc.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nsreqnewproc.cxx b/core/sqf/monitor/linux/nsreqnewproc.cxx
index eb06728..2a16707 100644
--- a/core/sqf/monitor/linux/nsreqnewproc.cxx
+++ b/core/sqf/monitor/linux/nsreqnewproc.cxx
@@ -121,9 +121,12 @@ void CExtNewProcNsReq::performRequest()
                                               msg_->u.request.u.new_process_ns.backup,
                                               msg_->u.request.u.new_process_ns.unhooked,
                                               msg_->u.request.u.new_process_ns.process_name,
-                                              msg_->u.request.u.new_process_ns.pathStrId,
-                                              msg_->u.request.u.new_process_ns.ldpathStrId,
-                                              msg_->u.request.u.new_process_ns.programStrId,
+                                              msg_->u.request.u.new_process_ns.path,
+                                              msg_->u.request.u.new_process_ns.ldpath,
+                                              msg_->u.request.u.new_process_ns.program,
+//                                              msg_->u.request.u.new_process_ns.pathStrId,
+//                                              msg_->u.request.u.new_process_ns.ldpathStrId,
+//                                              msg_->u.request.u.new_process_ns.programStrId,
                                               msg_->u.request.u.new_process_ns.infile,
                                               msg_->u.request.u.new_process_ns.outfile,
                                               0, // tag

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1f7eabb0/core/sqf/monitor/linux/nsreqprocinfons.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nsreqprocinfons.cxx b/core/sqf/monitor/linux/nsreqprocinfons.cxx
index dbbf80c..562fdb6 100644
--- a/core/sqf/monitor/linux/nsreqprocinfons.cxx
+++ b/core/sqf/monitor/linux/nsreqprocinfons.cxx
@@ -92,10 +92,12 @@ void CExtProcInfoNsReq::copyInfo(CProcess *process, ProcessInfoNs_reply_def &pro
     process_info_ns.unhooked = process->IsUnhooked();
     process_info_ns.event_messages = process->IsEventMessages();
     process_info_ns.system_messages = process->IsSystemMessages();
+    strncpy( process_info_ns.path, process->path(), MAX_PROCESS_PATH );
+    strncpy( process_info_ns.ldpath, process->ldpath(), MAX_PROCESS_PATH );
     strncpy( process_info_ns.program, process->program(), MAX_PROCESS_PATH );
-    process_info_ns.pathStrId = process->pathStrId();
-    process_info_ns.ldpathStrId = process->ldPathStrId();
-    process_info_ns.programStrId = process->programStrId();
+//    process_info_ns.pathStrId = process->pathStrId();
+//    process_info_ns.ldpathStrId = process->ldPathStrId();
+//    process_info_ns.programStrId = process->programStrId();
     strncpy( process_info_ns.port_name, process->GetPort(), MPI_MAX_PORT_NAME );
     process_info_ns.argc = process->argc();
     memcpy( process_info_ns.argv, process->userArgv(), process->userArgvLen() );
@@ -122,10 +124,12 @@ void CExtProcInfoNsReq::copyInfo(CProcess *process, ProcessInfoNs_reply_def &pro
                  "        process_info_ns.unhooked=%d\n"
                  "        process_info_ns.event_messages=%d\n"
                  "        process_info_ns.system_messages=%d\n"
+                 "        process_info_ns.path=%s\n"
+                 "        process_info_ns.ldpath=%s\n"
                  "        process_info_ns.program=%s\n"
-                 "        process_info_ns.pathStrId=%d:%d\n"
-                 "        process_info_ns.ldpathStrId=%d:%d\n"
-                 "        process_info_ns.programStrId=%d:%d\n"
+//                 "        process_info_ns.pathStrId=%d:%d\n"
+//                 "        process_info_ns.ldpathStrId=%d:%d\n"
+//                 "        process_info_ns.programStrId=%d:%d\n"
                  "        process_info_ns.port_name=%s\n"
                  "        process_info_ns.argc=%d\n"
                  "        process_info_ns.infile=%s\n"
@@ -145,13 +149,15 @@ void CExtProcInfoNsReq::copyInfo(CProcess *process, ProcessInfoNs_reply_def &pro
                  , process_info_ns.unhooked
                  , process_info_ns.event_messages
                  , process_info_ns.system_messages
+                 , process_info_ns.path
+                 , process_info_ns.ldpath
                  , process_info_ns.program
-                 , process_info_ns.pathStrId.nid
-                 , process_info_ns.pathStrId.id
-                 , process_info_ns.ldpathStrId.nid
-                 , process_info_ns.ldpathStrId.id
-                 , process_info_ns.programStrId.nid
-                 , process_info_ns.programStrId.id
+//                 , process_info_ns.pathStrId.nid
+//                 , process_info_ns.pathStrId.id
+//                 , process_info_ns.ldpathStrId.nid
+//                 , process_info_ns.ldpathStrId.id
+//                 , process_info_ns.programStrId.nid
+//                 , process_info_ns.programStrId.id
                  , process_info_ns.port_name
                  , process_info_ns.argc
                  , process_info_ns.infile

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1f7eabb0/core/sqf/monitor/linux/pnode.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnode.cxx b/core/sqf/monitor/linux/pnode.cxx
index 563cf01..0884343 100644
--- a/core/sqf/monitor/linux/pnode.cxx
+++ b/core/sqf/monitor/linux/pnode.cxx
@@ -543,7 +543,7 @@ void CNode::CheckActivationPhase( void )
         }
         tmReady = (tmCount == GetLNodesCount()) ? true : false;
     }
-    
+
     if ( tmReady )
     {
         if (trace_settings & (TRACE_INIT | TRACE_SYNC | TRACE_TMSYNC))
@@ -1712,6 +1712,7 @@ void CNodeContainer::AddedNode( CNode *node )
     TRACE_EXIT;
 }
 
+#ifndef NAMESERVER_PROCESS
 CProcess *CNodeContainer::AddCloneProcess( ProcessInfoNs_reply_def *processInfo )
 {
     const char method_name[] = "CNodeContainer::AddNode";
@@ -1719,6 +1720,11 @@ CProcess *CNodeContainer::AddCloneProcess( ProcessInfoNs_reply_def *processInfo
 
     CLNode   *lnode = Nodes->GetLNode(processInfo->nid);
     CNode    *node = lnode->GetNode();
+
+    strId_t pathStrId = MyNode->GetStringId ( processInfo->path, lnode );
+    strId_t ldpathStrId = MyNode->GetStringId (processInfo->ldpath, lnode );
+    strId_t programStrId = MyNode->GetStringId ( processInfo->program, lnode );
+
     CProcess *process = node->CloneProcess( processInfo->nid
                                           , processInfo->type
                                           , processInfo->priority
@@ -1733,9 +1739,12 @@ CProcess *CNodeContainer::AddCloneProcess( ProcessInfoNs_reply_def *processInfo
                                           , processInfo->parent_verifier
                                           , processInfo->event_messages
                                           , processInfo->system_messages
-                                          , processInfo->pathStrId
-                                          , processInfo->ldpathStrId
-                                          , processInfo->programStrId
+                                          , pathStrId
+                                          , ldpathStrId
+                                          , programStrId
+//                                          , processInfo->pathStrId
+//                                          , processInfo->ldpathStrId
+//                                          , processInfo->programStrId
                                           , processInfo->infile
                                           , processInfo->outfile
                                           , &processInfo->creation_time
@@ -1744,6 +1753,7 @@ CProcess *CNodeContainer::AddCloneProcess( ProcessInfoNs_reply_def *processInfo
     TRACE_EXIT;
     return(process);
 }
+#endif
 
 CNode *CNodeContainer::AddNode( int pnid )
 {
@@ -3489,6 +3499,8 @@ CNodeContainer::InitSyncBuffer( struct sync_buffer_def *syncBuf
     syncBuf->nodeInfo.nodeMask      = upNodes;
 #ifdef NAMESERVER_PROCESS
     syncBuf->nodeInfo.monConnCount  = MyNode->GetMonConnCount();
+#else
+    syncBuf->nodeInfo.monProcCount  = MyNode->GetNumProcs();
 #endif
 
     for (int i = 0; i < GetPNodesCount(); i++)
@@ -3515,7 +3527,7 @@ CNodeContainer::InitSyncBuffer( struct sync_buffer_def *syncBuf
                     , syncBuf->nodeInfo.seq_num
                     , syncBuf->nodeInfo.monConnCount);
 #else
-        trace_printf( "%s@%d - Node %s (pnid=%d) node_state=(%d)(%s), internalState=%d, TmSyncState=(%d)(%s), change_nid=%d, seqNum_=%lld\n"
+        trace_printf( "%s@%d - Node %s (pnid=%d) node_state=(%d)(%s), internalState=%d, TmSyncState=(%d)(%s), change_nid=%d, seqNum_=%lld, monProcCount=%d\n"
                     , method_name, __LINE__
                     , MyNode->GetName()
                     , MyPNID
@@ -3525,7 +3537,8 @@ CNodeContainer::InitSyncBuffer( struct sync_buffer_def *syncBuf
                     , syncBuf->nodeInfo.tmSyncState
                     , SyncStateString( syncBuf->nodeInfo.tmSyncState )
                     , syncBuf->nodeInfo.change_nid
-                    , syncBuf->nodeInfo.seq_num);
+                    , syncBuf->nodeInfo.seq_num
+                    , syncBuf->nodeInfo.monProcCount);
 #endif
     }
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1f7eabb0/core/sqf/monitor/linux/pnode.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnode.h b/core/sqf/monitor/linux/pnode.h
index 44008ea..dafee70 100644
--- a/core/sqf/monitor/linux/pnode.h
+++ b/core/sqf/monitor/linux/pnode.h
@@ -66,7 +66,9 @@ public:
     ~CNodeContainer( void );
 
     void    AddedNode( CNode *node );
+#ifndef NAMESERVER_PROCESS
     CProcess *AddCloneProcess( ProcessInfoNs_reply_def *processInfo );
+#endif
     CNode  *AddNode( int pnid );
     void    AddNodes( void );
     void    AddToSpareNodesList( int pnid );

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1f7eabb0/core/sqf/monitor/linux/process.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/process.cxx b/core/sqf/monitor/linux/process.cxx
index 9b2be4f..5e7b792 100644
--- a/core/sqf/monitor/linux/process.cxx
+++ b/core/sqf/monitor/linux/process.cxx
@@ -130,8 +130,15 @@ CProcess::CProcess (CProcess * parent, int nid, int pid,
 #endif
                     PROCESSTYPE type,
                     int priority, int backup, bool debug, bool unhooked,
-                    char *name, strId_t pathStrId, strId_t ldpathStrId,
-                    strId_t programStrId, char *infile, char *outfile)
+                    char *name,
+#ifdef NAMESERVER_PROCESS
+                    char *path,
+                    char *ldpath,
+                    char *program,
+#else
+                    strId_t pathStrId, strId_t ldpathStrId, strId_t programStrId, 
+#endif
+                    char *infile, char *outfile)
   :
     Nid (nid),
     Pid (pid),
@@ -182,10 +189,18 @@ CProcess::CProcess (CProcess * parent, int nid, int pid,
     , argc_(0)
     , userArgvLen_ (0)
     , userArgv_ (NULL)
-    , programStrId_ (programStrId)
+#ifdef NAMESERVER_PROCESS
+    , path_(path)
+    , ldpath_(ldpath)
+    , program_(program)
+#else
+    , path_()
+    , ldpath_()
     , program_()
+    , programStrId_(programStrId)
     , pathStrId_(pathStrId)
     , ldpathStrId_(ldpathStrId)
+#endif
     , firstInstance_(true)
     , cmpOrEsp_(false)
     , trafConf_()
@@ -227,7 +242,9 @@ CProcess::CProcess (CProcess * parent, int nid, int pid,
     if ( outfile && strcmp(outfile,"#default") != 0)
         outfile_ = outfile;
 
+#ifndef NAMESERVER_PROCESS
     Config->strIdToString(programStrId_, program_ );
+#endif
 
     switch (Type)
     {
@@ -403,6 +420,36 @@ CProcess::~CProcess (void)
     TRACE_EXIT;
 }
 
+#ifndef NAMESERVER_PROCESS
+const char* CProcess::path()
+{
+    Config->strIdToString(pathStrId_, path_ );
+    return( path_.c_str() );
+}
+#endif
+
+#ifndef NAMESERVER_PROCESS
+const char* CProcess::ldpath()
+{
+    Config->strIdToString(ldpathStrId_, ldpath_ );
+    return( ldpath_.c_str() );
+}
+#endif
+
+int CProcess::getUserArgs( char user_argv[MAX_ARGS][MAX_ARG_SIZE] )
+{
+    const char *pUserArgv = userArgv_;
+    int i, arglen;
+    for (i = 0; i < argc_; i++)
+    {
+        arglen = strlen (pUserArgv) + 1;
+        strcpy( user_argv[i], pUserArgv );
+        pUserArgv += arglen;
+    }
+    strcpy( user_argv[i], "" );
+    return(argc_);
+}
+
 void CProcess::userArgs ( int argc, int argvLen, const char * argvList )
 {
     const char method_name[] = "CProcess::userArgs";
@@ -4728,9 +4775,15 @@ CProcess *CProcessContainer::CloneProcess (int nid,
                                            int parent_verifier,
                                            bool event_messages,
                                            bool system_messages,
+#ifdef NAMESERVER_PROCESS
+                                           char *path, 
+                                           char *ldpath, 
+                                           char *program, 
+#else
                                            strId_t pathStrId,
                                            strId_t ldpathStrId,
                                            strId_t programStrId,
+#endif
                                            char *infile,
                                            char *outfile,
                                            struct timespec *creation_time,
@@ -4800,8 +4853,21 @@ CProcess *CProcessContainer::CloneProcess (int nid,
 
 #ifdef NAMESERVER_PROCESS
     process =
-        new CProcess (parent, nid, os_pid, verifier, type, priority, backup, false, unhooked, pname, pathStrId, ldpathStrId,
-                      programStrId, infile, outfile);
+        new CProcess( parent
+                    , nid
+                    , os_pid
+                    , verifier
+                    , type
+                    , priority
+                    , backup
+                    , false
+                    , unhooked
+                    , pname
+                    , path
+                    , ldpath
+                    , program
+                    , infile
+                    , outfile);
 #else
     process =
         new CProcess (parent, nid, os_pid, type, priority, backup, false, unhooked, pname, pathStrId, ldpathStrId,

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1f7eabb0/core/sqf/monitor/linux/process.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/process.h b/core/sqf/monitor/linux/process.h
index 227836f..3c813bb 100644
--- a/core/sqf/monitor/linux/process.h
+++ b/core/sqf/monitor/linux/process.h
@@ -89,9 +89,15 @@ class CProcessContainer
                             int parent_verifier,
                             bool event_messages,
                             bool system_messages,
+#ifdef NAMESERVER_PROCESS
+                            char *path, 
+                            char *ldpath, 
+                            char *program, 
+#else
                             strId_t pathStrId,
                             strId_t ldpathStrId,
                             strId_t programStrId,
+#endif
                             char *infile,
                             char *outfile,
                             struct timespec *creation_time,
@@ -118,9 +124,15 @@ class CProcessContainer
                              int backup,
                              bool unhooked,
                              char *process_name, 
+#ifdef NAMESERVER_PROCESS
+                            char *path, 
+                            char *ldpath, 
+                            char *program, 
+#else
                              strId_t pathStrId,
                              strId_t ldpathStrId,
                              strId_t programStrId,
+#endif
                              char *infile,
                              char *outfile
                              , void *tag
@@ -222,9 +234,15 @@ class CProcess
               bool debug,
               bool unhooked, 
               char *name, 
+#ifdef NAMESERVER_PROCESS
+              char *path,
+              char *ldpath,
+              char *program,
+#else
               strId_t  pathStrId, 
               strId_t  ldpathStrId, 
               strId_t  programStrId,
+#endif
               char *infile,
               char *outfile);
     ~CProcess( void );
@@ -367,15 +385,25 @@ class CProcess
 
     void userArgs ( int argc, int argvLen, const char * argvList );
     void userArgs ( int argc, char user_argv[MAX_ARGS][MAX_ARG_SIZE] );
+    int getUserArgs( char user_argv[MAX_ARGS][MAX_ARG_SIZE] );
 
-    strId_t programStrId()    { return programStrId_; }
-    const char * program()    { return program_.c_str(); };
+#ifdef NAMESERVER_PROCESS
+    const char* path()        { return path_.c_str(); };
+    const char* ldpath()      { return ldpath_.c_str(); };
+#else
+    const char* path();
+    const char* ldpath();
+#endif
+    const char* program()     { return program_.c_str(); };
     bool isCmpOrEsp()         { return cmpOrEsp_; }
     const char *infile()      { return infile_.c_str(); };
     const char *outfile()     { return outfile_.c_str(); };
 
+#ifndef NAMESERVER_PROCESS
     strId_t pathStrId()       { return pathStrId_; };
     strId_t ldPathStrId()     { return ldpathStrId_; };
+    strId_t programStrId()    { return programStrId_; }
+#endif
 
     const char *fifo_stdin()  { return fifo_stdin_.c_str(); };
     const char *fifo_stdout() { return fifo_stdout_.c_str(); };
@@ -494,8 +522,10 @@ private:
     int          userArgvLen_;
     char         *userArgv_;
 
+    string       path_;          // process's object lookup path to program
+    string       ldpath_;        // process's library load path for program
+    string       program_;       // program file name
     strId_t      programStrId_;
-    string       program_;   // object file name
     strId_t      pathStrId_;
     strId_t      ldpathStrId_;
     bool         firstInstance_; // reset on persistent process re-creation

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1f7eabb0/core/sqf/monitor/linux/replicate.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/replicate.cxx b/core/sqf/monitor/linux/replicate.cxx
index f9ebf53..15e0394 100644
--- a/core/sqf/monitor/linux/replicate.cxx
+++ b/core/sqf/monitor/linux/replicate.cxx
@@ -588,6 +588,9 @@ bool CReplProcess::replicate(struct internal_msg_def *&msg)
         msg->type = InternalType_Process;
         msg->u.process.nid = process_->GetNid();
         msg->u.process.pid = process_->GetPid();
+#ifdef NAMESERVER_PROCESS
+        msg->u.process.verifier = process_->GetVerifier();
+#endif
         msg->u.process.type = process_->GetType();
         msg->u.process.priority = process_->GetPriority();
         msg->u.process.backup = process_->IsBackup();
@@ -599,16 +602,18 @@ bool CReplProcess::replicate(struct internal_msg_def *&msg)
         msg->u.process.pair_parent_nid = process_->GetPairParentNid();
         msg->u.process.pair_parent_pid = process_->GetPairParentPid();
         msg->u.process.pair_parent_verifier = process_->GetPairParentVerifier();
+#ifndef NAMESERVER_PROCESS
         msg->u.process.pathStrId =  process_->pathStrId();
         msg->u.process.ldpathStrId = process_->ldPathStrId();
         msg->u.process.programStrId = process_->programStrId();
+#endif
         msg->u.process.argc = process_->argc();
 
         char * stringData = & msg->u.process.stringData;
 
         // Copy the process name
         msg->u.process.nameLen = nameLen_;
-        memcpy(stringData, process_->GetName(),  nameLen_ );
+        memcpy(stringData, process_->GetName(), nameLen_ );
         stringData += nameLen_;
 
         // Copy the standard in file name
@@ -618,9 +623,25 @@ bool CReplProcess::replicate(struct internal_msg_def *&msg)
 
         // Copy the standard out file name
         msg->u.process.outfileLen = outfileLen_;
-        memcpy(stringData, process_->outfile(),  outfileLen_ );
+        memcpy(stringData, process_->outfile(), outfileLen_ );
         stringData += outfileLen_;
 
+#ifdef NAMESERVER_PROCESS
+        // Copy the path
+        msg->u.process.pathLen = pathLen_;
+        memcpy(stringData, process_->path(), pathLen_ );
+        stringData += pathLen_;
+
+        // Copy the ldpath
+        msg->u.process.ldpathLen = ldpathLen_;
+        memcpy(stringData, process_->ldpath(), ldpathLen_ );
+        stringData += ldpathLen_;
+
+        // Copy the program
+        msg->u.process.programLen = programLen_;
+        memcpy(stringData, process_->program(), programLen_ );
+        stringData += programLen_;
+#endif
         // Copy the program argument strings
         msg->u.process.argvLen =  argvLen_;
         memcpy(stringData, process_->userArgv(), argvLen_);
@@ -628,8 +649,42 @@ bool CReplProcess::replicate(struct internal_msg_def *&msg)
         // temp trace
         if (trace_settings & TRACE_PROCESS)
         {
-            trace_printf("%s@%d - replSize_=%d, programStrId=(%d,%d), pathStrId=(%d,%d), ldPathStrId=(%d,%d), name=%s, strlen(name)=%d, infile=%s, strlen(infile)=%d, outfile=%s, strlen(outfile)=%d, argc=%d, strlen(total argv)=%d, args=[%.*s]\n",
-                         method_name, __LINE__, replSize_, msg->u.process.programStrId.nid, msg->u.process.programStrId.id, msg->u.process.pathStrId.nid, msg->u.process.pathStrId.id, msg->u.process.ldpathStrId.nid, msg->u.process.ldpathStrId.id, &msg->u.process.stringData, nameLen_, &msg->u.process.stringData+nameLen_, infileLen_, &msg->u.process.stringData+nameLen_+infileLen_, outfileLen_, msg->u.process.argc, argvLen_, argvLen_, &msg->u.process.stringData+nameLen_+infileLen_+outfileLen_);
+            trace_printf( "%s@%d - replSize_=%d\n"
+                          "        msg->u.process.name=%s, strlen(name)=%d\n"
+                          "        msg->u.process.infile=%s, strlen(infile)=%d\n"
+                          "        msg->u.process.outfile=%s, strlen(outfile)=%d\n"
+#ifdef NAMESERVER_PROCESS
+                          "        msg->u.process.path=%s, strlen(path)=%d\n"
+                          "        msg->u.process.ldpath=%s, strlen(ldpath)=%d\n"
+                          "        msg->u.process.program=%s, strlen(program)=%d\n"
+#else
+                          "        msg->u.process.programStrId=(%d,%d)\n"
+                          "        msg->u.process.pathStrId=(%d,%d)\n"
+                          "        msg->u.process.ldPathStrId=(%d,%d)\n"
+#endif
+                          "        msg->u.process.argc=%d, strlen(total argv)=%d, args=[%.*s]\n"
+                        , method_name, __LINE__, replSize_
+                        , &msg->u.process.stringData, nameLen_
+                        , &msg->u.process.stringData+nameLen_, infileLen_
+                        , &msg->u.process.stringData+nameLen_+infileLen_, outfileLen_
+#ifdef NAMESERVER_PROCESS
+                        , &msg->u.process.stringData+nameLen_+infileLen_+outfileLen_, pathLen_
+                        , &msg->u.process.stringData+nameLen_+infileLen_+outfileLen_+pathLen_, ldpathLen_
+                        , &msg->u.process.stringData+nameLen_+infileLen_+outfileLen_+pathLen_+ldpathLen_, programLen_
+#else
+                        , msg->u.process.programStrId.nid
+                        , msg->u.process.programStrId.id
+                        , msg->u.process.pathStrId.nid
+                        , msg->u.process.pathStrId.id
+                        , msg->u.process.ldpathStrId.nid
+                        , msg->u.process.ldpathStrId.id
+#endif
+                        , msg->u.process.argc
+#ifdef NAMESERVER_PROCESS
+                        , argvLen_, argvLen_, &msg->u.clone.stringData+nameLen_+infileLen_+outfileLen_+pathLen_+ldpathLen_+programLen_);
+#else
+                        , argvLen_, argvLen_, &msg->u.clone.stringData+nameLen_+infileLen_+outfileLen_);
+#endif
         }
 
         // Advance sync buffer pointer
@@ -646,8 +701,6 @@ bool CReplProcess::replicate(struct internal_msg_def *&msg)
     return true;
 }
 
-
-
 CReplProcInit::CReplProcInit( CProcess *process
                             , void *tag
                             , int result
@@ -737,11 +790,23 @@ CReplClone::CReplClone(CProcess *process) : process_(process)
     infileLen_ = strlen(process->infile()) + 1;
     outfileLen_ = strlen(process->outfile()) + 1;
     argvLen_ = process->userArgvLen();
+#ifdef NAMESERVER_PROCESS
+    pathLen_ = strlen(process_->path()) + 1;
+    ldpathLen_ = strlen(process_->ldpath()) + 1;
+    programLen_ = strlen(process_->program()) + 1;
+#endif
     // Compute message size (adjust if needed to conform to
     // internal_msg_def structure alignment).
+#ifdef NAMESERVER_PROCESS
+    replSize_ = (MSG_HDR_SIZE + sizeof( clone_def ) + nameLen_ + portLen_
+                 + infileLen_ + outfileLen_ + argvLen_
+                 + pathLen_ + ldpathLen_ + programLen_ + msgAlignment_
+                 ) & ~msgAlignment_;
+#else
     replSize_ = (MSG_HDR_SIZE + sizeof( clone_def ) + nameLen_ + portLen_
                  + infileLen_ + outfileLen_ + argvLen_ + msgAlignment_
                  ) & ~msgAlignment_;
+#endif
 
     if (trace_settings & (TRACE_SYNC_DETAIL | TRACE_PROCESS_DETAIL))
     {
@@ -792,9 +857,11 @@ bool CReplClone::replicate(struct internal_msg_def *&msg)
     msg->u.clone.priority = process_->GetPriority();
     msg->u.clone.backup = process_->IsBackup();
     msg->u.clone.unhooked = process_->IsUnhooked();
+#ifndef NAMESERVER_PROCESS
     msg->u.clone.pathStrId = process_->pathStrId();
     msg->u.clone.ldpathStrId = process_->ldPathStrId();
     msg->u.clone.programStrId = process_->programStrId();
+#endif
     msg->u.clone.os_pid = process_->GetPid();
     msg->u.clone.verifier = process_->GetVerifier();
     msg->u.clone.prior_pid = process_->GetPriorPid ();
@@ -834,37 +901,78 @@ bool CReplClone::replicate(struct internal_msg_def *&msg)
     memcpy(stringData, process_->outfile(),  outfileLen_ );
     stringData += outfileLen_;
 
+#ifdef NAMESERVER_PROCESS
+    // Copy the path
+    msg->u.clone.pathLen = pathLen_;
+    memcpy(stringData, process_->path(),  pathLen_ );
+    stringData += pathLen_;
+
+    // Copy the ldpath
+    msg->u.clone.ldpathLen = ldpathLen_;
+    memcpy(stringData, process_->ldpath(),  ldpathLen_ );
+    stringData += ldpathLen_;
+
+    // Copy the program
+    msg->u.clone.programLen = programLen_;
+    memcpy(stringData, process_->program(),  programLen_ );
+    stringData += programLen_;
+#endif
+
     // Copy the program argument strings
     msg->u.clone.argvLen =  argvLen_;
     memcpy(stringData, process_->userArgv(), argvLen_);
 
     // temp trace
+#ifndef NAMESERVER_PROCESS
     if (trace_settings & TRACE_PROCESS)
     {
         trace_printf( "%s@%d - replSize_=%d\n"
-                      "        msg->u.clone.programStrId=(%d,%d)\n"
-                      "        msg->u.clone.pathStrId=(%d,%d)\n"
-                      "        msg->u.clone.ldPathStrId=(%d,%d)\n"
                       "        msg->u.clone.name=%s, strlen(name)=%d\n"
                       "        msg->u.clone.port=%s, strlen(port)=%d\n"
                       "        msg->u.clone.infile=%s, strlen(infile)=%d\n"
                       "        msg->u.clone.outfile=%s, strlen(outfile)=%d\n"
+                      "        msg->u.clone.programStrId=(%d,%d)\n"
+                      "        msg->u.clone.pathStrId=(%d,%d)\n"
+                      "        msg->u.clone.ldPathStrId=(%d,%d)\n"
                       "        msg->u.clone.argc=%d, strlen(total argv)=%d, args=[%.*s]\n"
                     , method_name, __LINE__, replSize_
+                    , &msg->u.clone.stringData, nameLen_
+                    , &msg->u.clone.stringData+nameLen_, portLen_
+                    , &msg->u.clone.stringData+nameLen_+portLen_, infileLen_
+                    , &msg->u.clone.stringData+nameLen_+portLen_+infileLen_, outfileLen_
                     , msg->u.clone.programStrId.nid
                     , msg->u.clone.programStrId.id
                     , msg->u.clone.pathStrId.nid
                     , msg->u.clone.pathStrId.id
                     , msg->u.clone.ldpathStrId.nid
                     , msg->u.clone.ldpathStrId.id
+                    , msg->u.clone.argc
+                    , argvLen_, argvLen_, &msg->u.clone.stringData+nameLen_+portLen_+infileLen_+outfileLen_);
+    }
+#else
+    if (trace_settings & TRACE_PROCESS)
+    {
+        trace_printf( "%s@%d - replSize_=%d\n"
+                      "        msg->u.clone.name=%s, strlen(name)=%d\n"
+                      "        msg->u.clone.port=%s, strlen(port)=%d\n"
+                      "        msg->u.clone.infile=%s, strlen(infile)=%d\n"
+                      "        msg->u.clone.outfile=%s, strlen(outfile)=%d\n"
+                      "        msg->u.clone.path=%s, strlen(path)=%d\n"
+                      "        msg->u.clone.ldpath=%s, strlen(ldpath)=%d\n"
+                      "        msg->u.clone.program=%s, strlen(program)=%d\n"
+                      "        msg->u.clone.argc=%d, strlen(total argv)=%d, args=[%.*s]\n"
+                    , method_name, __LINE__, replSize_
                     , &msg->u.clone.stringData, nameLen_
                     , &msg->u.clone.stringData+nameLen_, portLen_
                     , &msg->u.clone.stringData+nameLen_+portLen_, infileLen_
                     , &msg->u.clone.stringData+nameLen_+portLen_+infileLen_, outfileLen_
+                    , &msg->u.clone.stringData+nameLen_+portLen_+infileLen_+outfileLen_, pathLen_
+                    , &msg->u.clone.stringData+nameLen_+portLen_+infileLen_+outfileLen_+pathLen_, ldpathLen_
+                    , &msg->u.clone.stringData+nameLen_+portLen_+infileLen_+outfileLen_+pathLen_+ldpathLen_, programLen_
                     , msg->u.clone.argc
-                    , argvLen_, argvLen_, &msg->u.clone.stringData+nameLen_+portLen_+infileLen_+outfileLen_);
+                    , argvLen_, argvLen_, &msg->u.clone.stringData+nameLen_+portLen_+infileLen_+outfileLen_+pathLen_+ldpathLen_+programLen_);
     }
-
+#endif
     // Advance sync buffer pointer
     Nodes->AddMsg( msg, replSize() );
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1f7eabb0/core/sqf/monitor/linux/replicate.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/replicate.h b/core/sqf/monitor/linux/replicate.h
index 3ae0909..0526159 100644
--- a/core/sqf/monitor/linux/replicate.h
+++ b/core/sqf/monitor/linux/replicate.h
@@ -155,6 +155,11 @@ private:
     int nameLen_;
     int infileLen_;
     int outfileLen_;
+#ifdef NAMESERVER_PROCESS
+    int pathLen_;
+    int ldpathLen_;
+    int programLen_;
+#endif
     int argvLen_;
 };
 
@@ -192,6 +197,11 @@ private:
     int infileLen_;
     int outfileLen_;
     int argvLen_;
+#ifdef NAMESERVER_PROCESS
+    int pathLen_;
+    int ldpathLen_;
+    int programLen_;
+#endif
 };
 
 class CReplExit: public CReplObj


[30/50] [abbrv] trafodion git commit: Update.

Posted by su...@apache.org.
Update.


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

Branch: refs/heads/master
Commit: a1131351423e20680fca11641ca3e45f801e9e14
Parents: c1be6d0
Author: Dave George <de...@gmail.com>
Authored: Thu Apr 12 20:58:37 2018 +0000
Committer: Dave George <de...@gmail.com>
Committed: Thu Apr 12 20:58:37 2018 +0000

----------------------------------------------------------------------
 core/sqf/src/seabed/test/t286ms.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/a1131351/core/sqf/src/seabed/test/t286ms.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/seabed/test/t286ms.cpp b/core/sqf/src/seabed/test/t286ms.cpp
index 69c19fc..02262a8 100644
--- a/core/sqf/src/seabed/test/t286ms.cpp
+++ b/core/sqf/src/seabed/test/t286ms.cpp
@@ -329,6 +329,8 @@ int main(int argc, char *argv[]) {
                 t_elapsed_us = (int) (t_elapsed.tv_sec * 1000000 + t_elapsed.tv_usec);
                 if (t_elapsed_us < rate_us * rate_cnt) {
                     rate_usleep = rate_us * rate_cnt - t_elapsed_us;
+                    if (ratev)
+                        printf("%s-sleeping=%d\n", my_name, rate_usleep);
                     usleep(rate_usleep);
                 }
                 rate_cnt++;
@@ -336,7 +338,7 @@ int main(int argc, char *argv[]) {
                     gettimeofday(&t_start, NULL);
                     rate_cnt = 0;
                     if (ratev)
-                        printf("%s-loop=%d\n", my_name, inx);
+                        printf("%s-loop=%d, elapsed=%d us\n", my_name, inx, t_elapsed_us);
                 }
             }
         }


[19/50] [abbrv] trafodion git commit: More p2p fixes.

Posted by su...@apache.org.
More p2p fixes.


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

Branch: refs/heads/master
Commit: 1584dc4372686ba901fc745b41492f810dadcae8
Parents: 71d6a1b
Author: Zalo Correa <za...@esgyn.com>
Authored: Fri Apr 6 08:02:21 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Fri Apr 6 08:02:21 2018 -0700

----------------------------------------------------------------------
 core/sqf/monitor/linux/pnode.cxx         | 37 ++++++++++++++++++--
 core/sqf/monitor/linux/pnode.h           |  2 +-
 core/sqf/monitor/linux/ptpclient.cxx     | 50 +++++++++++++++++++++++++++
 core/sqf/monitor/linux/ptpclient.h       |  5 +++
 core/sqf/monitor/linux/ptpcommaccept.cxx | 10 ++++++
 core/sqf/monitor/linux/reqnewproc.cxx    |  6 ++--
 core/sqf/src/seabed/test/goall           |  2 +-
 7 files changed, 104 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/1584dc43/core/sqf/monitor/linux/pnode.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnode.cxx b/core/sqf/monitor/linux/pnode.cxx
index 5c51ada..5da34cd 100644
--- a/core/sqf/monitor/linux/pnode.cxx
+++ b/core/sqf/monitor/linux/pnode.cxx
@@ -51,6 +51,9 @@ using namespace std;
 #include "replicate.h"
 #include "reqqueue.h"
 #include "healthcheck.h"
+#ifndef NAMESERVER_PROCESS
+#include "ptpclient.h"
+#endif
 
 extern CReqQueue ReqQueue;
 extern char MyPath[MAX_PROCESS_PATH];
@@ -82,6 +85,7 @@ extern CClusterConfig *ClusterConfig;
 const char *StateString( STATE state);
 #ifndef NAMESERVER_PROCESS
 const char *SyncStateString( SyncState state);
+extern CPtpClient *PtpClient;
 extern CNameServer *NameServer;
 extern CProcess *NameServerProcess;
 extern bool NameServerEnabled;
@@ -1013,7 +1017,7 @@ bool CNode::GetSchedulingData( void )
 }
 
 
-strId_t CNode::GetStringId(char * candidate)
+strId_t CNode::GetStringId( char *candidate, CLNode *targetLNode )
 {
     const char method_name[] = "CNode::GetStringId";
     strId_t id;
@@ -1025,10 +1029,37 @@ strId_t CNode::GetStringId(char * candidate)
         id.id  = uniqStrId_++;
         id.nid = pnid_;
 
+        if (trace_settings & TRACE_PROCESS)
+        {
+            trace_printf("%s@%d - Adding unique string id=[%d,%d] (%s), targetLnode=%p\n",
+                         method_name, __LINE__, id.nid, id.id, candidate, targetLNode );
+        }
+
         Config->addUniqueString(id.nid, id.id, candidate);
 
-        CReplUniqStr *repl = new CReplUniqStr ( id.nid, id.id, candidate );
-        Replicator.addItem(repl);
+#ifndef NAMESERVER_PROCESS
+        if (NameServerEnabled)
+        {
+            if (targetLNode != NULL &&
+                !MyNode->IsMyNode(targetLNode->GetNid()))
+            {
+                // Forward the unique string to the target node
+                PtpClient->AddUniqStr( id.nid
+                                     , id.id
+                                     , candidate
+                                     , targetLNode->GetNid()
+                                     , targetLNode->GetNode()->GetName());
+            }
+        }
+        else
+#endif
+        {
+#ifdef NAMESERVER_PROCESS
+            targetLNode = targetLNode;  // Make compiler happy!
+#endif
+            CReplUniqStr *repl = new CReplUniqStr ( id.nid, id.id, candidate );
+            Replicator.addItem(repl);
+        }
     }
     // temp trace
     else

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1584dc43/core/sqf/monitor/linux/pnode.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnode.h b/core/sqf/monitor/linux/pnode.h
index f0b89bb..eb4829e 100644
--- a/core/sqf/monitor/linux/pnode.h
+++ b/core/sqf/monitor/linux/pnode.h
@@ -256,7 +256,7 @@ public:
     // If candidate string has not been seen before assign a unique
     // id and store it in the config database.   In either case return
     // the unique id as the value of the method.
-    strId_t GetStringId(char *candidate);
+    strId_t GetStringId( char *candidate, CLNode *targetLNode = NULL );
 
     inline int   GetTmSyncNid( void ) { return( tmSyncNid_ ); }
     inline SyncState GetTmSyncState( void ) { return( tmSyncState_ ); }

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1584dc43/core/sqf/monitor/linux/ptpclient.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/ptpclient.cxx b/core/sqf/monitor/linux/ptpclient.cxx
index 98ca3a4..0593498 100644
--- a/core/sqf/monitor/linux/ptpclient.cxx
+++ b/core/sqf/monitor/linux/ptpclient.cxx
@@ -97,6 +97,56 @@ CPtpClient::~CPtpClient (void)
     TRACE_EXIT;
 }
 
+int  CPtpClient::AddUniqStr( int nid
+                           , int id
+                           , const char *stringValue
+                           , int targetNid
+                           , const char *targetNodeName )
+{
+    const char method_name[] = "CPtpClient::AddUniqStr";
+    TRACE_ENTRY;
+
+    if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+    {
+        trace_printf( "%s@%d - Sending InternalType_UniqStr request to %s, "
+                      "targetNid=%d\n"
+                    , method_name, __LINE__
+                    , targetNodeName
+                    , targetNid );
+    }
+
+    struct internal_msg_def msg;
+    memset(&msg, 0, sizeof(msg)); 
+    msg.type = InternalType_UniqStr;
+    msg.u.uniqstr.nid = nid;
+    msg.u.uniqstr.id  = id;
+
+    char *stringData = & msg.u.uniqstr.valueData;
+    int  stringDataLen = strlen(stringValue) + 1;
+
+    // Copy the string
+    memcpy( stringData, stringValue, stringDataLen );
+
+    int size = offsetof(struct internal_msg_def, u);
+    size += sizeof(msg.u.uniqstr);
+    size += stringDataLen;
+    
+    if (trace_settings & TRACE_PROCESS_DETAIL)
+    {
+        trace_printf( "%s@%d - size_=%d, forwarding unique string [%d, %d] (%s)\n"
+                    , method_name, __LINE__
+                    , size
+                    , msg.u.uniqstr.nid
+                    , msg.u.uniqstr.id
+                    , &msg.u.uniqstr.valueData  );
+    }
+
+    int error = SendToMon("add-unique-string", &msg, size, targetNid, targetNodeName);
+    
+    TRACE_EXIT;
+    return error;
+}
+
 int CPtpClient::InitializePtpClient( char * ptpPort )
 {
     const char method_name[] = "CPtpClient::InitializePtpClient";

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1584dc43/core/sqf/monitor/linux/ptpclient.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/ptpclient.h b/core/sqf/monitor/linux/ptpclient.h
index d46ea5e..87f2315 100644
--- a/core/sqf/monitor/linux/ptpclient.h
+++ b/core/sqf/monitor/linux/ptpclient.h
@@ -40,6 +40,11 @@ public:
     CPtpClient( void );
     virtual ~CPtpClient( void );
 
+    int  AddUniqStr( int nid
+                   , int id
+                   , const char *stringValue
+                   , int targetNid
+                   , const char *targetNodeName );
     int  InitializePtpClient( char * ptpPort );
     int  ProcessClone( CProcess *process );
     int  ProcessExit( CProcess* process

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1584dc43/core/sqf/monitor/linux/ptpcommaccept.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/ptpcommaccept.cxx b/core/sqf/monitor/linux/ptpcommaccept.cxx
index c6d5145..dc48b41 100644
--- a/core/sqf/monitor/linux/ptpcommaccept.cxx
+++ b/core/sqf/monitor/linux/ptpcommaccept.cxx
@@ -104,6 +104,16 @@ void CPtpCommAccept::processNewSock( int sockFd )
     {
         switch ( msg.type )
         {
+            case InternalType_UniqStr:
+            {
+                if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+                {
+                    trace_printf( "%s@%d" " - Received InternalType_UniqStr\n"
+                                , method_name, __LINE__ );
+                }
+                ReqQueue.enqueueUniqStrReq( &msg.u.uniqstr);
+                break;
+            }
             case InternalType_Process:
             {
                 if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1584dc43/core/sqf/monitor/linux/reqnewproc.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqnewproc.cxx b/core/sqf/monitor/linux/reqnewproc.cxx
index 5ebfec5..b5f9ec1 100644
--- a/core/sqf/monitor/linux/reqnewproc.cxx
+++ b/core/sqf/monitor/linux/reqnewproc.cxx
@@ -441,9 +441,9 @@ void CExtNewProcReq::performRequest()
     
         if (lnode->GetNumProcs() < MAX_PROCESSES)
         {
-            strId_t pathStrId = MyNode->GetStringId ( msg_->u.request.u.new_process.path );
-            strId_t ldpathStrId = MyNode->GetStringId (msg_->u.request.u.new_process.ldpath );
-            strId_t programStrId = MyNode->GetStringId ( msg_->u.request.u.new_process.program );
+            strId_t pathStrId = MyNode->GetStringId ( msg_->u.request.u.new_process.path, lnode );
+            strId_t ldpathStrId = MyNode->GetStringId (msg_->u.request.u.new_process.ldpath, lnode );
+            strId_t programStrId = MyNode->GetStringId ( msg_->u.request.u.new_process.program, lnode );
 
             if (MyNode->IsMyNode(lnode->Nid))
             {

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1584dc43/core/sqf/src/seabed/test/goall
----------------------------------------------------------------------
diff --git a/core/sqf/src/seabed/test/goall b/core/sqf/src/seabed/test/goall
index 468ce62..0c213e7 100755
--- a/core/sqf/src/seabed/test/goall
+++ b/core/sqf/src/seabed/test/goall
@@ -255,7 +255,7 @@ go241 $cluster $verbose
 go242 $cluster $verbose
 go245 $cluster $verbose
 go246 $cluster $verbose
-go249 $cluster $verbose
+####go249 $cluster $verbose
 ####go250 $cluster $verbose
 go253 $cluster $verbose
 go261 $cluster $verbose


[39/50] [abbrv] trafodion git commit: Added nameserver trace enabling file.

Posted by su...@apache.org.
Added nameserver trace enabling file.


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

Branch: refs/heads/master
Commit: 019cd5a6d85c14e91a2c3c4b17125eab04c9436e
Parents: 2eb6b83
Author: Zalo Correa <za...@esgyn.com>
Authored: Fri May 18 09:14:43 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Fri May 18 09:14:43 2018 -0700

----------------------------------------------------------------------
 core/sqf/sql/scripts/nameserver.env | 61 ++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/019cd5a6/core/sqf/sql/scripts/nameserver.env
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/nameserver.env b/core/sqf/sql/scripts/nameserver.env
new file mode 100644
index 0000000..25029ce
--- /dev/null
+++ b/core/sqf/sql/scripts/nameserver.env
@@ -0,0 +1,61 @@
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+
+# Uncomment MON_TRACE_ENABLE and specific tracing level to enable 
+# Trafodion monitor process tracing
+#MON_TRACE_ENABLE=1
+#MON_TRACE_EVLOG_MSG=1
+#MON_TRACE_INIT=1
+#MON_TRACE_RECOVERY=1
+#MON_TRACE_REQUEST=1
+#MON_TRACE_PROCESS=1
+#MON_TRACE_NOTICE=1
+#MON_TRACE_NS=1
+#MON_TRACE_SYNC=1
+# Enable TC_TRACE_* along with MON_TRACE_TRAFCONFIG for more detail
+#MON_TRACE_TRAFCONFIG=1
+#MON_TRACE_MLIO=1
+
+#MON_TRACE_REQUEST_DETAIL=1
+#MON_TRACE_PROCESS_DETAIL=1
+#MON_TRACE_NOTICE_DETAIL=1
+#MON_TRACE_SYNC_DETAIL=1
+#MON_TRACE_MLIO_DETAIL=1
+
+#MON_TRACE_MEAS=1
+#MON_TRACE_TMSYNC=1
+#MON_TRACE_STATS=1
+#MON_TRACE_ENTRY_EXIT=1
+#MON_TRACE_REDIRECTION=1
+#MON_TRACE_HEALTH=1
+#MON_TRACE_SIG_HANDLER=1
+
+# Uncomment TC_TRACE_ENABLE and specific tracing level to enable 
+# Trafodion Configuration library tracing
+# TC_TRACE_ENABLE requires MON_TRACE_TRAFCONFIG above
+#TC_TRACE_ENABLE=1
+#TC_TRACE_REQUEST=1
+#TC_TRACE_NODE=1
+#TC_TRACE_PERSIST=1
+#TC_TRACE_REGISTRY=1
+#TC_TRACE_INIT=1
+#TC_TRACE_LOG_MSG=1
+#TC_TRACE_ENTRY_EXIT=1


[47/50] [abbrv] trafodion git commit: Added name-server section to sample cluster configuration.

Posted by su...@apache.org.
Added name-server section to sample cluster configuration.


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

Branch: refs/heads/master
Commit: c036ba9181d74686269ab0c5500a6d46c8adb3a1
Parents: edb10f1
Author: Zalo Correa <za...@esgyn.com>
Authored: Mon Jun 11 16:51:20 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Mon Jun 11 16:51:20 2018 -0700

----------------------------------------------------------------------
 core/sqf/sql/scripts/sqconfig.sample | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/c036ba91/core/sqf/sql/scripts/sqconfig.sample
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqconfig.sample b/core/sqf/sql/scripts/sqconfig.sample
index f5964dd..318251c 100644
--- a/core/sqf/sql/scripts/sqconfig.sample
+++ b/core/sqf/sql/scripts/sqconfig.sample
@@ -44,15 +44,20 @@
 
 begin node
 
-node-id=0;node-name=n7;cores=0-1;processors=2;roles=connection,aggregation,storage
-node-id=1;node-name=n7;cores=2-3;processors=2;roles=connection,aggregation,storage
-node-id=2;node-name=n6;cores=0-1;processors=2;roles=connection,aggregation,storage
-node-id=3;node-name=n6;cores=2-3;processors=2;roles=connection,aggregation,storage
-node-id=4;node-name=n5;cores=0-1;processors=2;roles=connection,aggregation,storage
-node-id=5;node-name=n5;cores=2-3;processors=2;roles=connection,aggregation,storage
+node-id=0;node-name=n001.mydomain;cores=0-7;processors=8;roles=connection,aggregation,storage
+node-id=1;node-name=n002.mydomain;cores=0-7;processors=8;roles=connection,aggregation,storage
+node-id=2;node-name=n003.mydomain;cores=0-7;processors=8;roles=connection,aggregation,storage
+node-id=3;node-name=n004.mydomain;cores=0-7;processors=8;roles=connection,aggregation,storage
+node-id=4;node-name=n005.mydomain;cores=0-7;processors=8;roles=connection,aggregation,storage
+node-id=5;node-name=n006.mydomain;cores=0-7;processors=8;roles=connection,aggregation,storage
 
 end node
 
+# Note: There must be at minimum one name server which maps to the first node
+# in the node section above, i.e., node-id=0
+begin name-server
+nodes=n001.mydomain,n002.mydomain
+end name-server
 
 ###############################################################################
 #


[16/50] [abbrv] trafodion git commit: Update.

Posted by su...@apache.org.
Update.


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

Branch: refs/heads/master
Commit: f9d5b2c24433fbdd380a120ef99f78e3b0301196
Parents: 9467a47
Author: Dave George <de...@gmail.com>
Authored: Thu Apr 5 15:40:14 2018 +0000
Committer: Dave George <de...@gmail.com>
Committed: Thu Apr 5 15:40:14 2018 +0000

----------------------------------------------------------------------
 core/sqf/src/seabed/test/godb.pl | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/f9d5b2c2/core/sqf/src/seabed/test/godb.pl
----------------------------------------------------------------------
diff --git a/core/sqf/src/seabed/test/godb.pl b/core/sqf/src/seabed/test/godb.pl
index 2ba6f3d..179c2ba 100755
--- a/core/sqf/src/seabed/test/godb.pl
+++ b/core/sqf/src/seabed/test/godb.pl
@@ -84,9 +84,14 @@ sqconfigdb::addDbPersistData( "WDG_PERSIST_ZONES", "%zid"  );
 
 my $en = $ENV{'SQ_NAMESERVER_ENABLED'};
 if ($en == '1') {
-	if ($ninx > 0) {
-		sqconfigdb::addDbNameServer( $node_names[0] );
-	} else {
+	open(NSCONF, "<ns.conf");
+	my $nscnt = 0;
+	while (<NSCONF>) {
+		$_ =~ s/\s+$//;
+		sqconfigdb::addDbNameServer( $_ );
+		$nscnt++;
+	}
+	if ($nscnt == 0) {
 		sqconfigdb::addDbNameServer( 'n0' );
 	}
 }


[33/50] [abbrv] trafodion git commit: Scale testing fixes.

Posted by su...@apache.org.
http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/ptpclient.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/ptpclient.h b/core/sqf/monitor/linux/ptpclient.h
index 87f2315..e6ddeb4 100644
--- a/core/sqf/monitor/linux/ptpclient.h
+++ b/core/sqf/monitor/linux/ptpclient.h
@@ -69,6 +69,16 @@ public:
                       , CProcess *targetProcess
                       , int targetNid
                       , const char *targetNodeName );
+    int  StdInReq( int nid
+                 , int pid
+                 , StdinReqType type
+                 , int supplierNid
+                 , int supplierPid );
+    int  StdIoData( int nid
+                  , int pid
+                  , StdIoType type
+                  , ssize_t count
+                  , char *data );
 
 private:
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/ptpcommaccept.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/ptpcommaccept.cxx b/core/sqf/monitor/linux/ptpcommaccept.cxx
index fa21dc0..d380d3a 100644
--- a/core/sqf/monitor/linux/ptpcommaccept.cxx
+++ b/core/sqf/monitor/linux/ptpcommaccept.cxx
@@ -23,9 +23,10 @@
 //
 ///////////////////////////////////////////////////////////////////////////////
 
-
 using namespace std;
 
+#include <stdio.h>
+#include "redirector.h"
 #include "ptpcommaccept.h"
 #include "monlogging.h"
 #include "montrace.h"
@@ -33,11 +34,13 @@ using namespace std;
 
 #include "reqqueue.h"
 
+extern CRedirector Redirector;
 extern CReqQueue ReqQueue;
 extern CPtpCommAccept PtpCommAccept;
 extern CMonitor *Monitor;
 extern CNode *MyNode;
 extern CNodeContainer *Nodes;
+extern CRedirector Redirector;
 extern int MyPNID;
 extern char MyPtPPort[MPI_MAX_PORT_NAME];
 extern char *ErrorMsg (int error_code);
@@ -46,9 +49,9 @@ extern CommType_t CommType;
 
 
 CPtpCommAccept::CPtpCommAccept()
-           : accepting_(true)
-           , shutdown_(false)
-           , thread_id_(0)
+               : accepting_(true)
+               , shutdown_(false)
+               , thread_id_(0)
 {
     const char method_name[] = "CPtpCommAccept::CPtpCommAccept";
     TRACE_ENTRY;
@@ -82,7 +85,7 @@ void CPtpCommAccept::processNewSock( int sockFd )
         char buf[MON_STRING_BUF_SIZE];
         snprintf(buf, sizeof(buf), "[%s], unable to obtain node id from new "
                      "monitor: %s.\n", method_name, ErrorMsg(rc));
-        mon_log_write(MON_COMMACCEPT_8, SQ_LOG_ERR, buf);    
+        mon_log_write(PTP_COMMACCEPT_1, SQ_LOG_ERR, buf);    
         return;
     }
     // Get info about connecting monitor
@@ -97,7 +100,7 @@ void CPtpCommAccept::processNewSock( int sockFd )
         char buf[MON_STRING_BUF_SIZE];
         snprintf(buf, sizeof(buf), "[%s], unable to obtain node id from new "
                  "monitor: %s.\n", method_name, ErrorMsg(rc));
-        mon_log_write(MON_COMMACCEPT_8, SQ_LOG_ERR, buf);    
+        mon_log_write(PTP_COMMACCEPT_2, SQ_LOG_ERR, buf);    
         return;
     }
     else
@@ -191,6 +194,26 @@ void CPtpCommAccept::processNewSock( int sockFd )
                 ReqQueue.enqueueKillReq( &msg.u.kill );
                 break;
             }
+            case InternalType_IoData:
+            {
+                if (trace_settings & (TRACE_REDIRECTION | TRACE_PROCESS))
+                {
+                    trace_printf( "%s@%d" " - Received InternalType_IoData\n"
+                                , method_name, __LINE__ );
+                }
+                ReqQueue.enqueueIoDataReq( &msg.u.iodata );
+                break;
+            }
+            case InternalType_StdinReq:
+            {
+                if (trace_settings & (TRACE_REDIRECTION | TRACE_PROCESS))
+                {
+                    trace_printf( "%s@%d" " - Received InternalType_StdinReq\n"
+                                , method_name, __LINE__ );
+                }
+                ReqQueue.enqueueStdInReq( &msg.u.stdin_req );
+                break;
+            }
             default:
             {
                 abort();
@@ -273,7 +296,7 @@ void CPtpCommAccept::commAcceptorSock()
             char buf[MON_STRING_BUF_SIZE];
             snprintf(buf, sizeof(buf), "[%s], cannot accept new monitor: %s.\n",
                      method_name, strerror(errno));
-            mon_log_write(MON_COMMACCEPT_16, SQ_LOG_ERR, buf);
+            mon_log_write(PTP_COMMACCEPT_6, SQ_LOG_ERR, buf);
         }
         else
         {
@@ -330,7 +353,7 @@ static void *ptpCommAccept(void *arg)
         char buf[MON_STRING_BUF_SIZE];
         snprintf(buf, sizeof(buf), "[%s], pthread_sigmask error=%d\n",
                  method_name, rc);
-        mon_log_write(MON_COMMACCEPT_17, SQ_LOG_ERR, buf);
+        mon_log_write(PTP_COMMACCEPT_7, SQ_LOG_ERR, buf);
     }
 
     // Enter thread processing loop
@@ -353,7 +376,7 @@ void CPtpCommAccept::start()
         char buf[MON_STRING_BUF_SIZE];
         snprintf(buf, sizeof(buf), "[%s], thread create error=%d\n",
                  method_name, rc);
-        mon_log_write(MON_COMMACCEPT_18, SQ_LOG_ERR, buf);
+        mon_log_write(PTP_COMMACCEPT_8, SQ_LOG_ERR, buf);
     }
 
     TRACE_EXIT;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/redirector.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/redirector.cxx b/core/sqf/monitor/linux/redirector.cxx
index 54710bc..43bb231 100644
--- a/core/sqf/monitor/linux/redirector.cxx
+++ b/core/sqf/monitor/linux/redirector.cxx
@@ -58,6 +58,7 @@ using namespace std;
 #include "replicate.h"
 #include "monsonar.h"
 #include "reqqueue.h"
+#include "ptpclient.h"
 #endif
 
 #ifndef NAMESERVER_PROCESS
@@ -70,6 +71,8 @@ extern CNodeContainer *Nodes;
 extern CReplicate Replicator;
 extern CMonStats *MonStats;
 extern CReqQueue ReqQueue;
+extern CPtpClient *PtpClient;
+extern bool NameServerEnabled;
 #endif
 
 const char *EpollEventString( __uint32_t events )
@@ -662,10 +665,23 @@ int CRedirectAncestorStdin::handleInput()
             reqType = STDIN_FLOW_ON;
         }
 
-    CReplStdinReq *repl
-        = new CReplStdinReq(MyPNID, pid_, reqType, ancestorNid_, ancestorPid_ );
-    Replicator.addItem(repl);
-
+        if (NameServerEnabled)
+        {
+            PtpClient->StdInReq( MyPNID
+                               , pid_
+                               , reqType
+                               , ancestorNid_
+                               , ancestorPid_  );
+        }
+        else
+        {
+            CReplStdinReq *repl = new CReplStdinReq( MyPNID
+                                                   , pid_
+                                                   , reqType
+                                                   , ancestorNid_
+                                                   , ancestorPid_ );
+            Replicator.addItem(repl);
+        }
     }
 
     TRACE_EXIT;
@@ -856,9 +872,24 @@ void CRedirectStdinRemote::handleOutput(ssize_t count, char *buffer)
                      (int)count);
     }
 
-    CReplStdioData *repl
-        = new CReplStdioData(requesterNid_, pid_, STDIN_DATA, count, buffer );
-    Replicator.addItem(repl);
+    if (NameServerEnabled)
+    {
+        PtpClient->StdIoData( requesterNid_
+                            , pid_
+                            , STDIN_DATA
+                            , count
+                            , buffer );
+    }
+    else
+    {
+        CReplStdioData *repl = new CReplStdioData( requesterNid_
+                                                 , pid_
+                                                 , STDIN_DATA
+                                                 , count
+                                                 , buffer );
+        Replicator.addItem(repl);
+    }
+
     if (sonar_verify_state(SONAR_ENABLED | SONAR_MONITOR_ENABLED))
        MonStats->StdinRemoteDataReplIncr();
 
@@ -1144,10 +1175,24 @@ void CRedirectAncestorStdout::handleOutput(ssize_t count, char *buffer)
                      (int)count);
     }
 
-    CReplStdioData *repl
-        = new CReplStdioData(ancestor_nid_, ancestor_pid_, STDOUT_DATA, 
-                              count, buffer );
-    Replicator.addItem(repl);
+    if (NameServerEnabled)
+    {
+        PtpClient->StdIoData( ancestor_nid_
+                            , ancestor_pid_
+                            , STDOUT_DATA
+                            , count
+                            , buffer );
+    }
+    else
+    {
+        CReplStdioData *repl = new CReplStdioData( ancestor_nid_
+                                                 , ancestor_pid_
+                                                 , STDOUT_DATA
+                                                 , count
+                                                 , buffer );
+        Replicator.addItem(repl);
+    }
+
     if (sonar_verify_state(SONAR_ENABLED | SONAR_MONITOR_ENABLED))
        MonStats->StdioDataReplIncr();
 
@@ -1607,10 +1652,23 @@ void CRedirector::stdinFd(int nid, int pid, int &pipeFd, char filename[],
         fdMap_.insert(std::make_pair(pipeFd, redirect));
         fdMapLock_.unlock();
 
-        CReplStdinReq *repl
-            = new CReplStdinReq(nid, pid, STDIN_REQ_DATA, ancestor_nid,
-                                ancestor_pid );
-        Replicator.addItem(repl);
+        if (NameServerEnabled)
+        {
+            PtpClient->StdInReq( nid
+                               , pid
+                               , STDIN_REQ_DATA
+                               , ancestor_nid
+                               , ancestor_pid );
+        }
+        else
+        {
+            CReplStdinReq *repl = new CReplStdinReq( nid
+                                                   , pid
+                                                   , STDIN_REQ_DATA
+                                                   , ancestor_nid
+                                                   , ancestor_pid );
+            Replicator.addItem(repl);
+        }
     }
 
     TRACE_EXIT;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/replicate.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/replicate.cxx b/core/sqf/monitor/linux/replicate.cxx
index 0b6fadb..f9ebf53 100644
--- a/core/sqf/monitor/linux/replicate.cxx
+++ b/core/sqf/monitor/linux/replicate.cxx
@@ -71,6 +71,9 @@ void CReplObj::validateObj()
 #ifdef NAMESERVER_PROCESS
 struct dummy_sizeof_def {};
 #endif
+#ifndef EXCHANGE_CPU_SCHEDULING_DATA
+struct dummy1_sizeof_def {};
+#endif
 
 // Determine the maximum size of a replication object (excluding CReplEvent)
 int CReplObj::calcAllocSize()
@@ -81,7 +84,11 @@ int CReplObj::calcAllocSize()
                                                                                         sizeof(CReplNodeDelete)),
                                                                                     sizeof(CReplSoftNodeUp)),
                                                                                 sizeof(CReplSoftNodeDown)),
+#ifdef EXCHANGE_CPU_SCHEDULING_DATA
                                                                             sizeof(CReplSchedData)),
+#else
+                                                                            sizeof(dummy1_sizeof_def)),
+#endif
                                                                         sizeof(CReplActivateSpare)),
                                                                     sizeof(CReplConfigData)),
                                                                 sizeof(CReplOpen)),
@@ -1789,6 +1796,7 @@ bool CReplNodeName::replicate(struct internal_msg_def *&msg)
     return true;
 }
 
+#ifdef EXCHANGE_CPU_SCHEDULING_DATA
 CReplSchedData::CReplSchedData()
 {
     // Add eyecatcher sequence as a debugging aid
@@ -1865,6 +1873,7 @@ bool CReplSchedData::replicate(struct internal_msg_def *&msg)
 
     return true;
 }
+#endif
 
 
 CReplNodeUp::CReplNodeUp(int pnid) : pnid_(pnid)

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/replicate.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/replicate.h b/core/sqf/monitor/linux/replicate.h
index 5d4a7cc..3ae0909 100644
--- a/core/sqf/monitor/linux/replicate.h
+++ b/core/sqf/monitor/linux/replicate.h
@@ -424,6 +424,7 @@ private:
 };
 
 
+#ifdef EXCHANGE_CPU_SCHEDULING_DATA
 class CReplSchedData: public CReplObj
 {
 public:
@@ -435,6 +436,7 @@ public:
 private:
 
 };
+#endif
 
 #ifndef NAMESERVER_PROCESS
 class CReplStdioData: public CReplObj

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/reqdump.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqdump.cxx b/core/sqf/monitor/linux/reqdump.cxx
index 159219a..4e56bb5 100644
--- a/core/sqf/monitor/linux/reqdump.cxx
+++ b/core/sqf/monitor/linux/reqdump.cxx
@@ -75,7 +75,7 @@ void CExtDumpReq::performRequest()
 
     CProcess *target;
     CProcess *requester;
-    CLNode   *node;
+    CLNode   *lnode;
     string    target_process_name;
     int       target_nid = -1;
     int       target_pid = -1;
@@ -144,9 +144,10 @@ void CExtDumpReq::performRequest()
                              method_name, __LINE__, target->GetName(),
                              target->GetNid(), target->GetPid());
             target->parentContext(msg_);
-            if (node->Dump_Process(requester,
-                                   target,
-                                   msg_->u.request.u.dump.path) != SUCCESS)
+            lnode = Nodes->GetLNode(target_nid);
+            if (lnode->Dump_Process(requester,
+                                    target,
+                                    msg_->u.request.u.dump.path) != SUCCESS)
                 rc = MPI_ERR_SPAWN;
         }
         else

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/reqnewproc.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqnewproc.cxx b/core/sqf/monitor/linux/reqnewproc.cxx
index b5f9ec1..a6da01e 100644
--- a/core/sqf/monitor/linux/reqnewproc.cxx
+++ b/core/sqf/monitor/linux/reqnewproc.cxx
@@ -461,6 +461,7 @@ void CExtNewProcReq::performRequest()
                                                 programStrId,
                                                 msg_->u.request.u.new_process.infile,
                                                 msg_->u.request.u.new_process.outfile
+                                                , 0 // tag
                                                 , result
                                                 );
                 if ( process )
@@ -468,7 +469,7 @@ void CExtNewProcReq::performRequest()
                     process->userArgs (  msg_->u.request.u.new_process.argc,
                                          msg_->u.request.u.new_process.argv );
                 }
-                if ( process && process->Create(process->GetParent(), result))
+                if ( process && process->Create(process->GetParent(), 0, result))
                 {
                     MyNode->AddToNameMap(process);
                     MyNode->AddToPidMap(process->GetPid(), process);

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/reqprocinfo.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqprocinfo.cxx b/core/sqf/monitor/linux/reqprocinfo.cxx
index 566a92b..84dc3a7 100644
--- a/core/sqf/monitor/linux/reqprocinfo.cxx
+++ b/core/sqf/monitor/linux/reqprocinfo.cxx
@@ -634,99 +634,118 @@ void CExtProcInfoContReq::performRequest()
     TRACE_ENTRY;
 
 #ifndef NAMESERVER_PROCESS
-    if ( NameServerEnabled )
+    bool    getMonitorInfo = false;
+    if (strcasecmp(msg_->u.request.u.process_info.target_process_name, "MONITOR") == 0)
+    {
+        getMonitorInfo = true;
+        msg_->u.request.u.process_info.target_process_name[0] = 0;
+    }
+
+    if ( NameServerEnabled && !getMonitorInfo )
         NameServer->ProcessInfoCont(msg_); // in reqQueue thread (CExternalReq)
 #endif
 
-    int count = 0;
-    int nid;
-    int pid;
-
-    // Record statistics (sonar counters)
-    if (sonar_verify_state(SONAR_ENABLED | SONAR_MONITOR_ENABLED))
-       MonStats->req_type_processinfocont_Incr();
-
-    if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+#ifndef NAMESERVER_PROCESS
+    if ( NameServerEnabled && !getMonitorInfo )
     {
-        trace_printf("%s@%d request #%ld: ProcessInfoCont, context (%d, %d), "
-                     "process type=%d, allnodes=%d\n", method_name, __LINE__,
-                     id_,
-                     msg_->u.request.u.process_info_cont.context[0].nid,
-                     msg_->u.request.u.process_info_cont.context[0].pid,
-                     msg_->u.request.u.process_info_cont.type,
-                     msg_->u.request.u.process_info_cont.allNodes);
+        // Send reply to requester
+        lioreply(msg_, pid_);
     }
+    else
+    {
+#endif
+        int count = 0;
+        int nid;
+        int pid;
 
-    msg_->u.reply.u.process_info.more_data = false;
-
-    // Using context from the last reply, locate next process.
-    // Generally the final process in the last reply will still exist
-    // so we locate its CProcess object for continuation.  If that
-    // process no longer exists we try to find other processes in the
-    // context list until we find the CProcess object or run out of
-    // context.
-    int i = -1;
-    CProcess *process = 0;
+        // Record statistics (sonar counters)
+        if (sonar_verify_state(SONAR_ENABLED | SONAR_MONITOR_ENABLED))
+           MonStats->req_type_processinfocont_Incr();
 
-    while (!process && ++i < MAX_PROC_CONTEXT)
-    {
-        nid = msg_->u.request.u.process_info_cont.context[i].nid;
-        pid = msg_->u.request.u.process_info_cont.context[i].pid;
-        if (nid >= 0 && nid < Nodes->GetLNodesConfigMax())
+        if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
         {
-            process = Nodes->GetLNode(nid)->GetProcessL(pid);
+            trace_printf("%s@%d request #%ld: ProcessInfoCont, context (%d, %d), "
+                         "process type=%d, allnodes=%d\n", method_name, __LINE__,
+                         id_,
+                         msg_->u.request.u.process_info_cont.context[0].nid,
+                         msg_->u.request.u.process_info_cont.context[0].pid,
+                         msg_->u.request.u.process_info_cont.type,
+                         msg_->u.request.u.process_info_cont.allNodes);
         }
-    }
 
+        msg_->u.reply.u.process_info.more_data = false;
 
-    if (!process)
-    {   // Could not locate any process in the context list.  So
-        // begin with the first process in the node.
-        nid = msg_->u.request.u.process_info_cont.context[0].nid;
-        if (trace_settings & TRACE_REQUEST)
-           trace_printf("%s@%d" " could not find context process, restarting for node="  "%d" "\n", method_name, __LINE__, nid);
-        if (nid >= 0 && nid < Nodes->GetLNodesConfigMax())
+        // Using context from the last reply, locate next process.
+        // Generally the final process in the last reply will still exist
+        // so we locate its CProcess object for continuation.  If that
+        // process no longer exists we try to find other processes in the
+        // context list until we find the CProcess object or run out of
+        // context.
+        int i = -1;
+        CProcess *process = 0;
+
+        while (!process && ++i < MAX_PROC_CONTEXT)
         {
-            process = ProcessInfo_GetProcess (nid, msg_->u.request.u.process_info_cont.allNodes);
+            nid = msg_->u.request.u.process_info_cont.context[i].nid;
+            pid = msg_->u.request.u.process_info_cont.context[i].pid;
+            if (nid >= 0 && nid < Nodes->GetLNodesConfigMax())
+            {
+                process = Nodes->GetLNode(nid)->GetProcessL(pid);
+            }
         }
-    }
 
-    // Assuming we found a CProcess object resume returning data with
-    // the subsequent process.
-    if (process)
-    {
-        process = process->GetNextL();
+
         if (!process)
-        {   // We were at the last process on the node.  Get first process
-            // on the next node (if there is a next node).
-            if (++nid < Nodes->GetLNodesConfigMax())
+        {   // Could not locate any process in the context list.  So
+            // begin with the first process in the node.
+            nid = msg_->u.request.u.process_info_cont.context[0].nid;
+            if (trace_settings & TRACE_REQUEST)
+               trace_printf("%s@%d" " could not find context process, restarting for node="  "%d" "\n", method_name, __LINE__, nid);
+            if (nid >= 0 && nid < Nodes->GetLNodesConfigMax())
             {
-                process = ProcessInfo_GetProcess(nid,
-                                msg_->u.request.u.process_info_cont.allNodes);
+                process = ProcessInfo_GetProcess (nid, msg_->u.request.u.process_info_cont.allNodes);
             }
         }
 
+        // Assuming we found a CProcess object resume returning data with
+        // the subsequent process.
         if (process)
         {
-            count = ProcessInfo_BuildReply(
-                                process,
-                                msg_,
-                                msg_->u.request.u.process_info_cont.type,
-                                msg_->u.request.u.process_info_cont.allNodes,
-                                (char *) "");
+            process = process->GetNextL();
+            if (!process)
+            {   // We were at the last process on the node.  Get first process
+                // on the next node (if there is a next node).
+                if (++nid < Nodes->GetLNodesConfigMax())
+                {
+                    process = ProcessInfo_GetProcess(nid,
+                                    msg_->u.request.u.process_info_cont.allNodes);
+                }
+            }
+
+            if (process)
+            {
+                count = ProcessInfo_BuildReply(
+                                    process,
+                                    msg_,
+                                    msg_->u.request.u.process_info_cont.type,
+                                    msg_->u.request.u.process_info_cont.allNodes,
+                                    (char *) "");
 
+            }
         }
-    }
 
-    msg_->u.reply.type = ReplyType_ProcessInfo;
-    msg_->u.reply.u.process_info.num_processes = count;
-    msg_->u.reply.u.process_info.return_code = MPI_SUCCESS;
+        msg_->u.reply.type = ReplyType_ProcessInfo;
+        msg_->u.reply.u.process_info.num_processes = count;
+        msg_->u.reply.u.process_info.return_code = MPI_SUCCESS;
 
 #ifdef NAMESERVER_PROCESS
-    monreply(msg_, sockFd_);
+        monreply(msg_, sockFd_);
 #else
-    // Send reply to requester
-    lioreply(msg_, pid_);
+        // Send reply to requester
+        lioreply(msg_, pid_);
+#endif
+#ifndef NAMESERVER_PROCESS
+    }
 #endif
 
     TRACE_EXIT;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/reqqueue.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqqueue.cxx b/core/sqf/monitor/linux/reqqueue.cxx
index ac559c2..e97c0a7 100644
--- a/core/sqf/monitor/linux/reqqueue.cxx
+++ b/core/sqf/monitor/linux/reqqueue.cxx
@@ -23,6 +23,7 @@
 //
 ///////////////////////////////////////////////////////////////////////////////
 
+#include <stddef.h>
 #include <stdio.h>
 #include <zlib.h>
 #include "reqqueue.h"
@@ -40,6 +41,7 @@
 #include "internal.h"
 #include "healthcheck.h"
 #ifndef NAMESERVER_PROCESS
+#include "redirector.h"
 #include "nameserver.h"
 #include "ptpclient.h"
 #endif
@@ -59,6 +61,7 @@ extern CHealthCheck HealthCheck;
 #ifdef NAMESERVER_PROCESS
 extern char *ErrorMsg (int error_code);
 #else
+extern CRedirector Redirector;
 extern bool NameServerEnabled;
 extern CPtpClient *PtpClient;
 extern CNameServer *NameServer;
@@ -69,6 +72,10 @@ extern int req_type_startup;
 
 extern bool IAmIntegrating;
 extern bool IAmIntegrated;
+extern bool IsRealCluster;
+extern bool IsAgentMode;
+extern bool IsMaster;
+extern bool ZClientEnabled;
 
 extern CommType_t CommType;
 extern bool IsRealCluster;
@@ -1247,6 +1254,93 @@ void CIntExitNsReq::performRequest()
 #endif
 
 #ifndef NAMESERVER_PROCESS
+CIntIoDataReq::CIntIoDataReq( ioData_t *ioData )
+             : CInternalReq()
+             , nid_( ioData->nid )
+             , pid_( ioData->pid )
+             , verifier_( ioData->verifier )
+             , ioType_( ioData->ioType )
+             , length_( ioData->length )
+{
+    // Add eyecatcher sequence as a debugging aid
+    memcpy(&eyecatcher_, "RqIK", 4);
+    memcpy(data_, ioData->data, (length_<=MAX_SYNC_DATA)?length_:MAX_SYNC_DATA);
+}
+
+CIntIoDataReq::~CIntIoDataReq()
+{
+    // Alter eyecatcher sequence as a debugging aid to identify deleted object
+    memcpy(&eyecatcher_, "rQik", 4);
+}
+
+void CIntIoDataReq::populateRequestString( void )
+{
+    char strBuf[MON_STRING_BUF_SIZE/2];
+    sprintf( strBuf, "IntReq(%s) req #=%ld (nid=%d/pid=%d/verifier=%d), type=%d, length=%d"
+                   , CReqQueue::intReqType[InternalType_IoData]
+                   , getId(), nid_, pid_, verifier_, ioType_, length_ );
+    requestString_.assign( strBuf );
+}
+
+void CIntIoDataReq::performRequest()
+{
+    const char method_name[] = "CIntIoDataReq::performRequest";
+    TRACE_ENTRY;
+
+    if (trace_settings & (TRACE_REDIRECTION | TRACE_PROCESS))
+    {
+        trace_printf( "%s@%d" " - IO data "
+                      "to (%d,%d:%d), count=%d\n(%s)"
+                    , method_name, __LINE__
+                    , nid_
+                    , pid_
+                    , verifier_
+                    , length_
+                    , length_?data_:"\n" );
+    }
+    if ( MyNode->IsMyNode( nid_ ) )
+    {
+        if (trace_settings & (TRACE_SYNC | TRACE_REDIRECTION))
+            trace_printf( "%s@%d - processing IO Data for (%d, %d:%d)\n"
+                        , method_name, __LINE__
+                        , nid_, pid_, verifier_ );
+
+        CLNode  *lnode;
+        lnode = Nodes->GetLNode( nid_ );
+        if ( lnode )
+        {
+            CProcess *process;
+            process = lnode->GetProcessL( pid_ );
+            if (process)
+            {
+                int fd;
+                if (ioType_ == STDIN_DATA)
+                {
+                    fd = process->FdStdin();
+                }
+                else
+                {
+                    fd = process->FdStdout();
+                }
+                Redirector.disposeIoData( fd, length_, data_ );
+            }
+            else
+            {
+                char buf[MON_STRING_BUF_SIZE];
+                snprintf( buf, sizeof(buf)
+                        , "[%s], Can't find process nid"
+                          "=%d, pid=%d for processing IO Data.\n"
+                        , method_name, nid_, pid_ );
+                mon_log_write(MON_REQ_IODATA_1, SQ_LOG_ERR, buf);
+            }
+        }
+    }
+
+    TRACE_EXIT;
+}
+#endif
+
+#ifndef NAMESERVER_PROCESS
 CIntKillReq::CIntKillReq( struct kill_def *killDef )
             : CInternalReq()
             , nid_( killDef->nid )
@@ -1527,8 +1621,17 @@ void CIntNewProcReq::performRequest()
                                 programStrId_,
                                 &stringData_[nameLen_],  // infile
                                 &stringData_[nameLen_ + infileLen_], // outfile
+                                reqTag_,
                                 result);
-#ifndef NAMESERVER_PROCESS
+#ifdef NAMESERVER_PROCESS
+            if (  newProcess == NULL )
+            {
+                char buf[MON_STRING_BUF_SIZE];
+                sprintf( buf, "[%s], Can't create process %s (%d,%d:%d)\n"
+                       , method_name, &stringData_[0],nid_, pid_, verifier_ );
+                mon_log_write(MON_INTREQ_NEWPROC_1, SQ_LOG_ERR, buf);
+            }
+#else
             if ( newProcess != NULL )
             {
                 newProcess->userArgs ( argc_, argvLen_,
@@ -1536,27 +1639,19 @@ void CIntNewProcReq::performRequest()
                                                     + outfileLen_] );
 
                 // Create the new process (fork/exec)
-                if (newProcess->Create(newProcess->GetParent(), result))
+                if (newProcess->Create(newProcess->GetParent(), reqTag_, result))
                 {
                     MyNode->AddToNameMap( newProcess );
                     MyNode->AddToPidMap( newProcess->GetPid(),  newProcess );
 
-                    if (NameServerEnabled)
-                    {
-                        // Send actual pid and process name back to parent
-                        PtpClient->ProcessInit( newProcess
-                                              , reqTag_
-                                              , 0
-                                              , parentNid_ );
-                    }
-                    else
+                    if (!NameServerEnabled)
                     {
                         // Successfully forked process.  Replicate actual process
                         // id and process name.
                         CReplProcInit *repl
                             = new CReplProcInit(newProcess, reqTag_, 0, parentNid_);
                         Replicator.addItem(repl);
-                   }
+                    }
                 }
                 else
                 {
@@ -1592,7 +1687,7 @@ void CIntNewProcReq::performRequest()
         sprintf(buf, "[%s], Can't find parent process nid=%d, pid=%d "
                 "for process create.\n", method_name,
                 parentNid_, parentPid_ );
-        mon_log_write(MON_CLUSTER_HANDLEOTHERNODE_10, SQ_LOG_ERR, buf);
+        mon_log_write(MON_INTREQ_NEWPROC_2, SQ_LOG_ERR, buf);
     }
 
     TRACE_EXIT;
@@ -1998,8 +2093,10 @@ void CIntProcInitReq::performRequest()
     const char method_name[] = "CIntProcInitReq::performRequest";
     TRACE_ENTRY;
 
-    if (trace_settings & TRACE_SYNC)
-        trace_printf("%s@%d - processing process init %s (%d, %d), tag %p\n", method_name, __LINE__, name_, nid_, pid_, process_);
+    if (trace_settings & (TRACE_SYNC | TRACE_PROCESS))
+        trace_printf( "%s@%d - processing process init %s (%d, %d), result=%d, tag=%p\n"
+                    , method_name, __LINE__
+                    , name_, nid_, pid_, result_, static_cast<void*>(process_) );
 
     if ( result_ != 0 )
     {  // Was unable to create the process, send response to requester
@@ -2020,9 +2117,8 @@ void CIntProcInitReq::performRequest()
         process_->SetName ( name_ );
 
         // Add to pid and name maps
-        Nodes->GetLNode (process_->GetNid())->GetNode()->
-            AddToPidMap(process_->GetPid(), process_);
-        Nodes->GetLNode (process_->GetNid())->GetNode()->AddToNameMap(process_);
+        Nodes->GetLNode( process_->GetNid() )->GetNode()->AddToPidMap(process_->GetPid(), process_);
+        Nodes->GetLNode( process_->GetNid() )->GetNode()->AddToNameMap(process_);
 
         if (process_->IsBackup())
         {
@@ -2032,7 +2128,7 @@ void CIntProcInitReq::performRequest()
             if (parent)
             {   // Set link from primary process object to
                 // this backup process object.
-                if (trace_settings & TRACE_SYNC)
+                if (trace_settings & (TRACE_SYNC | TRACE_PROCESS))
                 {
                     trace_printf("%s@%d - For backup process (%d, %d)"
                                  ", for parent (%d, %d) setting "
@@ -2125,6 +2221,127 @@ void CIntSetReq::performRequest()
     TRACE_EXIT;
 }
 
+#ifndef NAMESERVER_PROCESS
+CIntStdInReq::CIntStdInReq( struct stdin_req_def *stdin_req )
+             : CInternalReq()
+             , nid_( stdin_req->nid )
+             , pid_( stdin_req->pid )
+             , verifier_( stdin_req->verifier )
+             , reqType_( stdin_req->reqType )
+             , supplierNid_( stdin_req->supplier_nid )
+             , supplierPid_( stdin_req->supplier_pid )
+{
+    // Add eyecatcher sequence as a debugging aid
+    memcpy(&eyecatcher_, "RqIS", 4);
+}
+
+CIntStdInReq::~CIntStdInReq()
+{
+    // Alter eyecatcher sequence as a debugging aid to identify deleted object
+    memcpy(&eyecatcher_, "rQis", 4);
+}
+
+void CIntStdInReq::populateRequestString( void )
+{
+    char strBuf[MON_STRING_BUF_SIZE/2];
+    sprintf( strBuf, "IntReq(%s) req #=%ld (nid=%d/pid=%d/verifier=%d), "
+                     "type=%d, supplier (%d,%d)"
+                   , CReqQueue::intReqType[InternalType_StdinReq]
+                   , getId(), nid_, pid_, verifier_, reqType_
+                   , supplierNid_, supplierPid_ );
+    requestString_.assign( strBuf );
+}
+
+void CIntStdInReq::performRequest()
+{
+    const char method_name[] = "CIntStdInReq::performRequest";
+    TRACE_ENTRY;
+
+    if (trace_settings & (TRACE_REDIRECTION | TRACE_PROCESS))
+    {
+        trace_printf("%s@%d - stdin request from (%d,%d:%d)"
+                     ", type=%d, for supplier (%d,%d)\n"
+                    , method_name, __LINE__
+                    , nid_
+                    , pid_
+                    , verifier_
+                    , reqType_
+                    , supplierNid_
+                    , supplierPid_ );
+    }
+
+    if ( !MyNode->IsMyNode( supplierNid_ ) )
+    {
+        return;
+    }
+
+    CLNode  *lnode;
+    lnode = Nodes->GetLNode( nid_ );
+    if ( lnode == NULL )
+    {
+        return;
+    }
+
+    CProcess *process;
+    process = lnode->GetProcessL( pid_ );
+    if (process)
+    {
+        if (reqType_ == STDIN_REQ_DATA)
+        {
+            // Set up to forward stdin data to requester.
+            // Save file descriptor associated with stdin
+            // so can find the redirector object later.
+            CProcess *supProcess;
+            lnode = Nodes->GetLNode( supplierNid_ );
+            if ( lnode )
+            {
+                supProcess = lnode->GetProcessL ( supplierPid_ );
+                if (supProcess)
+                {
+                    int fd;
+                    fd = Redirector.stdinRemote( supProcess->infile()
+                                               , supplierNid_
+                                               , supplierPid_ );
+                    process->FdStdin(fd);
+                }
+                else
+                {
+                    char buf[MON_STRING_BUF_SIZE];
+                    snprintf( buf, sizeof(buf), 
+                              "[%s], Can't find supplier process "
+                              "nid=%d, pid=%d for stdin data request.\n"
+                            , method_name
+                            , supplierNid_
+                            , supplierPid_);
+                    mon_log_write(MON_REQ_STDIN_1, SQ_LOG_ERR, buf);
+                }
+            }
+        }
+        else if (reqType_ == STDIN_FLOW_OFF)
+        {
+            Redirector.stdinOff(process->FdStdin());
+        }
+        else if (reqType_ == STDIN_FLOW_ON)
+        {
+            Redirector.stdinOn(process->FdStdin());
+        }
+    }
+    else
+    {
+        char buf[MON_STRING_BUF_SIZE];
+        snprintf( buf, sizeof(buf)
+                , "[%s], Can't find process nid=%d, "
+                  "pid=%d for stdin data request.\n"
+                , method_name
+                , nid_
+                , pid_ );
+        mon_log_write(MON_REQ_STDIN_2, SQ_LOG_ERR, buf);
+    }
+
+    TRACE_EXIT;
+}
+#endif
+
 CIntUniqStrReq::CIntUniqStrReq( int nid, int id, const char *value )
     : CInternalReq(), nid_(nid), id_(id)
 {
@@ -3191,9 +3408,7 @@ void CIntReviveReq::performRequest()
 #ifndef NAMESERVER_PROCESS
     // unpack the current TM leader
     Monitor->SetTmLeader( header.tmLeader_ );
-#endif
 
-#ifndef NAMESERVER_PROCESS
     if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
         trace_printf( "%s@%d - TM leader (%d) unpacked\n", method_name, __LINE__
                     , Monitor->GetTmLeader() );
@@ -4409,7 +4624,17 @@ void CReqQueue::enqueueExitNsReq( struct exit_ns_def *exitDef )
 #endif
 
 #ifndef NAMESERVER_PROCESS
-//void CReqQueue::enqueueKillReq( int nid, int pid, bool abort )
+void CReqQueue::enqueueIoDataReq( ioData_t *ioData )
+{
+    CInternalReq * request;
+
+    request = new CIntIoDataReq ( ioData );
+
+    enqueueReq ( request );
+}
+#endif
+
+#ifndef NAMESERVER_PROCESS
 void CReqQueue::enqueueKillReq( struct kill_def *killDef )
 {
     CInternalReq * request;
@@ -4495,6 +4720,17 @@ void CReqQueue::enqueueSetReq( struct set_def *setDef )
     enqueueReq ( request );
 }
 
+#ifndef NAMESERVER_PROCESS
+void CReqQueue::enqueueStdInReq( struct stdin_req_def *stdin_req )
+{
+    CInternalReq * request;
+
+    request = new CIntStdInReq ( stdin_req );
+
+    enqueueReq ( request );
+}
+#endif
+
 void CReqQueue::enqueueUniqStrReq( struct uniqstr_def *uniqStrDef )
 {
     CIntUniqStrReq * request;
@@ -4549,7 +4785,7 @@ void CReqQueue::enqueueTmReadyReq( int nid )
 }
 #endif
 
-// this function moves the queued requests from revieve queue to the main request queue.
+// this function moves the queued requests from revive queue to the main request queue.
 // it will skip the requests whose seq num is less than the given one.
 void CReqQueue::processReviveRequests(unsigned long long minSeqNum)
 {

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/reqqueue.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqqueue.h b/core/sqf/monitor/linux/reqqueue.h
index 995912d..34cde08 100644
--- a/core/sqf/monitor/linux/reqqueue.h
+++ b/core/sqf/monitor/linux/reqqueue.h
@@ -988,6 +988,27 @@ private:
 #endif
 
 #ifndef NAMESERVER_PROCESS
+class CIntIoDataReq: public CInternalReq
+{
+public:
+    CIntIoDataReq( ioData_t *ioData );
+    virtual ~CIntIoDataReq();
+
+    void performRequest();
+
+private:
+    void populateRequestString( void );
+
+    int nid_;
+    int pid_;
+    Verifier_t verifier_;
+    StdIoType ioType_;
+    int  length_;                     // Length in bytes of Data buffer used
+    char data_[MAX_SYNC_DATA];
+};
+#endif
+
+#ifndef NAMESERVER_PROCESS
 class CIntKillReq: public CInternalReq
 {
 public:
@@ -1150,6 +1171,27 @@ private:
     char value_[MAX_VALUE_SIZE_INT];
 };
 
+#ifndef NAMESERVER_PROCESS
+class CIntStdInReq: public CInternalReq
+{
+public:
+    CIntStdInReq( struct stdin_req_def *stdin_req );
+    virtual ~CIntStdInReq();
+
+    void performRequest();
+
+private:
+    void populateRequestString( void );
+
+    int nid_;
+    int pid_;
+    Verifier_t verifier_;
+    StdinReqType reqType_;
+    int supplierNid_;       // Node id of process supplying stdin data
+    int supplierPid_;       // Process id of process to supplying stdin data
+};
+#endif
+
 class CIntUniqStrReq: public CInternalReq
 {
 public:
@@ -1506,6 +1548,7 @@ class CReqQueue
     void enqueueDeleteReq( struct delete_def *deleteDef );
 #endif
 #ifndef NAMESERVER_PROCESS
+    void enqueueIoDataReq( ioData_t *ioData );
     void enqueueKillReq( struct kill_def *killDef );
 #endif
     void enqueueNewProcReq( struct process_def *procDef );
@@ -1515,6 +1558,9 @@ class CReqQueue
 #endif
     void enqueueProcInitReq( struct process_init_def *procInitDef );
     void enqueueSetReq( struct set_def *setDef );
+#ifndef NAMESERVER_PROCESS
+    void enqueueStdInReq( struct stdin_req_def *stdin_req );
+#endif
     void enqueueUniqStrReq( struct uniqstr_def *uniqStrDef );
 #ifndef NAMESERVER_PROCESS
     void enqueueChildDeathReq ( pid_t pid );
@@ -1637,6 +1683,7 @@ private:
       RQIH   CIntShutdownReq
       RQII   CIntProcInitReq
       RQIJ   CIntNodeAddReq
+      RqIK   CIntIoDataReq
       RQIK   CIntKillReq
       RQIL   CIntCloneProcReq
       RQIM   CIntActivateSpareReq
@@ -1646,6 +1693,7 @@ private:
       RQIQ   CIntUpReq
       RQIR   CIntReviveReq
       RQIS   CIntSetReq
+      RqIS   CIntStdInReq
       RQIT   CIntNodeDeleteReq
       RQIU   CQuiesceReq
       RQIV   CIntTmReadyReq

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/shell.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/shell.cxx b/core/sqf/monitor/linux/shell.cxx
index 20b41e6..51206d3 100644
--- a/core/sqf/monitor/linux/shell.cxx
+++ b/core/sqf/monitor/linux/shell.cxx
@@ -323,7 +323,7 @@ const char *StateString( STATE state )
         str = "Shutdown";
         break;
     case State_Initializing:
-        str = "Initing";
+        str = "Initializing";
         break;
     case State_Merged:
         str = "Merged";
@@ -3045,7 +3045,6 @@ void listZoneInfo( int nid, int zid )
 {
     int i;
     int count;
-    int  last_nid = 0;
     MPI_Status status;
 
     if ( gp_local_mon_io->acquire_msg( &msg ) != 0 )
@@ -3098,7 +3097,6 @@ void listZoneInfo( int nid, int zid )
                             if ( msg->u.reply.u.zone_info.node[i].nid != -1 )
                             {
                                 // Display zone node info
-                                last_nid = msg->u.reply.u.zone_info.node[i].nid;
                                 //      "[%s] ZID PNID State    Name\n", MyName);
                                 //      "[%s] --- ---- -------- --------\n", MyName);
                                 printf ("[%s] %3.3d  %3.3d %-8s %s\n",
@@ -5333,7 +5331,7 @@ int start_process (int *nid, PROCESSTYPE type, char *name, bool debug, int prior
     count = 0;
     while (*cmd_tail && count < MAX_ARGS)
     {
-        cmd_tail = get_token (cmd_tail, token, &delimiter, MAX_TOKEN,
+        cmd_tail = get_token (cmd_tail, token, &delimiter, (MAX_ARG_SIZE - 1),
                               false /* equal is not a delim */);
         strncpy (msg->u.request.u.new_process.argv[count], token,
                  MAX_ARG_SIZE - 1);
@@ -7309,6 +7307,9 @@ void node_cmd (char *cmd_tail)
                     sprintf( msgString, "[%s] Node delete is not available with Virtual Nodes!",MyName);
                     write_startup_log( msgString );
                     printf ("%s\n", msgString);
+                }
+                else
+                {
                     if (ElasticityEnabled)
                     {
                         // <nid> | <node-name>
@@ -8152,7 +8153,6 @@ void persist_exec_cmd( char *cmd )
     const char method_name[] = "persist_exec_cmd";
     char *cmd_tail = cmd;
     char delimiter;
-    char *ptr;
     char token[MAX_TOKEN];
     CPersistConfig *persistConfig;
 
@@ -8181,7 +8181,7 @@ void persist_exec_cmd( char *cmd )
     if (ClusterConfig.IsConfigReady())
     {
         // Parse cmd to get persist-process-prefix
-        ptr = get_token (cmd_tail, token, &delimiter);
+        get_token (cmd_tail, token, &delimiter);
         if (*token != '\0')
         {
             // Get persist process configuration
@@ -8266,7 +8266,6 @@ void persist_kill_cmd( char *cmd )
     const char method_name[] = "persist_kill_cmd";
     char *cmd_tail = cmd;
     char delimiter;
-    char *ptr;
     char token[MAX_TOKEN];
     CPersistConfig *persistConfig;
 
@@ -8286,7 +8285,7 @@ void persist_kill_cmd( char *cmd )
     if (ClusterConfig.IsConfigReady())
     {
         // Parse cmd to get persist-process-prefix
-        ptr = get_token (cmd_tail, token, &delimiter);
+        get_token (cmd_tail, token, &delimiter);
         if (*token != '\0')
         {
             // Get persist process configuration

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/system.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/system.cxx b/core/sqf/monitor/linux/system.cxx
index ca4b968..49b9878 100644
--- a/core/sqf/monitor/linux/system.cxx
+++ b/core/sqf/monitor/linux/system.cxx
@@ -586,7 +586,7 @@ void CUtility::GetOutput( char *buf, int bufSize )
             bytes = (size <= (bufSize - count)) ? size : (bufSize - count);
             count =+ bytes;
             memcpy( ptr, str.data(), bytes );
-            ptr =+ (char *)bytes;
+            for (int i=0; i<bytes ;ptr++ );
         }
     }
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/tmsync.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/tmsync.cxx b/core/sqf/monitor/linux/tmsync.cxx
index b87f0f4..e6e3a76 100644
--- a/core/sqf/monitor/linux/tmsync.cxx
+++ b/core/sqf/monitor/linux/tmsync.cxx
@@ -42,7 +42,9 @@ using namespace std;
 #include "tmsync.h"
 #include "mlio.h"
 #include "reqqueue.h"
+#include "nameserver.h"
 
+extern bool NameServerEnabled;
 extern int trace_level;
 extern int MyPNID;
 extern sigset_t SigSet;
@@ -926,6 +928,16 @@ void CTmSync_Container::SendUnsolicitedMessages (void)
                 // Get the TM that initiated the sync request
                 tm = LNode[req->Nid]->GetProcessLByType( ProcessType_DTM );
             }
+            if (!tm && NameServerEnabled)
+            {
+                if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+                {
+                    trace_printf( "%s@%d - Getting process from Name Server, nid=%d, type=ProcessType_DTM\n"
+                                , method_name, __LINE__, req->Nid );
+                }
+            
+                tm = Nodes->GetProcessLByTypeNs( req->Nid, ProcessType_DTM );
+            }
             if ( tm )
             {
                 // send all TmSync requests data to the local TM processes

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/zclient.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/zclient.cxx b/core/sqf/monitor/linux/zclient.cxx
index 0ca03b1..d2cd0be 100644
--- a/core/sqf/monitor/linux/zclient.cxx
+++ b/core/sqf/monitor/linux/zclient.cxx
@@ -577,12 +577,19 @@ const char* CZClient::WaitForAndReturnMaster( bool doWait )
     {
         if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
         {
-            trace_printf( "%s@%d (MasterMonitor) Master Monitor found (%s)\n"
-                        , method_name, __LINE__, masterMonitor.c_str() );
+            trace_printf( "%s@%d (MasterMonitor) Master Monitor found (%s/%s)\n"
+                        , method_name, __LINE__, masterMonitor.c_str(), nodes.data[0] );
         }
         TRACE_EXIT;
         return nodes.data[0];
     }
+    else
+    {
+      if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+        {
+            trace_printf( "%s@%d (MasterMonitor) Master Monitor NOT found\n" , method_name, __LINE__);
+        }
+    }
 
     TRACE_EXIT;
     return NULL;
@@ -734,6 +741,59 @@ int CZClient::GetZNodeData( string &monZnode, string &nodeName, int &pnid )
     return( rc );
 }
 
+void CZClient::HandleMasterZNode ( void )
+{
+     const char method_name[] = "CZClient::HandleMasterZNode";
+    TRACE_ENTRY;
+
+    char  pathStr[MAX_PROCESSOR_NAME] = { 0 };
+    char  nodeName[MAX_PROCESSOR_NAME] = { 0 };
+    char *tkn = NULL;
+    char *tknStart = pathStr;
+    char *tknLast = NULL;
+    string monZnode;
+    
+    monZnode.assign( znodeQueue_.front() );
+
+    if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+    {
+        trace_printf("%s@%d" " - znodePath=%s, znodeQueue_.size=%ld\n"
+                        , method_name, __LINE__
+                        , monZnode.c_str(), znodeQueue_.size() );
+    }
+
+    znodeQueue_.pop_front();
+       
+    strcpy( pathStr, monZnode.c_str() );
+    tknStart++; // skip the first '/'
+    tkn = strtok( tknStart, "/" );
+    do
+    {
+        tknLast = tkn;
+        tkn = strtok( NULL, "/" );
+    }
+    while( tkn != NULL );
+    
+    strcpy( nodeName, tknLast );
+    if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+    {
+        trace_printf( "%s@%d nodeName=%s\n"
+                    , method_name, __LINE__
+                    , strlen(nodeName) ? nodeName : "" );
+    }
+       
+    string masterpath = zkRootNode_ + zkRootNodeInstance_ + ZCLIENT_MASTER_ZNODE;
+    std::size_t found = monZnode.find(masterpath);
+    // if it is the master node, then call HandleAssignMonitorLeader
+    if (found!=std::string::npos)
+    // zookeeper node, assume stale
+    {
+        HandleAssignMonitorLeader(nodeName);
+    }
+    
+    TRACE_EXIT; 
+}
+
 void CZClient::HandleExpiredZNode( void )
 {
     const char method_name[] = "CZClient::HandleExpiredZNode";
@@ -778,13 +838,23 @@ void CZClient::HandleExpiredZNode( void )
                         , strlen(nodeName) ? nodeName : "" );
         }
 
-        char buf[MON_STRING_BUF_SIZE];
-        snprintf( buf, sizeof(buf)
+        string masterpath = zkRootNode_ + zkRootNodeInstance_ + ZCLIENT_MASTER_ZNODE;
+        std::size_t found = monZnode.find(masterpath);
+        // if it is not the master node, then call HandleNodeExpiration
+        if (found==std::string::npos)
+        {    
+             char buf[MON_STRING_BUF_SIZE];
+             snprintf( buf, sizeof(buf)
                 , "[%s], %s was deleted, handling node (%s) as a down node!\n"
                 ,  method_name, monZnode.c_str(), nodeName );
-        mon_log_write(MON_ZCLIENT_CHECKZNODE_1, SQ_LOG_ERR, buf);
-
-        HandleNodeExpiration( nodeName );
+              mon_log_write(MON_ZCLIENT_CHECKZNODE_1, SQ_LOG_ERR, buf);
+         
+             HandleNodeExpiration( nodeName );
+        }
+        else // zookeeper node, assume stale
+        {
+             HandleAssignMonitorLeader(nodeName);
+        }
     }
     else
     {
@@ -1210,6 +1280,11 @@ void CZClient::MonitorZCluster()
                     HandleExpiredZNode();
                     SetState( ZC_MYZNODE );
                 }
+                // we still need to check if the master went down
+                else
+                {
+                    HandleMasterZNode(); 
+                }
                 break;
             case ZC_STOP:
                 StopClusterMonitoring();
@@ -1580,7 +1655,34 @@ void CZClient::TriggerCheck( int type, const char *znodePath )
                     , ZooConnectionTypeStr( type ) );
     }
 
-    if ( type == ZOO_CREATED_EVENT )
+    // Leader stuff only relevant in agenMode
+    string masterpath = zkRootNode_ + zkRootNodeInstance_ + ZCLIENT_MASTER_ZNODE;
+    std::string monZnode(znodePath);
+    std::size_t found = monZnode.find(masterpath);
+    // if it is not the master node, then call HandleNodeExpiration
+
+    if (found!=std::string::npos)
+    // zookeeper node, assume stale
+    {
+        char  nodeName[MAX_PROCESSOR_NAME] = { 0 };
+        char  tempName[MAX_PROCESSOR_NAME] = { 0 };
+        char *tkn = NULL;
+        const char *tknStart = znodePath;
+        char *tknLast = NULL;
+        tknStart++; // skip the first '/'
+        strcpy (tempName, tknStart);
+        tkn = strtok( tempName, "/" );
+        strcpy (tempName, tknStart);
+        do
+        {
+            tknLast = tkn;
+            tkn = strtok( NULL, "/" );
+        }
+        while( tkn != NULL );
+        strcpy( nodeName, tknLast );
+        HandleAssignMonitorLeader (nodeName);
+    }
+    else if ( type == ZOO_CREATED_EVENT )
     {
         SetState( ZC_ZNODE, znodePath );
     }
@@ -1778,7 +1880,7 @@ int CZClient::WatchNodeMasterDelete( const char *nodeName )
     newpath.str( "" );
     newpath << zkRootNode_.c_str() 
             << zkRootNodeInstance_.c_str() 
-            << ZCLIENT_MASTER_ZNODE
+            << ZCLIENT_MASTER_ZNODE <<"/"
             << nodeName;
            
     string monZnode = newpath.str( );

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/zclient.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/zclient.h b/core/sqf/monitor/linux/zclient.h
index 916ed11..22cf730 100644
--- a/core/sqf/monitor/linux/zclient.h
+++ b/core/sqf/monitor/linux/zclient.h
@@ -119,6 +119,7 @@ typedef list<string>    ZNodeList_t;
 //   the nodeName passed in expires.
 extern void HandleMyNodeExpiration( void );
 extern void HandleNodeExpiration( const char *nodeName );
+extern void HandleAssignMonitorLeader ( const char* failedMaster );
 
 class CZClient : public CLock
 {
@@ -168,6 +169,7 @@ private:
     int     GetZNodeData( string &monZnode, string &nodeName, int &pnid );
     ZClientState_t GetState( void ) { CAutoLock lock(getLocker()); return( state_ ); }
     void    HandleExpiredZNode( void );
+    void    HandleMasterZNode ( void );
     int     InitializeZClient( void );
     bool    IsEnabled( void ) { CAutoLock lock(getLocker()); return( enabled_ ); }
     bool    IsCheckCluster( void ) { CAutoLock lock(getLocker()); return( checkCluster_ ); }

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/linux/zootest.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/zootest.cxx b/core/sqf/monitor/linux/zootest.cxx
index 94d2605..4b7a11f 100644
--- a/core/sqf/monitor/linux/zootest.cxx
+++ b/core/sqf/monitor/linux/zootest.cxx
@@ -55,6 +55,14 @@ int MyPid = -1;
 CZClient    *ZClient = NULL;
 CMonLog     *MonLog =  NULL;
 
+void HandleAssignMonitorLeader ( const char* failedMaster )
+{
+    const char method_name[] = "HandleAssignMonitorLeader";
+    TRACE_ENTRY;
+    failedMaster = failedMaster;
+    TRACE_EXIT;
+}
+
 void HandleMyNodeExpiration( void )
 {
     const char method_name[] = "HandleMyNodeExpiration";

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/test/monitor.env
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/test/monitor.env b/core/sqf/monitor/test/monitor.env
index 52e2341..25029ce 100644
--- a/core/sqf/monitor/test/monitor.env
+++ b/core/sqf/monitor/test/monitor.env
@@ -19,47 +19,28 @@
 #
 # @@@ END COPYRIGHT @@@
 
-# Monitor process run mode:
-#
-#   AGENT - monitor process runs in agent mode versus MPI collective
-#
-# Uncomment the next three environment variables
-#export SQ_MON_RUN_MODE=AGENT
-MONITOR_COMM_PORT=23390
-MONITOR_SYNC_PORT=23380
-#
-#   NAME-SERVER - to disable process replication and enable name-server
-#
-# Uncomment the next six environment variables
-SQ_NAMESERVER_ENABLED=1
-NS_COMM_PORT=23370
-NS_SYNC_PORT=23360
-NS_M2N_COMM_PORT=23350
-MON2MON_COMM_PORT=23340
-MONITOR_COMM_PORT=23330
-
 # Uncomment MON_TRACE_ENABLE and specific tracing level to enable 
 # Trafodion monitor process tracing
-MON_TRACE_ENABLE=1
-MON_TRACE_EVLOG_MSG=1
-MON_TRACE_INIT=1
-MON_TRACE_RECOVERY=1
-MON_TRACE_REQUEST=1
-MON_TRACE_PROCESS=1
-MON_TRACE_NOTICE=1
-MON_TRACE_NS=1
+#MON_TRACE_ENABLE=1
+#MON_TRACE_EVLOG_MSG=1
+#MON_TRACE_INIT=1
+#MON_TRACE_RECOVERY=1
+#MON_TRACE_REQUEST=1
+#MON_TRACE_PROCESS=1
+#MON_TRACE_NOTICE=1
+#MON_TRACE_NS=1
 #MON_TRACE_SYNC=1
 # Enable TC_TRACE_* along with MON_TRACE_TRAFCONFIG for more detail
 #MON_TRACE_TRAFCONFIG=1
 #MON_TRACE_MLIO=1
 
 #MON_TRACE_REQUEST_DETAIL=1
-MON_TRACE_PROCESS_DETAIL=1
+#MON_TRACE_PROCESS_DETAIL=1
 #MON_TRACE_NOTICE_DETAIL=1
 #MON_TRACE_SYNC_DETAIL=1
 #MON_TRACE_MLIO_DETAIL=1
 
-MON_TRACE_MEAS
+#MON_TRACE_MEAS=1
 #MON_TRACE_TMSYNC=1
 #MON_TRACE_STATS=1
 #MON_TRACE_ENTRY_EXIT=1
@@ -78,4 +59,3 @@ MON_TRACE_MEAS
 #TC_TRACE_INIT=1
 #TC_TRACE_LOG_MSG=1
 #TC_TRACE_ENTRY_EXIT=1
-

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/monitor/test/sqconfig.monitor.virtual
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/test/sqconfig.monitor.virtual b/core/sqf/monitor/test/sqconfig.monitor.virtual
index 9ab56e8..ad23ec2 100644
--- a/core/sqf/monitor/test/sqconfig.monitor.virtual
+++ b/core/sqf/monitor/test/sqconfig.monitor.virtual
@@ -24,9 +24,5 @@ _virtualnodes 6
 end node
 
 begin name-server
-#nodes=0
-nodes=0,1
-#nodes=0,1,2
-#nodes=0,1,2,3
-#nodes=0,1,2,3,4,5
+nodes=0,1,2,3,4,5
 end name-server

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/sqenvcom.sh
----------------------------------------------------------------------
diff --git a/core/sqf/sqenvcom.sh b/core/sqf/sqenvcom.sh
index 59d30cd..84b2e1f 100644
--- a/core/sqf/sqenvcom.sh
+++ b/core/sqf/sqenvcom.sh
@@ -673,31 +673,31 @@ export SQ_LUNMGR_VERBOSITY=1
 # Control SQ default startup behavior (c=cold, w=warm, if removed sqstart will autocheck)
 export SQ_STARTUP=r
 
-# Monitor process creator:
+#
+# NOTE: in a Python installation when SQ_MON_RUN_MODE below
+#       is AGENT the SQ_MON_CREATOR must be MPIRUN
 #
 #   MPIRUN - monitor process is created by mpirun
+#            (meaning that mpirun is the parent process of the monitor process)
+#   AGENT  - monitor process runs in agent mode versus MPI collective
 #
-# Uncomment SQ_MON_CREATOR when running monitor in AGENT mode
+# Uncomment the next four environment variables
 #export SQ_MON_CREATOR=MPIRUN
-
-# Monitor process run mode:
-#
-#   AGENT - monitor process runs in agent mode versus MPI collective
-#
-# Uncomment the next three environment variables
 #export SQ_MON_RUN_MODE=AGENT
 #export MONITOR_COMM_PORT=23390
 #export MONITOR_SYNC_PORT=23380
+
 #
-#   NAME-SERVER - to disable process replication and enable name-server
+#   NAME-SERVER - to disable process replication and enable the name-server
 #
-# Uncomment the next six environment variables
+# Uncomment the next environment variable
 #export SQ_NAMESERVER_ENABLED=1
-#export NS_COMM_PORT=23370
-#export NS_SYNC_PORT=23360
-#export NS_M2N_COMM_PORT=23350
-#export MON2MON_COMM_PORT=23340
-#export MONITOR_COMM_PORT=23330
+if [[ "$SQ_NAMESERVER_ENABLED" == "1" ]]; then
+  export NS_COMM_PORT=23370
+  export NS_SYNC_PORT=23360
+  export NS_M2N_COMM_PORT=23350
+  export MON2MON_COMM_PORT=23340
+fi
 
 # Alternative logging capability in monitor
 export SQ_MON_ALTLOG=0

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/sql/scripts/monitor.env
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/monitor.env b/core/sqf/sql/scripts/monitor.env
index 2bfa4a7..25029ce 100644
--- a/core/sqf/sql/scripts/monitor.env
+++ b/core/sqf/sql/scripts/monitor.env
@@ -40,7 +40,7 @@
 #MON_TRACE_SYNC_DETAIL=1
 #MON_TRACE_MLIO_DETAIL=1
 
-#MON_TRACE_MEAS
+#MON_TRACE_MEAS=1
 #MON_TRACE_TMSYNC=1
 #MON_TRACE_STATS=1
 #MON_TRACE_ENTRY_EXIT=1

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/sql/scripts/sqconfig
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqconfig b/core/sqf/sql/scripts/sqconfig
index a753549..c45896f 100644
--- a/core/sqf/sql/scripts/sqconfig
+++ b/core/sqf/sql/scripts/sqconfig
@@ -23,9 +23,9 @@ begin node
 _virtualnodes 2
 end node
 
-#begin name-server
-#nodes=0,1
-#end name-server
+begin name-server
+nodes=0,1
+end name-server
 
 ###############################################################################
 #

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/sql/scripts/sqnameserver.pm
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqnameserver.pm b/core/sqf/sql/scripts/sqnameserver.pm
index 96572bd..87a576c 100644
--- a/core/sqf/sql/scripts/sqnameserver.pm
+++ b/core/sqf/sql/scripts/sqnameserver.pm
@@ -97,12 +97,12 @@ sub parseStatement {
         my $eq;
         ($eq, $s) = parseEq($s);
         if ($eq) {
-            while ($s =~ /([A-Za-z0-9-]+)(\s*,\s*)/) {
+            while ($s =~ /([A-Za-z0-9.\-]+)(\s*,\s*)/) {
                 my $nodeName = $1;
                 $s =~ s:$nodeName$2::;
                 push(@g_nodeNames, $nodeName);
             }
-            if ($s =~ /([A-Za-z0-9-]+)/) {
+            if ($s =~ /([A-Za-z0-9.\-]+)/) {
                 my $nodeName = $1;
                 $s =~ s:$nodeName::;
                 push(@g_nodeNames, $nodeName);

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3931a75f/core/sqf/sql/scripts/sqnodes.pm
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqnodes.pm b/core/sqf/sql/scripts/sqnodes.pm
index 36d8f0c..0d09565 100644
--- a/core/sqf/sql/scripts/sqnodes.pm
+++ b/core/sqf/sql/scripts/sqnodes.pm
@@ -279,10 +279,10 @@ sub verifyParse
             displayStmt($stmtOk);
             print "   Error: node-id not specified\n";
         }
-        elsif ($nodeId > 255)
+        elsif ($nodeId > 1023)
         {
             displayStmt($stmtOk);
-            print "   Error: node-id must be in the range 0..255.\n";
+            print "   Error: node-id must be in the range 0..1023.\n";
         }
         if (@cores == 0)
         {


[22/50] [abbrv] trafodion git commit: More p2p fixes.

Posted by su...@apache.org.
More p2p fixes.


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

Branch: refs/heads/master
Commit: 297681c6e8b29cbee3e8a5ad9fd72ce39eb29e86
Parents: 1584dc4
Author: Zalo Correa <za...@esgyn.com>
Authored: Fri Apr 6 14:17:47 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Fri Apr 6 14:17:47 2018 -0700

----------------------------------------------------------------------
 core/sqf/monitor/linux/process.cxx   |   8 +--
 core/sqf/monitor/linux/ptpclient.cxx |   4 +-
 core/sqf/monitor/linux/reqopen.cxx   | 100 +++++++++++++-----------------
 core/sqf/monitor/linux/reqqueue.cxx  |  10 ++-
 4 files changed, 52 insertions(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/297681c6/core/sqf/monitor/linux/process.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/process.cxx b/core/sqf/monitor/linux/process.cxx
index b599840..7cce388 100644
--- a/core/sqf/monitor/linux/process.cxx
+++ b/core/sqf/monitor/linux/process.cxx
@@ -5290,6 +5290,7 @@ void CProcessContainer::Exit_Process (CProcess *process, bool abend, int downNod
                 if (!process->IsClone() && !MyNode->isInQuiesceState())
                 {
                     // Replicate the exit to other nodes
+                    if (!NameServerEnabled)
                     {
                         // Replicate the exit to other nodes
                         CReplExit *repl = new CReplExit(process->GetNid(),
@@ -5325,12 +5326,7 @@ void CProcessContainer::Exit_Process (CProcess *process, bool abend, int downNod
                    process->IsAbended() &&
                    MyNode->GetShutdownLevel() == ShutdownLevel_Undefined) )
             {
-//TRK-TODO
-      //        if (NameServerEnabled)
-                {
-                    //message to monitor
-                }
-        //        else
+                if (!NameServerEnabled)
                 {
                     // Replicate the exit to other nodes
                     CReplExit *repl = new CReplExit(process->GetNid(),

http://git-wip-us.apache.org/repos/asf/trafodion/blob/297681c6/core/sqf/monitor/linux/ptpclient.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/ptpclient.cxx b/core/sqf/monitor/linux/ptpclient.cxx
index 0593498..03ca514 100644
--- a/core/sqf/monitor/linux/ptpclient.cxx
+++ b/core/sqf/monitor/linux/ptpclient.cxx
@@ -397,7 +397,7 @@ int CPtpClient::ProcessInit( CProcess *process
     {
         if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
         {
-            trace_printf( "%s@%d - Not Sending InternalType_Clone request to parentNid=%d\n"
+            trace_printf( "%s@%d - Not Sending InternalType_Clone request to parentNid=%d"
                           ", process=%s (%d,%d:%d)\n"
                         , method_name, __LINE__
                         , process->GetParentNid()
@@ -411,7 +411,7 @@ int CPtpClient::ProcessInit( CProcess *process
 
     if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
     {
-        trace_printf( "%s@%d" " - Sending InternalType_ProcessInit to parent node %s, parentNid=%d\n"
+        trace_printf( "%s@%d" " - Sending InternalType_ProcessInit to parent node %s, parentNid=%d"
                     ", for process %s (%d,%d:%d)\n"
                     , method_name, __LINE__
                     , parentLNode->GetNode()->GetName()

http://git-wip-us.apache.org/repos/asf/trafodion/blob/297681c6/core/sqf/monitor/linux/reqopen.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqopen.cxx b/core/sqf/monitor/linux/reqopen.cxx
index a84e55f..379049f 100644
--- a/core/sqf/monitor/linux/reqopen.cxx
+++ b/core/sqf/monitor/linux/reqopen.cxx
@@ -78,11 +78,6 @@ void CExtOpenReq::performRequest()
     const char method_name[] = "CExtOpenReq::performRequest";
     TRACE_ENTRY;
 
-    int target_nid = -1;
-    int target_pid = -1;
-    Verifier_t target_verifier = -1;
-    string target_process_name;
-
     // Record statistics (sonar counters)
     if (sonar_verify_state(SONAR_ENABLED | SONAR_MONITOR_ENABLED))
        MonStats->req_type_open_Incr();
@@ -108,62 +103,17 @@ void CExtOpenReq::performRequest()
     CProcess *opener = ((CReqResourceProc *) resources_[0])->getProcess();
     CProcess *opened = ((CReqResourceProc *) resources_[1])->getProcess();
 
-    
     // check for the process object as it could have been deleted by the time this request gets to perform.
     if (opened == NULL) 
     {
-        if (!NameServerEnabled)
+        if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
         {
-            if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
-            {
-                  trace_printf("%s@%d request #%ld: Open process failed. Process already exited.",
-                           method_name, __LINE__, id_);
-            }
-            errorReply( MPI_ERR_NAME );
-            TRACE_EXIT;
-            return;
-        }
-        else
-        {
-            target_nid = msg_->u.request.u.open.target_nid;
-            target_pid = msg_->u.request.u.open.target_pid;
-            target_verifier  = msg_->u.request.u.open.target_verifier;
-            target_process_name = (const char *) msg_->u.request.u.open.target_process_name;
-
-            if ( target_process_name.size() )
-            { // Name Server find by name:verifier
-                if (trace_settings & TRACE_REQUEST)
-                    trace_printf( "%s@%d" " - Getting targetProcess from Name Server (%s:%d)" "\n"
-                                , method_name, __LINE__
-                                , target_process_name.c_str()
-                                , target_verifier );
-                opened = Nodes->GetProcessNs( target_process_name.c_str()
-                                            , target_verifier );
-            }     
-            else
-            { // Name Server find by nid,pid:verifier
-                if (trace_settings & TRACE_REQUEST)
-                    trace_printf( "%s@%d" " - Getting targetProcess from Name Server (%d,%d:%d)\n"
-                                , method_name, __LINE__
-                                , target_nid
-                                , target_pid
-                                , target_verifier );
-                opened = Nodes->GetProcessNs( target_nid
-                                            , target_pid
-                                            , target_verifier );
-            }
-            if (opened == NULL) 
-            {
-                if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
-                {
-                      trace_printf("%s@%d request #%ld: Open process failed. Process already exited.",
-                               method_name, __LINE__, id_);
-                }
-                errorReply( MPI_ERR_NAME );
-                TRACE_EXIT;
-                return;
-            }
+              trace_printf("%s@%d request #%ld: Open process failed. Process already exited.",
+                       method_name, __LINE__, id_);
         }
+        errorReply( MPI_ERR_NAME );
+        TRACE_EXIT;
+        return;
     }
 
     // check the verifier
@@ -254,6 +204,9 @@ bool CExtOpenReq::prepare()
     TRACE_ENTRY;
 
     int target_nid = -1;
+    int target_pid = -1;
+    Verifier_t target_verifier = -1;
+    string target_process_name;
     CLNode *target_lnode = NULL;
 
     if ( prepared_ == true )
@@ -322,6 +275,41 @@ bool CExtOpenReq::prepare()
                                          , true, false, true );
     }
 
+    if ( openedProcess == NULL )
+    {
+        if (NameServerEnabled)
+        {
+            target_nid = msg_->u.request.u.open.target_nid;
+            target_pid = msg_->u.request.u.open.target_pid;
+            target_verifier  = msg_->u.request.u.open.target_verifier;
+            target_process_name = (const char *) msg_->u.request.u.open.target_process_name;
+
+            if ( target_process_name.size() )
+            { // Name Server find by name:verifier
+                if (trace_settings & TRACE_REQUEST)
+                    trace_printf( "%s@%d" " - Getting targetProcess from Name Server (%s:%d)" "\n"
+                                , method_name, __LINE__
+                                , target_process_name.c_str()
+                                , target_verifier );
+                openedProcess = Nodes->GetProcessNs( target_process_name.c_str()
+                                                   , target_verifier );
+            }     
+            else
+            { // Name Server find by nid,pid:verifier
+                if (trace_settings & TRACE_REQUEST)
+                    trace_printf( "%s@%d" " - Getting targetProcess from Name Server (%d,%d:%d)\n"
+                                , method_name, __LINE__
+                                , target_nid
+                                , target_pid
+                                , target_verifier );
+                openedProcess = Nodes->GetProcessNs( target_nid
+                                                   , target_pid
+                                                   , target_verifier );
+            }
+        }
+        
+    }
+
     if ( openedProcess )
     {
         if ( openedProcess->IsBackup() )

http://git-wip-us.apache.org/repos/asf/trafodion/blob/297681c6/core/sqf/monitor/linux/reqqueue.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqqueue.cxx b/core/sqf/monitor/linux/reqqueue.cxx
index 184c694..530b096 100644
--- a/core/sqf/monitor/linux/reqqueue.cxx
+++ b/core/sqf/monitor/linux/reqqueue.cxx
@@ -1408,11 +1408,7 @@ void CIntNewProcReq::performRequest()
                     MyNode->AddToNameMap( newProcess );
                     MyNode->AddToPidMap( newProcess->GetPid(),  newProcess );
 
-                    // Successfully forked process.  Replicate actual process
-                    // id and process name.
-
-//TRK-TODO
-              /*      if (NameServerEnabled)
+                    if (NameServerEnabled)
                     {
                         // Send actual pid and process name back to parent
                         PtpClient->ProcessInit( newProcess
@@ -1421,7 +1417,9 @@ void CIntNewProcReq::performRequest()
                                               , parentNid_ );
                     }
                     else
-             */       {
+                    {
+                        // Successfully forked process.  Replicate actual process
+                        // id and process name.
                         CReplProcInit *repl
                             = new CReplProcInit(newProcess, reqTag_, 0, parentNid_);
                         Replicator.addItem(repl);


[40/50] [abbrv] trafodion git commit: Added name server configured check to sqstart script when SQ_NAMESERVER_ENABLED is enabled.

Posted by su...@apache.org.
Added name server configured check to sqstart script when SQ_NAMESERVER_ENABLED is enabled.


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

Branch: refs/heads/master
Commit: 8e4f2c79758192dc840b67bb002752e6bae0ef2c
Parents: 019cd5a
Author: Zalo Correa <za...@esgyn.com>
Authored: Fri May 18 16:09:00 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Fri May 18 16:09:00 2018 -0700

----------------------------------------------------------------------
 core/sqf/sql/scripts/sqstart | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/8e4f2c79/core/sqf/sql/scripts/sqstart
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqstart b/core/sqf/sql/scripts/sqstart
index cd55a49..8e41afc 100755
--- a/core/sqf/sql/scripts/sqstart
+++ b/core/sqf/sql/scripts/sqstart
@@ -294,6 +294,18 @@ fi
 
 checkUlimit
 
+let nameserver_configured=`trafconf -ns | grep nodes | wc -l`
+
+if [[ "$SQ_NAMESERVER_ENABLED" == "1" ]]; then
+   if [ $nameserver_configured '<' 1 ]; then
+     echoLog
+     echoLog "SQ_NAMESERVER_ENABLED is enabled and the Name Server is not configured."
+     echoLog "Please ensure the name-server section is in the 'sqconfig' file, and re-run 'sqgen'."
+     echoLog
+     exit 1;
+   fi
+fi
+
 # Check SeaMonster kernel module if SeaMonster is enabled
 if [[ $SQ_SEAMONSTER == "1" ]]; then
     echoLog


[04/50] [abbrv] trafodion git commit: Preliminary monitor p-2-p communication changes.

Posted by su...@apache.org.
http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/reqnotify.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqnotify.cxx b/core/sqf/monitor/linux/reqnotify.cxx
index f5f7579..6dc43fc 100644
--- a/core/sqf/monitor/linux/reqnotify.cxx
+++ b/core/sqf/monitor/linux/reqnotify.cxx
@@ -28,10 +28,15 @@
 #include "montrace.h"
 #include "monsonar.h"
 #include "monlogging.h"
+#include "ptpclient.h"
 
 extern CMonStats *MonStats;
 extern CNode *MyNode;
 extern CNodeContainer *Nodes;
+extern bool NameServerEnabled;
+extern CPtpClient *PtpClient;
+
+extern _TM_Txid_External invalid_trans( void );
 
 CExtNotifyReq::CExtNotifyReq (reqQueueMsg_t msgType, int pid,
                               struct message_def *msg )
@@ -125,35 +130,31 @@ void CExtNotifyReq::performRequest()
 
     if ( requester )
     {
-        CProcess *sourceProcess = NULL;
-
-        if ( processName_.size() )
-        { // find by name (check node state, don't check process state, not backup)
-            if (trace_settings & TRACE_REQUEST)
-                trace_printf("%s@%d" " - Finding sourceProcess (name,verifier)" "\n", method_name, __LINE__);
-            sourceProcess = Nodes->GetProcess( processName_.c_str()
-                                             , verifier_
-                                             , true, false, false );
-        }     
-        else
-        { // find by nid (check node state, don't check process state, backup is Ok)
-            if (trace_settings & TRACE_REQUEST)
-                trace_printf("%s@%d" " - Finding sourceProcess (nid,pid,verifier)" "\n", method_name, __LINE__);
-            sourceProcess = Nodes->GetProcess( nid_
-                                             , pid
-                                             , verifier_
-                                             , true, false, true );
-        }
-        
+        CProcess *sourceProcess = requester;
         if ( sourceProcess )
         {
             if (trace_settings & TRACE_REQUEST)
-                trace_printf("%s@%d - Found sourceProcess" "\n", method_name, __LINE__);
+            {
+                trace_printf( "%s@%d - Found sourceProcess %s (%d,%d:%d), clone=%d\n"
+                            , method_name, __LINE__
+                            , sourceProcess->GetName()
+                            , sourceProcess->GetNid()
+                            , sourceProcess->GetPid()
+                            , sourceProcess->GetVerifier()
+                            , sourceProcess->IsClone() );
+            }
         }
         else
         {
             if (trace_settings & TRACE_REQUEST)
-                trace_printf("%s@%d - Can't find sourceProcess\n", method_name, __LINE__);
+            {
+                trace_printf( "%s@%d - Can't find sourceProcess %s (%d,%d:%d)\n"
+                            , method_name, __LINE__
+                            , processName_.c_str()
+                            , nid_
+                            , pid
+                            , verifier_ );
+            }
         }
 
         if ( msg_->u.request.u.notify.cancel )
@@ -170,14 +171,15 @@ void CExtNotifyReq::performRequest()
         {
             CProcess *targetProcess = NULL;
 
-
             if ( target_process_name.size() )
             { // find by name (check node state, don't check process state, not backup)
                 if (trace_settings & TRACE_REQUEST)
+                {
                     trace_printf( "%s@%d" " - Finding targetProcess (%s:%d)" "\n"
                                 , method_name, __LINE__
                                 , target_process_name.c_str()
                                 , target_verifier );
+                }
                 targetProcess = Nodes->GetProcess( target_process_name.c_str()
                                                  , target_verifier
                                                  , true, false, false );
@@ -185,11 +187,13 @@ void CExtNotifyReq::performRequest()
             else
             { // find by nid (check node state, don't check process state, backup is Ok)
                 if (trace_settings & TRACE_REQUEST)
+                {
                     trace_printf( "%s@%d" " - Finding targetProcess (%d,%d:%d)\n"
                                 , method_name, __LINE__
                                 , target_nid
                                 , target_pid
                                 , target_verifier );
+                }
                 targetProcess = Nodes->GetProcess( target_nid
                                                  , target_pid
                                                  , target_verifier
@@ -199,12 +203,73 @@ void CExtNotifyReq::performRequest()
             if ( targetProcess )
             {
                 if (trace_settings & TRACE_REQUEST)
-                    trace_printf("%s@%d" " - Found targetProcess" "\n", method_name, __LINE__);
+                {
+                    trace_printf( "%s@%d - Found targetProcess %s (%d,%d:%d), clone=%d\n"
+                                , method_name, __LINE__
+                                , targetProcess->GetName()
+                                , targetProcess->GetNid()
+                                , targetProcess->GetPid()
+                                , targetProcess->GetVerifier()
+                                , targetProcess->IsClone() );
+                }
             }
             else
             {
-                if (trace_settings & TRACE_REQUEST)
-                    trace_printf("%s@%d - Can't find targetProcess\n", method_name, __LINE__);
+                if (!NameServerEnabled)
+                {
+                    if (trace_settings & TRACE_REQUEST)
+                    {
+                        trace_printf("%s@%d - Can't find targetProcess\n", method_name, __LINE__);
+                    }
+                }
+                else
+                {
+                    if ( target_process_name.size() )
+                    { // Name Server find by name:verifier
+                        if (trace_settings & TRACE_REQUEST)
+                        {
+                            trace_printf( "%s@%d" " - Getting targetProcess from Name Server (%s:%d)" "\n"
+                                        , method_name, __LINE__
+                                        , target_process_name.c_str()
+                                        , target_verifier );
+                        }
+                        targetProcess = Nodes->GetProcessNs( target_process_name.c_str()
+                                                           , target_verifier );
+                    }     
+                    else
+                    { // Name Server find by nid,pid:verifier
+                        if (trace_settings & TRACE_REQUEST)
+                        {
+                            trace_printf( "%s@%d" " - Getting targetProcess from Name Server (%d,%d:%d)\n"
+                                        , method_name, __LINE__
+                                        , target_nid
+                                        , target_pid
+                                        , target_verifier );
+                        }
+                        targetProcess = Nodes->GetProcessNs( target_nid
+                                                           , target_pid
+                                                           , target_verifier );
+                    }
+                    if (targetProcess)
+                    {
+                        if (trace_settings & TRACE_REQUEST)
+                            trace_printf( "%s@%d - Found targetProcess %s (%d,%d:%d), clone=%d\n"
+                                        , method_name, __LINE__
+                                        , targetProcess->GetName()
+                                        , targetProcess->GetNid()
+                                        , targetProcess->GetPid()
+                                        , targetProcess->GetVerifier()
+                                        , targetProcess->IsClone() );
+                    }
+                    else
+                    {
+                        trace_printf( "%s@%d" " - Can't find targetProcess (%d,%d:%d)\n"
+                                    , method_name, __LINE__
+                                    , target_nid
+                                    , target_pid
+                                    , target_verifier );
+                    }
+                }
             }
             
             if ( targetProcess )
@@ -221,8 +286,10 @@ void CExtNotifyReq::performRequest()
                                     target_verifier,
                                     targetProcess->GetVerifier());
                     }            
-                } else
+                } 
+                else
                 {
+#if 0
                     if ( msg_->u.request.u.notify.cancel )
                     {   // Unregister interest in death of target process 
                         status = targetProcess->CancelDeathNotification( nid_
@@ -230,8 +297,32 @@ void CExtNotifyReq::performRequest()
                                                                        , verifier_
                                                                        , msg_->u.request.u.notify.trans_id);
                     }
-                    else if ( sourceProcess)
+                    else if (sourceProcess)
+#endif
+                    if (sourceProcess)
                     {   // Register interest in death of target process 
+                        if (NameServerEnabled && targetProcess->IsClone())
+                        {
+                            CLNode *targetLNode = Nodes->GetLNode( targetProcess->GetNid() );
+                        
+                            _TM_Txid_External transId = msg_->u.request.u.notify.trans_id;
+                            int rc = -1;
+
+                            // Forward the process cancel death notification to the target node
+                            rc = PtpClient->ProcessNotify( sourceProcess->GetNid()
+                                                         , sourceProcess->GetPid()
+                                                         , sourceProcess->GetVerifier()
+                                                         , transId
+                                                         , false
+                                                         , targetProcess
+                                                         , targetLNode->GetNid()
+                                                         , targetLNode->GetNode()->GetName() );
+                            if (rc)
+                            {
+                                // TODO: Error handling
+                            }
+                        }
+                        
                         sourceProcess->procExitReg( targetProcess,
                                                     msg_->u.request.u.notify.trans_id);
                         status = SUCCESS;
@@ -241,7 +332,9 @@ void CExtNotifyReq::performRequest()
             else
             {
                 if (trace_settings & TRACE_REQUEST)
+                {
                     trace_printf("%s@%d" " - Can't find targerProcess" "\n", method_name, __LINE__);
+                }
             }
         }
 
@@ -254,13 +347,17 @@ void CExtNotifyReq::performRequest()
         {
             msg_->u.reply.u.generic.return_code = MPI_SUCCESS;
             if (trace_settings & TRACE_REQUEST)
+            {
                 trace_printf("%s@%d" " - Successful" "\n", method_name, __LINE__);
+            }
         }
         else
         {
             msg_->u.reply.u.generic.return_code = MPI_ERR_NAME;
             if (trace_settings & TRACE_REQUEST)
+            {
                 trace_printf("%s@%d" " - Unsuccessful" "\n", method_name, __LINE__);
+            }
         }
 
         // Send reply to requester
@@ -270,7 +367,9 @@ void CExtNotifyReq::performRequest()
     {   // Reply to requester so it can release the buffer.  
         // We don't know about this process.
         if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+        {
             trace_printf("%s@%d - Can't find requester, rc=%d\n", method_name, __LINE__, MPI_ERR_NAME);
+        }
         errorReply( MPI_ERR_EXITED );
     }
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/reqopen.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqopen.cxx b/core/sqf/monitor/linux/reqopen.cxx
index 7a0ac04..88022b9 100644
--- a/core/sqf/monitor/linux/reqopen.cxx
+++ b/core/sqf/monitor/linux/reqopen.cxx
@@ -78,6 +78,10 @@ void CExtOpenReq::performRequest()
     const char method_name[] = "CExtOpenReq::performRequest";
     TRACE_ENTRY;
 
+    int target_nid = -1;
+    int target_pid = -1;
+    Verifier_t target_verifier = -1;
+    string target_process_name;
 
     // Record statistics (sonar counters)
     if (sonar_verify_state(SONAR_ENABLED | SONAR_MONITOR_ENABLED))
@@ -103,20 +107,63 @@ void CExtOpenReq::performRequest()
     bool status;
     CProcess *opener = ((CReqResourceProc *) resources_[0])->getProcess();
     CProcess *opened = ((CReqResourceProc *) resources_[1])->getProcess();
-    
-//TRK-TODO 
 
+    
     // check for the process object as it could have been deleted by the time this request gets to perform.
     if (opened == NULL) 
     {
-        if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+        if (!NameServerEnabled)
         {
-              trace_printf("%s@%d request #%ld: Open process failed. Process already exited.",
-                       method_name, __LINE__, id_);
+            if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+            {
+                  trace_printf("%s@%d request #%ld: Open process failed. Process already exited.",
+                           method_name, __LINE__, id_);
+            }
+            errorReply( MPI_ERR_NAME );
+            TRACE_EXIT;
+            return;
+        }
+        else
+        {
+            target_nid = msg_->u.request.u.open.target_nid;
+            target_pid = msg_->u.request.u.open.target_pid;
+            target_verifier  = msg_->u.request.u.open.target_verifier;
+            target_process_name = (const char *) msg_->u.request.u.open.target_process_name;
+
+            if ( target_process_name.size() )
+            { // Name Server find by name:verifier
+                if (trace_settings & TRACE_REQUEST)
+                    trace_printf( "%s@%d" " - Getting targetProcess from Name Server (%s:%d)" "\n"
+                                , method_name, __LINE__
+                                , target_process_name.c_str()
+                                , target_verifier );
+                opened = Nodes->GetProcessNs( target_process_name.c_str()
+                                            , target_verifier );
+            }     
+            else
+            { // Name Server find by nid,pid:verifier
+                if (trace_settings & TRACE_REQUEST)
+                    trace_printf( "%s@%d" " - Getting targetProcess from Name Server (%d,%d:%d)\n"
+                                , method_name, __LINE__
+                                , target_nid
+                                , target_pid
+                                , target_verifier );
+                opened = Nodes->GetProcessNs( target_nid
+                                            , target_pid
+                                            , target_verifier );
+            }
+            if (opened == NULL) 
+            {
+                if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+                {
+                      trace_printf("%s@%d request #%ld: Open process failed. Process already exited.",
+                               method_name, __LINE__, id_);
+                }
+                errorReply( MPI_ERR_NAME );
+                TRACE_EXIT;
+                return;
+            }
         }
-        errorReply( MPI_ERR_NAME );
-        TRACE_EXIT;
-        return;
     }
 
     // check the verifier
@@ -155,7 +202,16 @@ void CExtOpenReq::performRequest()
         msg_->u.reply.u.open.type = opened->GetType();
         msg_->u.reply.u.open.return_code = MPI_SUCCESS;
         if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
-            trace_printf("%s@%d - Successful\n", method_name, __LINE__);
+        {
+            trace_printf( "%s@%d - Open successful, opened %s (%d, %d:%d), "
+                          "port=%s\n"
+                        , method_name, __LINE__
+                        , opened->GetName()
+                        , msg_->u.reply.u.open.nid
+                        , msg_->u.reply.u.open.pid
+                        , msg_->u.reply.u.open.verifier
+                        , msg_->u.reply.u.open.port );
+        }
 
         // Send reply to requester
         lioreply(msg_, pid_);

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/reqprocinfo.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqprocinfo.cxx b/core/sqf/monitor/linux/reqprocinfo.cxx
index 8ff457c..22392bf 100644
--- a/core/sqf/monitor/linux/reqprocinfo.cxx
+++ b/core/sqf/monitor/linux/reqprocinfo.cxx
@@ -293,12 +293,19 @@ void CExtProcInfoReq::performRequest()
     TRACE_ENTRY;
 
 #ifndef NAMESERVER_PROCESS
-    if ( NameServerEnabled )
+    bool    getMonitorInfo = false;
+    if (strcasecmp(msg_->u.request.u.process_info.target_process_name, "MONITOR") == 0)
+    {
+        getMonitorInfo = true;
+        msg_->u.request.u.process_info.target_process_name[0] = 0;
+    }
+
+    if ( NameServerEnabled && !getMonitorInfo )
         NameServer->ProcessInfo(msg_); // in reqQueue thread (CExternalReq)
 #endif
 
 #ifndef NAMESERVER_PROCESS
-    if ( NameServerEnabled )
+    if ( NameServerEnabled && !getMonitorInfo )
     {
         // Send reply to requester
         lioreply(msg_, pid_);
@@ -359,7 +366,11 @@ void CExtProcInfoReq::performRequest()
         }
 #endif
 
+#ifdef NAMESERVER_PROCESS
+        if ( requester || ( nid_ == -1 && pid_ == -1 && verifier_ == -1 ) )
+#else
         if ( requester )
+#endif
         {
             msg_->u.reply.u.process_info.more_data = false;
 
@@ -371,16 +382,16 @@ void CExtProcInfoReq::performRequest()
                     trace_printf( "%s@%d request #%ld: ProcessInfo from %s (%d, %d:%d) "
                                   "by name for %s:%d, process type=%d\n"
                                 , method_name, __LINE__, id_
-                                , requester->GetName()
-                                , requester->GetNid()
-                                , requester->GetPid()
-                                , requester->GetVerifier()
+                                , requester?requester->GetName():""
+                                , requester?requester->GetNid():-1
+                                , requester?requester->GetPid():-1
+                                , requester?requester->GetVerifier():-1
                                 , target_process_name.c_str(), target_verifier
                                 , msg_->u.request.u.process_info.type);
                 }
 
                 //if requester is requesting info for itself, return local process info
-                if ( strcmp( requester->GetName()
+                if ( requester && strcmp( requester->GetName()
                            , msg_->u.request.u.process_info.target_process_name) == 0 )
                 {
                     ProcessInfo_CopyData(requester,
@@ -464,7 +475,8 @@ void CExtProcInfoReq::performRequest()
                 else
                 {
                     // get info for single process in node
-                    if ((requester->GetType() == ProcessType_TSE ||
+                    if (requester &&
+                        (requester->GetType() == ProcessType_TSE ||
                          requester->GetType() == ProcessType_ASE ||
                          requester->GetType() == ProcessType_AMP)  &&
                         (requester->GetNid() == target_nid &&

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/reqqueue.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqqueue.cxx b/core/sqf/monitor/linux/reqqueue.cxx
index 12e1f8e..5c0c77f 100644
--- a/core/sqf/monitor/linux/reqqueue.cxx
+++ b/core/sqf/monitor/linux/reqqueue.cxx
@@ -42,7 +42,6 @@
 #ifndef NAMESERVER_PROCESS
 #include "nameserver.h"
 #include "ptpclient.h"
-extern CPtpClient *PtpClient;
 #endif
 
 extern int MyPNID;
@@ -61,6 +60,7 @@ extern CHealthCheck HealthCheck;
 extern char *ErrorMsg (int error_code);
 #else
 extern bool NameServerEnabled;
+extern CPtpClient *PtpClient;
 extern CNameServer *NameServer;
 extern CNameServerConfigContainer *NameServerConfig;
 #endif
@@ -369,7 +369,7 @@ void CRequest::evalReqPerformance( void )
                 "time=%ld.%06ld, total time=%ld.%06ld {%s}\n", method_name,
                 performTime.tv_sec, performTime.tv_nsec,
                 totalTime.tv_sec, totalTime.tv_nsec, requestString());
-        mon_log_write(MON_REQQUEUE_PREP_EXT_REQ_1, SQ_LOG_ERR, buf);
+        mon_log_write(MON_REQ_EVALREQ_PERFORMANCE_1, SQ_LOG_ERR, buf);
     }
 }
 
@@ -580,6 +580,7 @@ void CInternalReq::errorReply( int  )
 {
 }
 
+#ifndef NAMESERVER_PROCESS
 CIntCloneProcReq::CIntCloneProcReq( bool backup, bool unhooked, bool eventMessages, bool systemMessages, int nid, PROCESSTYPE type, int priority, int parentNid, int parentPid, int parentVerifier, int osPid, int verifier, pid_t priorPid, int persistentRetries, int  argc, struct timespec creationTime, strId_t pathStrId, strId_t ldpathStrId, strId_t programStrId, int nameLen, int portLen, int infileLen, int outfileLen, int argvLen, const char * stringData, int origPNidNs)
     : CInternalReq(),
       backup_( backup ),
@@ -733,7 +734,7 @@ void CIntCloneProcReq::performRequest()
                          "startup successfully.\n",
                          method_name, process->GetName(), process->GetNid(),
                          process->GetPid());
-                mon_log_write(MON_PROCESSCONT_EXITPROCESS_2, SQ_LOG_ERR, buf);
+                mon_log_write(MON_INTREQ_CLONEPROC_1, SQ_LOG_ERR, buf);
             }
 
             if (parent && process->IsBackup())
@@ -793,7 +794,187 @@ void CIntCloneProcReq::performRequest()
 
     TRACE_EXIT;
 }
+#endif
+
+
+#ifdef NAMESERVER_PROCESS
+CIntCloneProcNsReq::CIntCloneProcNsReq( bool backup
+                                      , bool unhooked
+                                      , bool eventMessages
+                                      , bool systemMessages
+                                      , int nid
+                                      , PROCESSTYPE type
+                                      , int priority
+                                      , int parentNid
+                                      , int parentPid
+                                      , int parentVerifier
+                                      , int osPid
+                                      , int verifier
+                                      , pid_t priorPid
+                                      , int persistentRetries
+                                      , int  argc
+                                      , struct timespec creationTime
+                                      , strId_t pathStrId
+                                      , strId_t ldpathStrId
+                                      , strId_t programStrId
+                                      , int nameLen
+                                      , int portLen
+                                      , int infileLen
+                                      , int outfileLen
+                                      , int argvLen
+                                      , const char * stringData
+                                      , int origPNidNs)
+                   : CInternalReq()
+                   , backup_( backup )
+                   , unhooked_( unhooked )
+                   , eventMessages_( eventMessages )
+                   , systemMessages_( systemMessages )
+                   , nid_( nid )
+                   , type_( type )
+                   , priority_( priority )
+                   , parentNid_( parentNid )
+                   , parentPid_( parentPid )
+                   , parentVerifier_( parentVerifier )
+                   , osPid_( osPid )
+                   , verifier_( verifier )
+                   , priorPid_( priorPid )
+                   , persistentRetries_( persistentRetries )
+                   , argc_( argc )
+                   , pathStrId_( pathStrId )
+                   , ldpathStrId_( ldpathStrId )
+                   , programStrId_( programStrId )
+                   , nameLen_( nameLen )
+                   , portLen_( portLen )
+                   , infileLen_( infileLen )
+                   , outfileLen_( outfileLen )
+                   , argvLen_( argvLen )
+                   , origPNidNs_( origPNidNs )
+{
+    // Add eyecatcher sequence as a debugging aid
+    memcpy(&eyecatcher_, "RQIL", 4);
+
+    creationTime_.tv_sec = creationTime.tv_sec;
+    creationTime_.tv_nsec = creationTime.tv_nsec;
+
+    int stringDataLen = nameLen_ + portLen_+ infileLen_ + outfileLen_
+                      + argvLen_;
+    stringData_ = new char [stringDataLen];
+    memcpy ( stringData_, stringData, stringDataLen );
+}
+
+void CIntCloneProcNsReq::populateRequestString( void )
+{
+    char strBuf[MON_STRING_BUF_SIZE/2];
+    sprintf( strBuf, "IntReq(%s) req #=%ld (name=%s/nid=%d/pid=%d) parent(nid=%d/pid=%d)"
+                   , CReqQueue::intReqType[InternalType_Clone]
+                   , getId(),
+             &stringData_[0], // process name
+             nid_, osPid_, parentNid_, parentPid_ );
+    requestString_.assign( strBuf );
+}
 
+CIntCloneProcNsReq::~CIntCloneProcNsReq()
+{
+    // Alter eyecatcher sequence as a debugging aid to identify deleted object
+    memcpy(&eyecatcher_, "rqil", 4);
+
+    delete [] stringData_;
+}
+
+void CIntCloneProcNsReq::performRequest()
+{
+    const char method_name[] = "CIntCloneProcNsReq::performRequest";
+    TRACE_ENTRY;
+
+    CProcess *process;
+
+    // Trace info about request
+    if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+        trace_printf("%s@%d \n", method_name, __LINE__);
+
+    // check to see if we pre-cloned this process for startup in a remote node
+    process = Nodes->GetLNode (nid_)->
+        CompleteProcessStartup(&stringData_[0], // process name
+                               &stringData_[nameLen_],  // port,
+                               osPid_,
+                               eventMessages_,
+                               systemMessages_,
+                               &creationTime_,
+                               origPNidNs_);
+    if (process)
+    {
+        if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+        {
+            trace_printf("%s@%d - Registered process %s (%d, %d:%d), "
+                         "port=%s, origPNidNs=%d, MyPNID=%d\n", method_name, __LINE__,
+                         process->GetName(), process->GetNid(),
+                         process->GetPid(), process->GetVerifier(),
+                         process->GetPort(), process->GetOrigPNidNs(), MyPNID );
+        }
+
+        process->SetVerifier(verifier_);
+        process->SetParentVerifier(parentVerifier_);
+
+        // Send reply to originating monitor
+        if ( MyPNID == process->GetOrigPNidNs() )
+        {
+            struct message_def *msg = process->GetMonContext();
+            msg->u.reply.type = ReplyType_NewProcessNs;
+            msg->noreply = false;
+            msg->reply_tag = process->GetReplyTag();
+            msg->u.reply.u.new_process_ns.nid = process->GetNid();
+            msg->u.reply.u.new_process_ns.pid = process->GetPid();
+            msg->u.reply.u.new_process_ns.verifier = process->GetReplyTag();
+            strncpy(msg->u.reply.u.new_process_ns.process_name, process->GetName(), MAX_PROCESS_NAME);
+            msg->u.reply.u.new_process_ns.return_code = MPI_SUCCESS;
+
+            int sockFd = process->GetMonSockFd();
+            // Send reply to requester
+            monreply( msg, sockFd );
+        }
+        
+        // There might be a request waiting for the process creation to
+        // complete so have worker check pending request queue.
+        ReqQueue.nudgeWorker();
+    }
+    else
+    {
+        // This is a new clone process that needs to be created 
+        // mirroring another node
+        CNode * node = Nodes->GetLNode (nid_)->GetNode();
+        CProcess * process;
+        process = node->CloneProcess (nid_,
+                            type_,
+                            priority_,
+                            backup_,
+                            unhooked_,
+                            &stringData_[0], // process name
+                            &stringData_[nameLen_],  // port
+                            osPid_,
+                            verifier_,
+                            parentNid_,
+                            parentPid_,
+                            parentVerifier_,
+                            eventMessages_,
+                            systemMessages_,
+                            pathStrId_,
+                            ldpathStrId_,
+                            programStrId_,
+                            &stringData_[nameLen_ + portLen_],  // infile
+                            &stringData_[nameLen_ + portLen_ + infileLen_], // outfile
+                            &creationTime_,
+                            origPNidNs_);
+        if ( process )
+        {
+            process->userArgs ( argc_, argvLen_,
+                                &stringData_[nameLen_ + portLen_
+                                             +infileLen_ + outfileLen_] );
+        }
+    }
+
+    TRACE_EXIT;
+}
+#endif
 
 
 #ifndef NAMESERVER_PROCESS
@@ -921,7 +1102,9 @@ void CIntExitReq::performRequest()
             lnode->GetNode()->DelFromNameMap ( process );
             lnode->GetNode()->DelFromPidMap ( process );
 
-#ifndef NAMESERVER_PROCESS
+#ifdef NAMESERVER_PROCESS
+            lnode->GetNode()->DeleteFromList( process );
+#else
             lnode->GetNode()->Exit_Process (process, abended_, -1);
 #endif
         }
@@ -931,7 +1114,7 @@ void CIntExitReq::performRequest()
         char buf[MON_STRING_BUF_SIZE];
         sprintf(buf, "[%s], Can't find process %s (%d, %d) for processing "
                 "exit.\n", method_name, name_, nid_, pid_);
-        mon_log_write(MON_CLUSTER_HANDLEOTHERNODE_5, SQ_LOG_ERR, buf); 
+        mon_log_write(MON_INTREQ_EXIT_1, SQ_LOG_ERR, buf); 
     }
 
     TRACE_EXIT;
@@ -1162,6 +1345,23 @@ void CIntNewProcReq::performRequest()
                 }
             }
         }
+#ifndef NAMESERVER_PROCESS
+        else
+        {
+            if (NameServerEnabled)
+            { // Name Server find by nid,pid:verifier
+                if (trace_settings & TRACE_REQUEST)
+                    trace_printf( "%s@%d" " - Getting parent process from Name Server (%d,%d:%d)\n"
+                                , method_name, __LINE__
+                                , parentNid_
+                                , parentPid_
+                                , parentVerifier_ );
+                parentProcess = Nodes->GetProcessNs( parentNid_
+                                                   , parentPid_
+                                                   , parentVerifier_ );
+            }
+        }
+#endif
     }
 
     if (parentProcess || unhooked_ )
@@ -1208,16 +1408,18 @@ void CIntNewProcReq::performRequest()
                     MyNode->AddToNameMap( newProcess );
                     MyNode->AddToPidMap( newProcess->GetPid(),  newProcess );
 
-                    // Successfully forked process.  Replicate actual process
-                    // id and process name.
-                    
-//TRK-TODO 
-              /*      if (NameServerEnabled)
+                    // Successfully forked process
+                    if (NameServerEnabled)
                     {
-                        PtpClient->ProcessInit(newProcess, reqTag_, 0, parentNid_, lnode->GetNode()->GetName());
+                        // Send actual pid and process name back to parent
+                        PtpClient->ProcessInit( newProcess
+                                              , reqTag_
+                                              , 0
+                                              , parentNid_ );
                     }
                     else
-             */       {                    
+                    {                    
+                        // Replicate actual pid and process name
                         CReplProcInit *repl
                             = new CReplProcInit(newProcess, reqTag_, 0, parentNid_);
                         Replicator.addItem(repl);
@@ -1230,14 +1432,23 @@ void CIntNewProcReq::performRequest()
                 }
             }
 
-//TRK-TODO
             if (  newProcess == NULL )
             {  
                 // Process creation failure, relay error code to node
                 // that requested process creation.
-                CReplProcInit *repl = new CReplProcInit(newProcess, reqTag_,
-                                                        result, parentNid_);
-                Replicator.addItem(repl);
+                if (NameServerEnabled)
+                {
+                    PtpClient->ProcessInit( newProcess
+                                          , reqTag_
+                                          , result
+                                          , parentNid_ );
+                }
+                else
+                {
+                    CReplProcInit *repl = new CReplProcInit(newProcess, reqTag_,
+                                                            result, parentNid_);
+                    Replicator.addItem(repl);
+                }
             }
 #endif
         }
@@ -1248,13 +1459,300 @@ void CIntNewProcReq::performRequest()
         sprintf(buf, "[%s], Can't find parent process nid=%d, pid=%d "
                 "for process create.\n", method_name, 
                 parentNid_, parentPid_ );
-        mon_log_write(MON_CLUSTER_HANDLEOTHERNODE_10, SQ_LOG_ERR, buf); 
+        mon_log_write(MON_INTREQ_NEWPROC_1, SQ_LOG_ERR, buf); 
     }
 
     TRACE_EXIT;
 }
 
 #ifndef NAMESERVER_PROCESS
+CIntNotifyReq::CIntNotifyReq( struct notify_def *notifyDef ) 
+             : CInternalReq()
+             , nid_( notifyDef->nid )
+             , pid_( notifyDef->pid )
+             , verifier_( notifyDef->verifier )
+             , canceled_( notifyDef->canceled )
+             , targetNid_( notifyDef->target_nid )
+             , targetPid_( notifyDef->target_pid )
+             , targetVerifier_( notifyDef->target_verifier )
+             , transId_( notifyDef->trans_id )
+{
+    // Add eyecatcher sequence as a debugging aid
+    memcpy(&eyecatcher_, "RQI1", 4);
+}
+
+CIntNotifyReq::~CIntNotifyReq()
+{
+    // Alter eyecatcher sequence as a debugging aid to identify deleted object
+    memcpy(&eyecatcher_, "rqi1", 4);
+}
+
+void CIntNotifyReq::populateRequestString( void )
+{
+    char strBuf[MON_STRING_BUF_SIZE/2];
+    sprintf( strBuf, "IntReq(%s) req #=%ld notify(nid=%d/pid=%d/verifier=%d) death target(nid=%d/pid=%d/verifier=%d), canceled=%d, transId=%lld.%lld.%lld.%lld"
+                   , CReqQueue::intReqType[InternalType_Notify]
+                   , getId()
+                   , nid_
+                   , pid_
+                   , verifier_
+                   , targetNid_
+                   , targetPid_
+                   , targetVerifier_
+                   , canceled_
+                   , transId_.txid[0]
+                   , transId_.txid[1]
+                   , transId_.txid[2]
+                   , transId_.txid[3] );
+    requestString_.assign( strBuf );
+}
+
+void CIntNotifyReq::performRequest()
+{
+    const char method_name[] = "CIntNotifyReq::performRequest";
+    TRACE_ENTRY;
+
+    //CLNode *node;
+    //CLNode *targetNode;
+    CProcess *sourceProcess = NULL;
+    CProcess *targetProcess = NULL;
+
+    if (trace_settings & TRACE_PROCESS_DETAIL)
+    {
+        trace_printf( "%s@%d - Process death notification, canceled=%d\n"
+                    , method_name, __LINE__
+                    , canceled_ );
+    }
+
+    
+    if (trace_settings & TRACE_REQUEST)
+    {
+        trace_printf( "%s@%d" " - Finding targetProcess (%d,%d:%d)\n"
+                    , method_name, __LINE__
+                    , nid_
+                    , pid_
+                    , verifier_ );
+    }
+
+    // find by nid,pid (check node state, don't check process state, backup is Ok)
+    sourceProcess = Nodes->GetProcess( nid_
+                                     , pid_
+                                     , verifier_
+                                     , true, false, true );
+    if ( sourceProcess )
+    {
+        if (trace_settings & TRACE_REQUEST)
+        {
+            trace_printf( "%s@%d - Found sourceProcess %s (%d,%d:%d), clone=%d\n"
+                        , method_name, __LINE__
+                        , sourceProcess->GetName()
+                        , sourceProcess->GetNid()
+                        , sourceProcess->GetPid()
+                        , sourceProcess->GetVerifier()
+                        , sourceProcess->IsClone() );
+        }
+    }
+    else
+    {
+        if (!NameServerEnabled)
+        {
+            if (trace_settings & TRACE_REQUEST)
+            {
+                trace_printf("%s@%d - Can't find sourceProcess\n", method_name, __LINE__);
+            }
+        }
+        else
+        { // Name Server find by nid,pid:verifier
+            if (trace_settings & TRACE_REQUEST)
+            {
+                trace_printf( "%s@%d" " - Getting sourceProcess from Name Server (%d,%d:%d)\n"
+                            , method_name, __LINE__
+                            , nid_
+                            , pid_
+                            , verifier_ );
+            }
+            sourceProcess = Nodes->GetProcessNs( nid_
+                                               , pid_
+                                               , verifier_ );
+            if (sourceProcess)
+            {
+                if (trace_settings & TRACE_REQUEST)
+                    trace_printf( "%s@%d - Found sourceProcess %s (%d,%d:%d), clone=%d\n"
+                                , method_name, __LINE__
+                                , sourceProcess->GetName()
+                                , sourceProcess->GetNid()
+                                , sourceProcess->GetPid()
+                                , sourceProcess->GetVerifier()
+                                , sourceProcess->IsClone() );
+            }
+            else
+            {
+                trace_printf( "%s@%d" " - Can't find sourceProcess (%d,%d:%d)\n"
+                            , method_name, __LINE__
+                            , nid_
+                            , pid_
+                            , verifier_ );
+            }
+        }
+    }
+    
+    if ( sourceProcess )
+    {
+        if (trace_settings & TRACE_REQUEST)
+        {
+            trace_printf( "%s@%d" " - Finding targetProcess (%d,%d:%d)\n"
+                        , method_name, __LINE__
+                        , targetNid_
+                        , targetPid_
+                        , targetVerifier_ );
+        }
+    
+        // find by nid,pid (check node state, don't check process state, backup is Ok)
+        targetProcess = Nodes->GetProcess( targetNid_
+                                         , targetPid_
+                                         , targetVerifier_
+                                         , true, false, true );
+        if ( targetProcess )
+        {
+            if (trace_settings & TRACE_REQUEST)
+            {
+                trace_printf( "%s@%d - Found targetProcess %s (%d,%d:%d), clone=%d\n"
+                            , method_name, __LINE__
+                            , targetProcess->GetName()
+                            , targetProcess->GetNid()
+                            , targetProcess->GetPid()
+                            , targetProcess->GetVerifier()
+                            , targetProcess->IsClone() );
+            }
+        }
+        else
+        {
+            if (!NameServerEnabled)
+            {
+                if (trace_settings & TRACE_REQUEST)
+                {
+                    trace_printf("%s@%d - Can't find targetProcess\n", method_name, __LINE__);
+                }
+            }
+            else
+            { // Name Server find by nid,pid:verifier
+                if (trace_settings & TRACE_REQUEST)
+                {
+                    trace_printf( "%s@%d" " - Getting targetProcess from Name Server (%d,%d:%d)\n"
+                                , method_name, __LINE__
+                                , targetNid_
+                                , targetPid_
+                                , targetVerifier_ );
+                }
+                targetProcess = Nodes->GetProcessNs( targetNid_
+                                                   , targetPid_
+                                                   , targetVerifier_ );
+                if (targetProcess)
+                {
+                    if (trace_settings & TRACE_REQUEST)
+                        trace_printf( "%s@%d - Found targetProcess %s (%d,%d:%d), clone=%d\n"
+                                    , method_name, __LINE__
+                                    , targetProcess->GetName()
+                                    , targetProcess->GetNid()
+                                    , targetProcess->GetPid()
+                                    , targetProcess->GetVerifier()
+                                    , targetProcess->IsClone() );
+                }
+                else
+                {
+                    trace_printf( "%s@%d" " - Can't find targetProcess (%d,%d:%d)\n"
+                                , method_name, __LINE__
+                                , targetNid_
+                                , targetPid_
+                                , targetVerifier_ );
+                }
+            }
+        }
+        
+        if ( targetProcess )
+        {
+            if (canceled_)
+            {
+                if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+                {
+                    trace_printf( "%s@%d - Process (%d, %d:%d) deleting death "
+                                  "notice interest for %s (%d, %d:%d), "
+                                  "trans_id=%lld.%lld.%lld.%lld\n"
+                                , method_name, __LINE__
+                                , nid_
+                                , pid_
+                                , verifier_
+                                , targetProcess->GetName()
+                                , targetNid_
+                                , targetPid_
+                                , targetVerifier_
+                                , transId_.txid[0]
+                                , transId_.txid[1]
+                                , transId_.txid[2]
+                                , transId_.txid[3] );
+                }
+            
+                // Remove death notice registration
+                targetProcess->CancelDeathNotification( nid_
+                                                      , pid_
+                                                      , verifier_
+                                                      , transId_ );
+            }
+            else
+            {
+                if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+                {
+                    trace_printf("%s@%d - Process (%d, %d:%d) registering interest "
+                                 "in death of process %s (%d, %d:%d), "
+                                 "trans_id=%lld.%lld.%lld.%lld\n"
+                                , method_name, __LINE__
+                                , nid_
+                                , pid_
+                                , verifier_
+                                , targetProcess->GetName()
+                                , targetNid_
+                                , targetPid_
+                                , targetVerifier_
+                                , transId_.txid[0]
+                                , transId_.txid[1]
+                                , transId_.txid[2]
+                                , transId_.txid[3] );
+                }
+                // Register interest with the target process 
+                sourceProcess->procExitReg( targetProcess, transId_);
+            }
+        }
+        else
+        {
+            char buf[MON_STRING_BUF_SIZE];
+            sprintf( buf
+                   , "[%s], Can't find target process nid=%d, pid=%d:%d for "
+                     "processing process death notification.\n"
+                   , method_name
+                   , targetNid_
+                   , targetPid_
+                   , targetVerifier_ );
+            mon_log_write(MON_INTREQ_NOTIFY_1, SQ_LOG_INFO, buf);
+        }
+    }
+    else
+    {
+        char buf[MON_STRING_BUF_SIZE];
+        sprintf( buf
+               , "[%s], Can't find sourceProcess nid=%d, pid=%d:%d for "
+                 "processing process death notification.\n"
+               , method_name
+               , nid_
+               , pid_
+               , verifier_ );
+        mon_log_write(MON_INTREQ_NOTIFY_3, SQ_LOG_INFO, buf);
+    }
+    
+    TRACE_EXIT;
+}
+#endif
+
+#ifndef NAMESERVER_PROCESS
 CIntOpenReq::CIntOpenReq( struct open_def *openDef ) 
             : CInternalReq()
             , openerNid_( openDef->nid )
@@ -1325,7 +1823,7 @@ void CIntOpenReq::performRequest()
         char buf[MON_STRING_BUF_SIZE];
         sprintf(buf, "[%s], Can't find process nid=%d, pid=%d for "
                 "processing open.\n", method_name, openedNid_, openedPid_ );
-        mon_log_write(MON_CLUSTER_HANDLEOTHERNODE_11, SQ_LOG_ERR, buf); 
+        mon_log_write(MON_INTREQ_OPEN_1, SQ_LOG_ERR, buf); 
     }
 
     TRACE_EXIT;
@@ -1416,41 +1914,6 @@ void CIntProcInitReq::performRequest()
                 parent->SetParentPid ( process_->GetPid() );
             }
         }
-
-
-#ifdef QUICK_WAITED_NEWPROCESS_REPLY
-// Following allows reply to a "waited" new process request before we
-// get the "startup" message from the process.   This make the process
-// creation appear to complete more quickly.   However there are potential
-// problems if the requester immediately tries to open the new process 
-// because it is not ready yet.   So need to handle quick "open" of this
-// type before re-enabling this code section.
-                if (!process->IsNowait())
-                {   // new process request was a "waited" request
-                    if (process->GetParentNid() == -1)
-                    {
-                        parent = NULL;
-                    }
-                    else
-                    {
-                        parent =
-                            LNode[process->GetParentNid()]->
-                            GetProcessL(process->GetParentPid());
-                    }
-
-                    if (parent)
-                    {   
-                        reply_msg = process->parentContext();
-                        if ( reply_msg )
-                        {
-                            // the parent gets a new_process reply
-                            parent->ReplyNewProcess ( reply_msg, process );
-                            
-                            process->parentContext (NULL);
-                        }
-                    }
-                }
-#endif
     }
 
     TRACE_EXIT;
@@ -1574,13 +2037,6 @@ void CIntChildDeathReq::performRequest()
 
     if ( process_ != NULL)
     {
-#ifndef NAMESERVER_PROCESS
-        if ( NameServerEnabled )
-            NameServer->ProcessDelete(process_); // in reqQueue thread (CIntChildDeathReq)
-#endif
-        MyNode->DelFromNameMap ( process_ );
-        MyNode->DelFromPidMap ( process_ );
-
         if (trace_settings & TRACE_PROCESS)
         {
             trace_printf( "%s@%d Processing child death "
@@ -1591,6 +2047,13 @@ void CIntChildDeathReq::performRequest()
                          , process_->GetPid()
                          , process_->GetVerifier() );
         }
+#ifndef NAMESERVER_PROCESS
+        if ( NameServerEnabled )
+            NameServer->ProcessDelete(process_); // in reqQueue thread (CIntChildDeathReq)
+#endif
+        MyNode->DelFromNameMap ( process_ );
+        MyNode->DelFromPidMap ( process_ );
+
         // if state is still Up, then process has not called exit.
         bool abended = (process_->GetState() == State_Up);
         MyNode->SetProcessState(process_, State_Stopped, abended);
@@ -2677,7 +3140,7 @@ void CIntSnapshotReq::performRequest()
         case CommType_Sockets:
             if (Monitor->getJoinSock() == -1)
             {
-                mem_log_write(MON_REQQUEUE_SNAPSHOT_2);
+                mem_log_write(MON_REQQUEUE_SNAPSHOT_3);
         
                 char buf[MON_STRING_BUF_SIZE];
                 sprintf(buf, "[%s], Join socket is -1, aborting snapshot req.\n", method_name);
@@ -2791,7 +3254,7 @@ void CIntSnapshotReq::performRequest()
     {
         char buf[MON_STRING_BUF_SIZE];
         sprintf(buf, "Snapshot buffer compression error = %d, aborting node reintegration.\n", z_result);
-        mon_log_write (MON_REQQUEUE_SNAPSHOT_9, SQ_LOG_CRIT, buf);
+        mon_log_write (MON_REQQUEUE_SNAPSHOT_14, SQ_LOG_CRIT, buf);
 
         // send msg to new monitor so that it can exit
         header.compressedSize_ = -1;
@@ -2816,7 +3279,7 @@ void CIntSnapshotReq::performRequest()
         }
         if (error) {
             sprintf(buf, "Unable to send exit msg to new monitor, error = %d\n", error);
-            mon_log_write(MON_REQQUEUE_SNAPSHOT_9, SQ_LOG_CRIT, buf);
+            mon_log_write(MON_REQQUEUE_SNAPSHOT_15, SQ_LOG_CRIT, buf);
         }
 
         sprintf(buf, "Node reintegration aborted due to buffer compression error.");
@@ -3210,6 +3673,11 @@ CExternalReq *CReqQueue::prepExternalReq(CExternalReq::reqQueueMsg_t msgType,
             request->setConcurrent(reqConcurrent[msg->u.request.type]);
             break;
 
+        case ReqType_ProcessInfoNs:
+            request = new CExtProcInfoNsReq(msgType, nid, pid, sockFd, msg);
+            request->setConcurrent(reqConcurrent[msg->u.request.type]);
+            break;
+
         case ReqType_ShutdownNs:
             request = new CExtShutdownNsReq(msgType, nid, pid, sockFd, msg);
             request->setConcurrent(reqConcurrent[msg->u.request.type]);
@@ -3524,8 +3992,11 @@ void CReqQueue::enqueueCloneReq ( struct clone_def *cloneDef )
 {
     CInternalReq * request;
 
+#ifndef NAMESERVER_PROCESS
     request = new CIntCloneProcReq ( cloneDef->backup, cloneDef->unhooked, cloneDef->event_messages, cloneDef->system_messages, cloneDef->nid, cloneDef->type, cloneDef->priority, cloneDef->parent_nid, cloneDef->parent_pid, cloneDef->parent_verifier, cloneDef->os_pid, cloneDef->verifier, cloneDef->prior_pid, cloneDef->persistent_retries, cloneDef->argc, cloneDef->creation_time, cloneDef->pathStrId, cloneDef->ldpathStrId, cloneDef->programStrId, cloneDef->nameLen, cloneDef->portLen, cloneDef->infileLen, cloneDef->outfileLen, cloneDef->argvLen, &cloneDef->stringData, cloneDef->origPNidNs);
-
+#else
+    request = new CIntCloneProcNsReq ( cloneDef->backup, cloneDef->unhooked, cloneDef->event_messages, cloneDef->system_messages, cloneDef->nid, cloneDef->type, cloneDef->priority, cloneDef->parent_nid, cloneDef->parent_pid, cloneDef->parent_verifier, cloneDef->os_pid, cloneDef->verifier, cloneDef->prior_pid, cloneDef->persistent_retries, cloneDef->argc, cloneDef->creation_time, cloneDef->pathStrId, cloneDef->ldpathStrId, cloneDef->programStrId, cloneDef->nameLen, cloneDef->portLen, cloneDef->infileLen, cloneDef->outfileLen, cloneDef->argvLen, &cloneDef->stringData, cloneDef->origPNidNs);
+#endif
     enqueueReq ( request );
 }
 
@@ -3797,6 +4268,17 @@ void CReqQueue::enqueueNewProcReq( struct process_def *procDef )
 
 
 #ifndef NAMESERVER_PROCESS
+void CReqQueue::enqueueNotifyReq( struct notify_def *notifyDef )
+{
+    CIntNotifyReq * request;
+
+    request = new CIntNotifyReq( notifyDef );
+
+    enqueueReq ( request );
+}
+#endif
+
+#ifndef NAMESERVER_PROCESS
 void CReqQueue::enqueueOpenReq( struct open_def *openDef )
 {
     CIntOpenReq * request;
@@ -4365,13 +4847,14 @@ const bool CReqQueue::reqConcurrent[] = {
    false,    // ReqType_PNodeInfo
    false,    // ReqType_ProcessInfo
    false,    // ReqType_ProcessInfoCont
+   false,    // ReqType_ProcessInfoNs
    false,    // ReqType_Set
    false,    // ReqType_Shutdown
    false,    // ReqType_ShutdownNs
    false,    // ReqType_Startup
    false,    // ReqType_Stfsd
    false,    // ReqType_TmLeader
-   false,    // ReqType_TmReady,
+   false,    // ReqType_TmReady
    false,    // ReqType_TmSync
    false,    // ReqType_TransInfo
    false,    // ReqType_ZoneInfo
@@ -4380,89 +4863,91 @@ const bool CReqQueue::reqConcurrent[] = {
 
 // Request names used for trace output
 const char * CReqQueue::svcReqType[] = {
-    "",
-    "Close",
-    "DeleteNs",
-    "Dump",
-    "Event",
-    "Exit",
-    "Get",
-    "Kill",
-    "MonStats",
-    "Mount",
-    "NameServerAdd",
-    "NameServerDelete",
-    "NameServerStart",
-    "NameServerStop",
-    "NewProcess",
-    "NewProcessNs",
-    "NodeAdd",
-    "NodeDelete",
-    "NodeDown",
-    "NodeInfo",
-    "NodeName",
-    "NodeUp",
-    "Notice",
-    "Notify",
-    "Open",
-    "OpenInfo",
-    "PersistAdd",
-    "PersistDelete",
-    "PNodeInfo",
-    "ProcessInfo",
-    "ProcessInfoCont",
-    "Set",
-    "Shutdown",
-    "ShutdownNs",
-    "Startup",
-    "Stfsd",
-    "TmLeader",
-    "TmReady",
-    "TmSync",
-    "TransInfo",
-    "ZoneInfo"
+    "",                 // unused, request types start at 1
+    "Close",            // ReqType_Close
+    "DelProcessNs",     // ReqType_DelProcessNs
+    "Dump",             // ReqType_Dump
+    "Event",            // ReqType_Event
+    "Exit",             // ReqType_Exit
+    "Get",              // ReqType_Get
+    "Kill",             // ReqType_Kill
+    "MonStats",         // ReqType_MonStats
+    "Mount",            // ReqType_Mount
+    "NameServerAdd",    // ReqType_NameServerAdd
+    "NameServerDelete", // ReqType_NameServerDelete
+    "NameServerStart",  // ReqType_NameServerStart
+    "NameServerStop",   // ReqType_NameServerStop
+    "NewProcess",       // ReqType_NewProcess
+    "NewProcessNs",     // ReqType_NewProcessNs
+    "NodeAdd",          // ReqType_NodeAdd
+    "NodeDelete",       // ReqType_NodeDelete
+    "NodeDown",         // ReqType_NodeDown
+    "NodeInfo",         // ReqType_NodeInfo
+    "NodeName",         // ReqType_NodeName
+    "NodeUp",           // ReqType_NodeUp
+    "Notice",           // ReqType_Notice -- not an actual request
+    "Notify",           // ReqType_Notify
+    "Open",             // ReqType_Open
+    "OpenInfo",         // ReqType_OpenInfo
+    "PersistAdd",       // ReqType_PersistAdd
+    "PersistDelete",    // ReqType_PersistDelete
+    "PNodeInfo",        // ReqType_PNodeInfo
+    "ProcessInfo",      // ReqType_ProcessInfo
+    "ProcessInfoCont",  // ReqType_ProcessInfoCont
+    "ProcessInfoNs",    // ReqType_ProcessInfoNs
+    "Set",              // ReqType_Set
+    "Shutdown",         // ReqType_Shutdown
+    "ShutdownNs",       // ReqType_ShutdownNs
+    "Startup",          // ReqType_Startup
+    "Stfsd",            // ReqType_Stfsd
+    "TmLeader",         // ReqType_TmLeader
+    "TmReady",          // ReqType_TmReady
+    "TmSync",           // ReqType_TmSync
+    "TransInfo",        // ReqType_TransInfo
+    "ZoneInfo"          // ReqType_ZoneInfo
+    "Invalid"           // ReqType_Invalid
 };
 
 // Must match internal.h:InternalType 
 const char * CReqQueue::intReqType[] = {
-      ""
-    , "ActivateSpare"
-    , "Clone"
-    , "Device"
-    , "Down"
-    , "Dump"
-    , "DumpComplete"
-    , "Event"
-    , "Exit"
-    , "IoData"
-    , "Kill"
-    , "NameServerAdd"
-    , "NameServerDelete"
-    , "NodeAdd"
-    , "NodeAdded"
-    , "NodeDelete"
-    , "NodeDeleted"
-    , "NodeName"
-    , "Notify"
-    , "PersistAdd"
-    , "PersistDelete"
-    , "Process"
-    , "ProcessInit"
-    , "Open"
-    , "Set"
-    , "StdinReq"
-    , "Sync"
-    , "Up"
-    , "CreatePrimitives"
-    , "Quiesce"
-    , "PostQuiesce"
-    , "Revive"
-    , "Snapshot"
-    , "UniqStr"
-    , "TMReady"
-    , "Shutdown"
-    , "SchedData"
-    , "SoftNodeDown"
-    , "SoftNodeUp"
+      ""                  // InternalType_Null
+    , "ActivateSpare"     // InternalType_ActivateSpare
+    , "Clone"             // InternalType_Clone
+    , "Device"            // InternalType_Device
+    , "Down"              // InternalType_Down
+    , "Dump"              // InternalType_Dump
+    , "DumpComplete"      // InternalType_DumpComplete
+    , "Event"             // InternalType_Event
+    , "Exit"              // InternalType_Exit
+    , "IoData"            // InternalType_IoData
+    , "Kill"              // InternalType_Kill
+    , "NameServerAdd"     // InternalType_NameServerAdd
+    , "NameServerDelete"  // InternalType_NameServerDelete
+    , "NodeAdd"           // InternalType_NodeAdd
+    , "NodeAdded"         // InternalType_NodeAdded
+    , "NodeDelete"        // InternalType_NodeDelete
+    , "NodeDeleted"       // InternalType_NodeDeleted
+    , "NodeName"          // InternalType_NodeName
+    , "Notify"            // InternalType_Notify
+    , "PersistAdd"        // InternalType_PersistAdd
+    , "PersistDelete"     // InternalType_PersistDelete
+    , "Process"           // InternalType_Process
+    , "ProcessInit"       // InternalType_ProcessInit
+    , "Open"              // InternalType_Open
+    , "Set"               // InternalType_Set
+    , "StdinReq"          // InternalType_StdinReq
+    , "Sync"              // InternalType_Sync
+    , "Up"                // InternalType_Up
+    , "CreatePrimitives"  // InternalType_CreatePrimitives
+    , "Quiesce"           // InternalType_Quiesce
+    , "PostQuiesce"       // InternalType_PostQuiece
+    , "Revive"            // InternalType_Revive
+    , "Snapshot"          // InternalType_Snapshot
+    , "UniqStr"           // InternalType_UniqStr
+    , "TMReady"           // InternalType_TmReady
+    , "Shutdown"          // InternalType_Shutdown
+    , "SchedData"         // InternalType_SchedData
+    , "SoftNodeDown"      // InternalType_SoftNodeDown
+    , "SoftNodeUp"        // InternalType_SoftNodeUp
 };
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/reqqueue.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqqueue.h b/core/sqf/monitor/linux/reqqueue.h
index 5f59315..7fa69fd 100644
--- a/core/sqf/monitor/linux/reqqueue.h
+++ b/core/sqf/monitor/linux/reqqueue.h
@@ -659,6 +659,24 @@ private:
     void populateRequestString( void );
 };
 
+#ifdef NAMESERVER_PROCESS
+
+class CExtProcInfoNsReq: public CExternalReq
+{
+public:
+    CExtProcInfoNsReq( reqQueueMsg_t msgType,
+                       int nid, int pid, int sockFd,
+                       struct message_def *msg );
+    virtual ~CExtProcInfoNsReq();
+
+    void performRequest();
+
+private:
+    void copyInfo(CProcess *process, ProcessInfoNs_reply_def &procInfo);
+    void populateRequestString( void );
+};
+#endif
+
 #ifndef NAMESERVER_PROCESS
 class CExtSetReq: public CExternalReq
 {
@@ -810,6 +828,7 @@ private:
 };
 
 
+#ifndef NAMESERVER_PROCESS
 class CIntCloneProcReq: public CInternalReq
 {
 public:
@@ -848,6 +867,48 @@ private:
     char * stringData_;
     int origPNidNs_;
 };
+#endif
+
+#ifdef NAMESERVER_PROCESS
+class CIntCloneProcNsReq: public CInternalReq
+{
+public:
+    CIntCloneProcNsReq( bool backup, bool unhooked, bool eventMessages, bool systemMessages, int nid, PROCESSTYPE type, int priority, int parentNid, int parentPid, int parentVerifier, int osPid, int verifier, pid_t priorPid, int persistentRetries, int  argc, struct timespec creationTime, strId_t pathStrId, strId_t ldpathStrId, strId_t programStrId, int nameLen, int portLen, int infileLen, int outfileLen, int argvLen, const char * stringData, int origPNidNs);
+    virtual ~CIntCloneProcNsReq();
+
+    void performRequest();
+
+private:
+    void populateRequestString( void );
+
+    bool backup_;
+    bool unhooked_;
+    bool eventMessages_;
+    bool systemMessages_;
+    int nid_;
+    PROCESSTYPE type_;
+    int priority_;
+    int parentNid_;
+    int parentPid_;
+    int parentVerifier_;
+    int osPid_;
+    int verifier_; 
+    pid_t priorPid_;
+    int persistentRetries_;
+    int  argc_;
+    struct timespec creationTime_;
+    strId_t pathStrId_;
+    strId_t ldpathStrId_;
+    strId_t programStrId_;
+    int  nameLen_;
+    int  portLen_;
+    int  infileLen_;
+    int  outfileLen_;
+    int  argvLen_;
+    char * stringData_;
+    int origPNidNs_;
+};
+#endif
 
 #ifndef NAMESERVER_PROCESS
 class CIntDeviceReq: public CInternalReq
@@ -983,6 +1044,28 @@ private:
     char * stringData_;
 };
 
+class CIntNotifyReq: public CInternalReq
+{
+public:
+    CIntNotifyReq( struct notify_def *notifyDef );
+    virtual ~CIntNotifyReq( );
+
+    void performRequest();
+
+private:
+    void populateRequestString( void );
+
+    int nid_;
+    int pid_;
+    Verifier_t verifier_;
+    bool canceled_;
+    int targetNid_;
+    int targetPid_;
+    Verifier_t targetVerifier_;
+    _TM_Txid_External transId_;
+};
+
+
 class CIntOpenReq: public CInternalReq
 {
 public:
@@ -1397,6 +1480,7 @@ class CReqQueue
 #endif
     void enqueueNewProcReq( struct process_def *procDef );
 #ifndef NAMESERVER_PROCESS
+    void enqueueNotifyReq( struct notify_def *notifyDef );
     void enqueueOpenReq( struct open_def *openDef );
 #endif
     void enqueueProcInitReq( struct process_init_def *procInitDef );

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/test/childExitChild.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/test/childExitChild.cxx b/core/sqf/monitor/test/childExitChild.cxx
index 2fea575..adc11f9 100755
--- a/core/sqf/monitor/test/childExitChild.cxx
+++ b/core/sqf/monitor/test/childExitChild.cxx
@@ -57,6 +57,7 @@ int main (int argc, char *argv[])
     util.requestStartup ();
 
     for (int i=0; i<10; i++)
+//    while( 1 )
     {
         if ( tracing )
             printf ("[%s] delaying...\n", MyName);

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/test/childExitParent.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/test/childExitParent.cxx b/core/sqf/monitor/test/childExitParent.cxx
index 96bcc84..702f6d0 100755
--- a/core/sqf/monitor/test/childExitParent.cxx
+++ b/core/sqf/monitor/test/childExitParent.cxx
@@ -142,6 +142,7 @@ int main (int argc, char *argv[])
     printf ("[%s] children created, ready to be killed ...\n", MyName);
 
     for (int i=0; i<7; i++)
+//    while( 1 )
     {
         // temp print
         printf ("[%s] delaying...\n", MyName);

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/test/montestutil.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/test/montestutil.cxx b/core/sqf/monitor/test/montestutil.cxx
index 3376348..43e16c9 100644
--- a/core/sqf/monitor/test/montestutil.cxx
+++ b/core/sqf/monitor/test/montestutil.cxx
@@ -134,8 +134,8 @@ void MonTestUtil::processArgs( int argc, char *argv[] )
     // enable tracing if trace flag supplied
     for (i=0; i<argc; i++)
     {
-        if ( strcmp(argv[i], "-t") == 0 ) gv_xmpi_trace = trace_ = true;
-//        if ( strcmp(argv[i], "-t") == 0 ) trace_ = true;
+//        if ( strcmp(argv[i], "-t") == 0 ) gv_xmpi_trace = trace_ = true;
+        if ( strcmp(argv[i], "-t") == 0 ) trace_ = true;
         if ( strcmp(argv[i], "-x") == 0 ) shutdownBeforeStartup_ = true;
         if ( strcmp(argv[i], "-y") == 0 ) nodedownBeforeStartup_ = true;
     }

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/test/runtest
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/test/runtest b/core/sqf/monitor/test/runtest
index 8c1193b..1d7929e 100755
--- a/core/sqf/monitor/test/runtest
+++ b/core/sqf/monitor/test/runtest
@@ -60,6 +60,12 @@ function Usage
     echo
 }
 
+function Cleanup
+{
+    ckillall
+    sqipcrm
+}
+
 if [ $# -lt 1 ]; then
     Usage
     exit 1
@@ -108,15 +114,26 @@ cd $TRAF_HOME/monitor/test
 echo $PWD
 
 if [ "$cluster" = "-cluster" ]; then
-    ckillall
+    echo ************ Executing test in cluster environment ************
 else if [ "$virtual" = "-virtual" ]; then
-    ckillall
+    echo ************ Executing test in virtual environment ************
 else
     Usage
     exit 1
 fi
 fi
 
+if [ "$cluster" = "-cluster" ]; then
+    pdsh $MY_NODES "rm -f $MPI_TMPDIR/monitor.port.*"
+    pdsh $MY_NODES "rm $PWD/core* $PWD/*.lst $PWD/stdout_*"
+else
+    rm -f $MPI_TMPDIR/monitor.port.*
+    rm core* *.lst stdout_*
+    # Establish SQ virtual cluster parameters
+    export SQ_VIRTUAL_NODES=6
+    export SQ_VIRTUAL_NID=0
+fi
+
 if [ ! -z "$SQ_DTM_PERSISTENT_PROCESS" ]; then
     let dtm_persistent_process=`echo $SQ_DTM_PERSISTENT_PROCESS`
 else
@@ -130,21 +147,6 @@ export SQ_SHELL_NOCWD=1
 #export SQ_LOCAL_IO_SHELL_TRACE=1
 
 #
-# Cleanup
-#
-sqipcrm
-if [ "$cluster" = "-cluster" ]; then
-    pdsh $MY_NODES "rm -f $MPI_TMPDIR/monitor.port.*"
-    pdsh $MY_NODES "rm $PWD/core* $PWD/*.lst $PWD/stdout_*"
-else
-    rm -f $MPI_TMPDIR/monitor.port.*
-    rm core* *.lst stdout_*
-    # Establish SQ virtual cluster parameters
-    export SQ_VIRTUAL_NODES=6
-    export SQ_VIRTUAL_NID=0
-fi
-
-#
 # Setup up monitor configuration
 #
 if [ "$nogen" = "-nogen" ]; then
@@ -161,13 +163,23 @@ if ( [ $test '==' -1 ] || [ $test '==' 1 ] ); then
  echo "***"
  echo "*** Executing Child Exit test"
  echo "***"
+Cleanup
 shell <<eof
  startup
+ delay 3
  exec {name \$CTRLR, nid 0, out $TRAF_HOME/monitor/test/childExit.lst} childExitCtrl $trace
+ delay 3
+ ps
+ !shutdown
+ exit
+eof
+if ( [ $test '==' -1 ] ); then
+shell <<eof
  shutdown
  exit
 eof
- sleep 1
+fi
+ sleep 5
  cstat -h
  if [ "$cluster" = "-cluster" ]; then
      pdsh $MY_NODES grep PASSED $PWD/childExit.lst
@@ -182,8 +194,10 @@ if ( [ $test '==' -1 ] || [ $test '==' 2 ] ); then
  echo "***"
  echo "*** Executing Multi-Node test"
  echo "***"
+Cleanup
 shell <<eof
  startup
+ delay 3
  ! General tests for monitor functionality. This includes
  !  Open, Close, NewProcess, ProcessInfo and sync node state
  !  between nodes.
@@ -193,10 +207,18 @@ shell <<eof
  exec {nowait,pri 5,name \$SERV1} server $trace
  ps
  exec {pri 10,name \$CLIENT,nid 0, out $TRAF_HOME/monitor/test/multiNode.lst} client $trace
+ delay 3
+ !shutdown
+ ps
+ exit
+eof
+if ( [ $test '==' -1 ] ); then
+shell <<eof
  shutdown
  exit
 eof
- sleep 1
+fi
+ sleep 5
  cstat -h
  if [ "$cluster" = "-cluster" ]; then
      pdsh $MY_NODES grep PASSED $PWD/multiNode.lst
@@ -211,13 +233,23 @@ fi
  echo "***"
  echo "*** Executing Registry test"
  echo "***"
+Cleanup
 shell <<eof
  startup
+ delay 3
  exec {name \$CTRLR, nid 0, out $TRAF_HOME/monitor/test/regTest.lst} regTestCtrl $trace
+ delay 3
+ ps
+ !shutdown
+ exit
+eof
+if ( [ $test '==' -1 ] ); then
+shell <<eof
  shutdown
  exit
 eof
- sleep 1
+fi
+ sleep 5
  cstat -h
  if [ "$cluster" = "-cluster" ]; then
      pdsh $MY_NODES grep PASSED $PWD/regTest.lst
@@ -232,8 +264,10 @@ if ( [ $test '==' -1 ] || [ $test '==' 4 ] ); then
  echo "***"
  echo "*** Executing Death Notice test"
  echo "***"
- shell <<eof
+Cleanup
+shell <<eof
  startup
+ delay 3
  ! Test to register and cancel process death
  ! notices from non-parent process.
  !
@@ -246,10 +280,18 @@ if ( [ $test '==' -1 ] || [ $test '==' 4 ] ); then
  ! To enable tracing add "-t" argument to the end of the "exec" line
  !
  exec {name \$DEATH, nid 0, out $TRAF_HOME/monitor/test/deathNotice.lst} deathNotice $trace
+ delay 3
+ ps
+ !shutdown
+ exit
+eof
+if ( [ $test '==' -1 ] ); then
+shell <<eof
  shutdown
  exit
 eof
- sleep 1
+fi
+ sleep 5
  cstat -h
  if [ "$cluster" = "-cluster" ]; then
      pdsh $MY_NODES grep PASSED $PWD/deathNotice.lst
@@ -260,20 +302,31 @@ eof
  fi
 fi
 
-if ( [ $test '==' -1 ] || [ $test '==' 5 ] ); then
+#if ( [ $test '==' -1 ] || [ $test '==' 5 ] ); then
+if ( [ $test '==' 5 ] ); then
  if [ "$cluster" = "-cluster" ]; then
   echo "***"
   echo "*** Executing Persistent Process cluster test"
   echo "***"
+Cleanup
 shell <<eof
  startup
+ delay 3
  down 2 !
  delay 15
  exec {name \$PPROC, nid 0, out $TRAF_HOME/monitor/test/persistentProc.lst} persistentProc $trace
+ delay 3
+ ps
+ !shutdown
+ exit
+eof
+if ( [ $test '==' -1 ] ); then
+shell <<eof
  shutdown
  exit
 eof
-  sleep 1
+fi
+  sleep 5
   cstat -h
   pdsh $MY_NODES grep PASSED $PWD/persistentProc.lst
   pdsh $MY_NODES grep FAILED $PWD/persistentProc.lst
@@ -281,31 +334,53 @@ eof
   echo "***"
   echo "*** Executing Persistent Process test"
   echo "***"
+Cleanup
 shell <<eof
  startup
+ delay 3
  exec {name \$PPROC, nid 0, out $TRAF_HOME/monitor/test/persistentProc.lst} persistentProc $trace
+ delay 3
+ ps
+ !shutdown
+ exit
+eof
+if ( [ $test '==' -1 ] ); then
+shell <<eof
  shutdown
  exit
 eof
-  sleep 1
+fi
+  sleep 5
   cstat -h
   grep PASSED $PWD/persistentProc.lst
   grep FAILED $PWD/persistentProc.lst
  fi
 fi
 
+#if ( [[ $dtm_persistent_process == "1" ]] &&
+#      ([ $test '==' -1 ] || [ $test '==' 6 ]) ); then
 if ( [[ $dtm_persistent_process == "1" ]] &&
-      ([ $test '==' -1 ] || [ $test '==' 6 ]) ); then
+      ([ $test '==' 6 ]) ); then
  echo "***"
  echo "*** Executing DTM Process test"
  echo "***"
+Cleanup
 shell <<eof
  startup
+ delay 3
  exec {name \$DTMCTRL, nid 0, out $TRAF_HOME/monitor/test/dtmTest.lst} dtmCtrl $trace
+ delay 3
+ ps
+ !shutdown
+ exit
+eof
+if ( [ $test '==' -1 ] ); then
+shell <<eof
  shutdown
  exit
 eof
- sleep 1
+fi
+ sleep 5
  cstat -h
  if [ "$cluster" = "-cluster" ]; then
      pdsh $MY_NODES grep PASSED $PWD/dtmTest.lst
@@ -320,17 +395,28 @@ else
    fi
 fi
 
-if ( [ $test '==' -1 ] || [ $test '==' 7 ] ); then
+#if ( [ $test '==' -1 ] || [ $test '==' 7 ] ); then
+if ( [ $test '==' 7 ] ); then
  echo "***"
  echo "*** Executing SPX Process test"
  echo "***"
+Cleanup
 shell <<eof
  startup
+ delay 3
  exec {name \$SPXCTRL, nid 0, out $TRAF_HOME/monitor/test/spxTest.lst} spxCtrl $trace
+ delay 3
+ ps
+ !shutdown
+ exit
+eof
+if ( [ $test '==' -1 ] ); then
+shell <<eof
  shutdown
  exit
 eof
- sleep 1
+fi
+ sleep 5
  cstat -h
  if [ "$cluster" = "-cluster" ]; then
      pdsh $MY_NODES grep PASSED $PWD/spxTest.lst
@@ -345,12 +431,23 @@ if ( [ $test '==' -1 ] || [ $test '==' 8 ] ); then
  echo "***"
  echo "*** Executing Process Create test"
  echo "***"
+Cleanup
 shell <<eof
  startup
+ delay 3
  exec {name \$PCRE8, nid 0, out $TRAF_HOME/monitor/test/procCreate.lst} procCreate $trace -x
+ delay 3
+ ps
+ !shutdown
+ exit
+eof
+if ( [ $test '==' -1 ] ); then
+shell <<eof
+ shutdown
  exit
 eof
- sleep 1
+fi
+ sleep 5
  cstat -h
  if [ "$cluster" = "-cluster" ]; then
      pdsh $MY_NODES grep PASSED $PWD/procCreate.lst
@@ -365,15 +462,24 @@ if ( [ $test '==' -1 ] || [ $test '==' 9 ] ); then
  echo "***"
  echo "*** Executing Process Creates Node down before startup test"
  echo "***"
+Cleanup
 shell <<eof 
  startup
+ delay 3
  exec {nowait, name \$PCRE8, nid 0, out $TRAF_HOME/monitor/test/nodeDown.lst} procCreate $trace -y
  delay 3
  down 1 !
  delay 10
+ ps
+ !shutdown
+ exit
+eof
+if ( [ $test '==' -1 ] ); then
+shell <<eof
  shutdown
  exit
 eof
+fi
  sleep 10
  cstat -h
  if [ "$cluster" = "-cluster" ]; then
@@ -386,50 +492,80 @@ eof
 fi
 
 
-#if ( [ $test '==' -1 ] || [ $test '==' 9 ] ); then
-if ( [ $test '==' 9 ] ); then
+#if ( [ $test '==' -1 ] || [ $test '==' 10 ] ); then
+if ( [ $test '==' 10 ] ); then
  if [ "$cluster" = "-cluster" ]; then
   echo "***"
   echo "*** Executing TmSync cluster test (subtest 7 disabled until it's fixed)"
   echo "***"
+Cleanup
 shell <<eof
  startup
+ delay 3
  exec {nowait, nid 0, name \$CTRLR, out $TRAF_HOME/monitor/test/tmSync.lst} tmSyncCtrl -n 1,3,4,5,6 $trace
  wait $CTRLR
+ delay 3
+ ps
+ !shutdown
+ exit
+eof
+if ( [ $test '==' -1 ] ); then
+shell <<eof
  shutdown
  exit
 eof
-  sleep 1
+fi
+  sleep 5
   cstat -h
   pdsh $MY_NODES grep PASSED $PWD/tmSync.lst
   pdsh $MY_NODES grep FAILED $PWD/tmSync.lst
   echo "***"
   echo "*** Executing TmSync cluster test 10"
   echo "***"
+Cleanup
 shell <<eof
  startup
+ delay 3
  exec {nowait, nid 0, name \$CTRLR, out $TRAF_HOME/monitor/test/tmSync8.lst} tmSyncCtrl -n 8 $trace
  wait $CTRLR
+ delay 3
+ ps
+ !shutdown
+ exit
+eof
+if ( [ $test '==' -1 ] ); then
+shell <<eof
  shutdown
  exit
 eof
-  sleep 1
+fi
+  sleep 5
   cstat -h
   pdsh $MY_NODES grep PASSED $PWD/tmSync9.lst
   pdsh $MY_NODES grep FAILED $PWD/tmSync9.lst
   echo "***"
   echo "*** Executing TmSync cluster test 10"
   echo "***"
+Cleanup
 shell <<eof
  startup
+ delay 3
  down 2 !
  delay 15
  exec {nowait, nid 0, name \$CTRLR, out $TRAF_HOME/monitor/test/tmSync10.lst} tmSyncCtrl -n 10 $trace
  wait $CTRLR
+ delay 3
+ ps
+ !shutdown
+ exit
+eof
+if ( [ $test '==' -1 ] ); then
+shell <<eof
  shutdown
  exit
 eof
-  sleep 1
+fi
+  sleep 5
   cstat -h
   pdsh $MY_NODES grep PASSED $PWD/tmSync10.lst
   pdsh $MY_NODES grep FAILED $PWD/tmSync10.lst
@@ -437,19 +573,29 @@ eof
   echo "***"
   echo "*** Executing TmSync test"
   echo "***"
+Cleanup
 shell <<eof
  startup
+ delay 3
  exec {nowait, nid 0, name \$CTRLR, out $TRAF_HOME/monitor/test/tmSync.lst} tmSyncCtrl -n 3,4,5,6,7 $trace
  wait $CTRLR
+ delay 3
+ ps
+ !shutdown
+ exit
+eof
+if ( [ $test '==' -1 ] ); then
+shell <<eof
  shutdown
  exit
 eof
+fi
   # Reset SQ virtual cluster parameters
   unset SQ_VIRTUAL_NODES
   unset SQ_VIRTUAL_NID
  fi
  
- sleep 1
+ sleep 5
  cstat -h
  if [ "$cluster" = "-cluster" ]; then
      pdsh $MY_NODES grep PASSED $PWD/tmSync.lst
@@ -473,12 +619,12 @@ if ( [ $test '==' -1 ] ); then
      pdsh $MY_NODES grep FAILED $PWD/regTest.lst
      pdsh $MY_NODES grep PASSED $PWD/deathNotice.lst
      pdsh $MY_NODES grep FAILED $PWD/deathNotice.lst
-     pdsh $MY_NODES grep PASSED $PWD/persistentProc.lst
-     pdsh $MY_NODES grep FAILED $PWD/persistentProc.lst
-     pdsh $MY_NODES grep PASSED $PWD/dtmTest.lst
-     pdsh $MY_NODES grep FAILED $PWD/dtmTest.lst
-     pdsh $MY_NODES grep PASSED $PWD/spxTest.lst
-     pdsh $MY_NODES grep FAILED $PWD/spxTest.lst
+#     pdsh $MY_NODES grep PASSED $PWD/persistentProc.lst
+#     pdsh $MY_NODES grep FAILED $PWD/persistentProc.lst
+#     pdsh $MY_NODES grep PASSED $PWD/dtmTest.lst
+#     pdsh $MY_NODES grep FAILED $PWD/dtmTest.lst
+#     pdsh $MY_NODES grep PASSED $PWD/spxTest.lst
+#     pdsh $MY_NODES grep FAILED $PWD/spxTest.lst
      pdsh $MY_NODES grep PASSED $PWD/procCreate.lst
      pdsh $MY_NODES grep FAILED $PWD/procCreate.lst
      pdsh $MY_NODES grep PASSED $PWD/nodeDown.lst
@@ -498,12 +644,12 @@ if ( [ $test '==' -1 ] ); then
      grep FAILED $PWD/regTest.lst
      grep PASSED $PWD/deathNotice.lst
      grep FAILED $PWD/deathNotice.lst
-     grep PASSED $PWD/persistentProc.lst
-     grep FAILED $PWD/persistentProc.lst
-     grep PASSED $PWD/dtmTest.lst
-     grep FAILED $PWD/dtmTest.lst
-     grep PASSED $PWD/spxTest.lst
-     grep FAILED $PWD/spxTest.lst
+#     grep PASSED $PWD/persistentProc.lst
+#     grep FAILED $PWD/persistentProc.lst
+#     grep PASSED $PWD/dtmTest.lst
+#     grep FAILED $PWD/dtmTest.lst
+#     grep PASSED $PWD/spxTest.lst
+#     grep FAILED $PWD/spxTest.lst
      grep PASSED $PWD/procCreate.lst
      grep FAILED $PWD/procCreate.lst
      grep PASSED $PWD/nodeDown.lst

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/test/sqconfig.monitor.virtual
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/test/sqconfig.monitor.virtual b/core/sqf/monitor/test/sqconfig.monitor.virtual
index f589944..8f6750c 100644
--- a/core/sqf/monitor/test/sqconfig.monitor.virtual
+++ b/core/sqf/monitor/test/sqconfig.monitor.virtual
@@ -24,5 +24,6 @@ _virtualnodes 6
 end node
 
 begin name-server
-nodes=0,1
+nodes=0
+#nodes=0,1,2,3,4,5
 end name-server

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/sqenvcom.sh
----------------------------------------------------------------------
diff --git a/core/sqf/sqenvcom.sh b/core/sqf/sqenvcom.sh
index d2713b6..b8f425c 100644
--- a/core/sqf/sqenvcom.sh
+++ b/core/sqf/sqenvcom.sh
@@ -686,16 +686,18 @@ export SQ_STARTUP=r
 #
 # Uncomment the next three environment variables
 #export SQ_MON_RUN_MODE=AGENT
-#export MONITOR_COMM_PORT=23399
-#export MONITOR_SYNC_PORT=23398
+#export MONITOR_COMM_PORT=23390
+#export MONITOR_SYNC_PORT=23380
 #
 #   NAME-SERVER - to disable process replication and enable name-server
 #
-# Uncomment the next four environment variables
-#export NAMESERVER_ENABLE=1
-#export NS_COMM_PORT=23389
-#export NS_SYNC_PORT=23388
-#export NS_M2N_COMM_PORT=23379
+# Uncomment the next six environment variables
+#export SQ_NAMESERVER_ENABLE=1
+#export NS_COMM_PORT=23370
+#export NS_SYNC_PORT=23360
+#export NS_M2N_COMM_PORT=23350
+#export MON2MON_COMM_PORT=23340
+#export MONITOR_COMM_PORT=23330
 
 # Alternative logging capability in monitor
 export SQ_MON_ALTLOG=0

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/sql/scripts/monitor.env
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/monitor.env b/core/sqf/sql/scripts/monitor.env
index bbf1ade..fc10c1f 100644
--- a/core/sqf/sql/scripts/monitor.env
+++ b/core/sqf/sql/scripts/monitor.env
@@ -21,20 +21,21 @@
 
 # Uncomment MON_TRACE_ENABLE and specific tracing level to enable 
 # Trafodion monitor process tracing
-#MON_TRACE_ENABLE=1
-#MON_TRACE_EVLOG_MSG=1
-#MON_TRACE_INIT=1
-#MON_TRACE_RECOVERY=1
-#MON_TRACE_REQUEST=1
-#MON_TRACE_PROCESS=1
-#MON_TRACE_NOTICE=1
+MON_TRACE_ENABLE=1
+MON_TRACE_EVLOG_MSG=1
+MON_TRACE_INIT=1
+MON_TRACE_RECOVERY=1
+MON_TRACE_REQUEST=1
+MON_TRACE_PROCESS=1
+MON_TRACE_NOTICE=1
+MON_TRACE_NS=1
 #MON_TRACE_SYNC=1
 # Enable TC_TRACE_* along with MON_TRACE_TRAFCONFIG for more detail
 #MON_TRACE_TRAFCONFIG=1
 #MON_TRACE_MLIO=1
 
-#MON_TRACE_REQUEST_DETAIL=1
-#MON_TRACE_PROCESS_DETAIL=1
+MON_TRACE_REQUEST_DETAIL=1
+MON_TRACE_PROCESS_DETAIL=1
 #MON_TRACE_NOTICE_DETAIL=1
 #MON_TRACE_SYNC_DETAIL=1
 #MON_TRACE_MLIO_DETAIL=1

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/sql/scripts/pstat
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/pstat b/core/sqf/sql/scripts/pstat
index 95daa3c..fe18a1b 100755
--- a/core/sqf/sql/scripts/pstat
+++ b/core/sqf/sql/scripts/pstat
@@ -51,7 +51,7 @@ process_metrics,pstartd,qpidd,qscom,qsmgr,qsmgr2,qsoffndr,qsrecev,\
 qsrule,qssend,qsstats,qssync,se_metrics_aaa_delta,serevive,shell,\
 snmp_protocol_adapter,sp_proxy,sp_wrapper,spqpid_p,sqcheck,sqlci,sqregck,\
 sqstart,ssd_lun_metric_publish,ssd_lun_state_publish,ssd_metric_publish,\
-ssd_state_publish,tdm_arkcmp,tdm_arkesp,tdm_sqlc,tdm_udrserv,\
+ssd_state_publish,tdm_arkcmp,tdm_arkesp,tdm_sqlc,tdm_udrserv,trafns,\
 textprotocoladapter,timer_pop_generator,tm,tmshutdown,universal_action_agent,\
 universal_consumer,volrcov
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/sql/scripts/sqconfig
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqconfig b/core/sqf/sql/scripts/sqconfig
index 9d85ba6..a753549 100644
--- a/core/sqf/sql/scripts/sqconfig
+++ b/core/sqf/sql/scripts/sqconfig
@@ -23,6 +23,10 @@ begin node
 _virtualnodes 2
 end node
 
+#begin name-server
+#nodes=0,1
+#end name-server
+
 ###############################################################################
 #
 # Overflow directories for ssd and hdd. 


[45/50] [abbrv] trafodion git commit: Increased cluster size limit to 1536 nodes.

Posted by su...@apache.org.
Increased cluster size limit to 1536 nodes.


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

Branch: refs/heads/master
Commit: 4d05071b4828d071a7319e32c3235415217c6507
Parents: 1b228a9
Author: Zalo Correa <za...@esgyn.com>
Authored: Mon Jun 4 11:57:45 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Mon Jun 4 11:57:45 2018 -0700

----------------------------------------------------------------------
 core/sqf/export/include/trafconf/trafconfig.h | 2 +-
 core/sqf/sql/scripts/sqnodes.pm               | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/4d05071b/core/sqf/export/include/trafconf/trafconfig.h
----------------------------------------------------------------------
diff --git a/core/sqf/export/include/trafconf/trafconfig.h b/core/sqf/export/include/trafconf/trafconfig.h
index 4661840..7888910 100644
--- a/core/sqf/export/include/trafconf/trafconfig.h
+++ b/core/sqf/export/include/trafconf/trafconfig.h
@@ -50,7 +50,7 @@
 #define TC_PERSIST_KEY_MAX              64
 #define TC_PERSIST_VALUE_MAX          4096
 #define TC_PERSIST_KEYS_VALUE_MAX     4096
-#define TC_NODES_MAX                  1024 // This can be higher when needed and
+#define TC_NODES_MAX                  1536 // This can be higher when needed and
                                            // will have performance implications
                                            // in the monitor process.
                                            // NOTE: Must increment by 64, see

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4d05071b/core/sqf/sql/scripts/sqnodes.pm
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqnodes.pm b/core/sqf/sql/scripts/sqnodes.pm
index 0d09565..c0dc0fa 100644
--- a/core/sqf/sql/scripts/sqnodes.pm
+++ b/core/sqf/sql/scripts/sqnodes.pm
@@ -279,10 +279,10 @@ sub verifyParse
             displayStmt($stmtOk);
             print "   Error: node-id not specified\n";
         }
-        elsif ($nodeId > 1023)
+        elsif ($nodeId > 1535)
         {
             displayStmt($stmtOk);
-            print "   Error: node-id must be in the range 0..1023.\n";
+            print "   Error: node-id must be in the range 0..1535.\n";
         }
         if (@cores == 0)
         {


[42/50] [abbrv] trafodion git commit: Fixes to Name Server enabled logic.

Posted by su...@apache.org.
Fixes to Name Server enabled logic.


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

Branch: refs/heads/master
Commit: cd4f700621ab9d13ea7e39baef0e989714a34b0b
Parents: 65ac556
Author: Zalo Correa <za...@esgyn.com>
Authored: Mon Jun 4 07:34:37 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Mon Jun 4 07:34:37 2018 -0700

----------------------------------------------------------------------
 .../export/include/common/evl_sqlog_eventnum.h  |   1 -
 core/sqf/monitor/linux/cluster.cxx              |  99 +++--
 core/sqf/monitor/linux/cluster.h                |   5 +-
 core/sqf/monitor/linux/config.cxx               | 390 +++++++++++++++++++
 core/sqf/monitor/linux/config.h                 |  25 +-
 core/sqf/monitor/linux/localio.h                |   4 +-
 core/sqf/monitor/linux/monitor.cxx              |   5 +
 core/sqf/monitor/linux/reqget.cxx               |   2 +-
 core/sqf/monitor/linux/reqnewproc.cxx           |   2 +-
 core/sqf/monitor/linux/reqqueue.cxx             |  13 +
 core/sqf/monitor/linux/shell.cxx                | 152 +++++++-
 core/sqf/sql/scripts/gensq.pl                   |  25 ++
 core/sqf/sql/scripts/gomon.cold                 | 108 +++--
 core/sqf/sql/scripts/sqconfigdb.pm              |  20 +
 core/sqf/sql/scripts/sqgen                      | 211 +++++-----
 core/sqf/sql/scripts/sqstart                    | 207 +++++-----
 core/sqf/sql/scripts/sqstop                     |  36 +-
 core/sqf/src/trafconf/Makefile                  |   2 +-
 core/sqf/src/trafconf/clusterconf.cpp           |  43 ++
 core/sqf/src/trafconf/tctrace.h                 |   2 +-
 20 files changed, 1041 insertions(+), 311 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/cd4f7006/core/sqf/export/include/common/evl_sqlog_eventnum.h
----------------------------------------------------------------------
diff --git a/core/sqf/export/include/common/evl_sqlog_eventnum.h b/core/sqf/export/include/common/evl_sqlog_eventnum.h
index de3e60e..8930ccc 100644
--- a/core/sqf/export/include/common/evl_sqlog_eventnum.h
+++ b/core/sqf/export/include/common/evl_sqlog_eventnum.h
@@ -253,7 +253,6 @@
 #define MON_CLUSTER_ASSIGNMONITORLEADER_2   101015302
 #define MON_CLUSTER_ASSIGNMONITORLEADER_3   101015303
 #define MON_CLUSTER_ASSIGNMONITORLEADER_4   101015304
-
 #define MON_CLUSTER_CHECKIFDONE_1           101015401
 
 /* Module: monitor.cxx = 02 */

http://git-wip-us.apache.org/repos/asf/trafodion/blob/cd4f7006/core/sqf/monitor/linux/cluster.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/cluster.cxx b/core/sqf/monitor/linux/cluster.cxx
index 69647ec..8bf47c3 100644
--- a/core/sqf/monitor/linux/cluster.cxx
+++ b/core/sqf/monitor/linux/cluster.cxx
@@ -877,10 +877,11 @@ CCluster::CCluster (void)
     char *env = getenv("SQ_MON_CHECK_SEQNUM");
     if ( env )
     {
-        int val;
-        errno = 0;
-        val = strtol(env, NULL, 10);
-        if ( errno == 0) checkSeqNum_ = (val != 0);
+        int val = atoi(env);
+        if ( val > 0)
+        {
+            checkSeqNum_ = (val != 0);
+        }
     }
 
     if (trace_settings & TRACE_INIT)
@@ -934,10 +935,11 @@ CCluster::CCluster (void)
     env = getenv("SQ_MON_NODE_DOWN_VALIDATION");
     if ( env )
     {
-        int val;
-        errno = 0;
-        val = strtol(env, NULL, 10);
-        if ( errno == 0) validateNodeDown_ = (val != 0);
+        int val = atoi(env);
+        if ( val > 0)
+        {
+            validateNodeDown_ = (val != 0);
+        }
     }
 
     char buf[MON_STRING_BUF_SIZE];
@@ -1244,9 +1246,14 @@ void CCluster::HardNodeDown (int pnid, bool communicate_state)
     }
 #endif
 
+#ifndef NAMESERVER_PROCESS
     if ( Emulate_Down )
     {
-        IAmIntegrated = false;
+        AssignTmLeader(pnid, false);
+    }
+    else
+#endif
+    {
         AssignLeaders(pnid, node->GetName(), false);
     }
 
@@ -1351,7 +1358,6 @@ void CCluster::SoftNodeDown( int pnid )
                     , node->IsSoftNodeDown());
     }
 
-    IAmIntegrated = false;
     AssignLeaders(pnid, node->GetName(), false);
 
     TRACE_EXIT;
@@ -2625,7 +2631,7 @@ void CCluster::HandleOtherNodeMsg (struct internal_msg_def *recv_msg,
                      "pid=%d for stdin data request.\n", method_name,
                      recv_msg->u.stdin_req.nid,
                      recv_msg->u.stdin_req.pid);
-            mon_log_write(MON_CLUSTER_HANDLEOTHERNODE_9, SQ_LOG_ERR, buf);
+            mon_log_write(MON_CLUSTER_HANDLEOTHERNODE_9, SQ_LOG_INFO, buf);
         }
         break;
 #endif
@@ -8752,6 +8758,7 @@ void CCluster::InitServerSock( void )
 #else
     int ptpPort = 0;
 #endif
+    int val = 0;
 
     unsigned char addr[4];
     struct hostent *he;
@@ -8777,12 +8784,22 @@ void CCluster::InitServerSock( void )
 #endif
     if ( env )
     {
-        int val;
-        errno = 0;
-        val = strtol(env, NULL, 10);
-        if ( !IsRealCluster )
-            val += MyPNID;
-        if ( errno == 0) serverCommPort = val;
+        val = atoi(env);
+        if ( val > 0)
+        {
+            if ( !IsRealCluster )
+            {
+                val += MyPNID;
+            }
+            serverCommPort = val;
+        }
+    }
+
+    if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+    {
+        trace_printf( "%s@%d COMM_PORT Node_name=%s, env=%s, serverCommPort=%d, val=%d\n"
+                    , method_name, __LINE__
+                    , Node_name, env, serverCommPort, val );
     }
 
     commSock_ = MkSrvSock( &serverCommPort );
@@ -8829,14 +8846,24 @@ void CCluster::InitServerSock( void )
 #endif
     if ( env )
     {
-        int val;
-        errno = 0;
-        val = strtol(env, NULL, 10);
-        if ( errno == 0 ) syncPort_ = val;
-        if ( !IsRealCluster )
-            val += MyPNID;
-        if ( errno == 0) serverSyncPort = val;
+        val = atoi(env);
+        if ( val > 0)
+        {
+            if ( !IsRealCluster )
+            {
+                val += MyPNID;
+            }
+            syncPort_ = serverSyncPort = val;
+        }
+    }
+
+    if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+    {
+        trace_printf( "%s@%d SYNC_PORT Node_name=%s, env=%s, serverSyncPort=%d, val=%d\n"
+                    , method_name, __LINE__
+                    , Node_name, env, syncPort_, val );
     }
+
     syncSock_ = MkSrvSock( &serverSyncPort );
     if ( syncSock_ < 0 )
     {
@@ -8877,12 +8904,15 @@ void CCluster::InitServerSock( void )
     env = getenv("NS_M2N_COMM_PORT");
     if ( env )
     {
-        int val;
-        errno = 0;
-        val = strtol(env, NULL, 10);
-        if ( !IsRealCluster )
-            val += MyPNID;
-        if ( errno == 0) mon2nsPort = val;
+        val = atoi(env);
+        if ( val > 0)
+        {
+            if ( !IsRealCluster )
+            {
+                val += MyPNID;
+            }
+            mon2nsPort = val;
+        }
     }
 
     mon2nsSock_ = MkSrvSock( &mon2nsPort );
@@ -8924,10 +8954,11 @@ void CCluster::InitServerSock( void )
         env = getenv("MON2MON_COMM_PORT");
         if ( env )
         {
-            int val;
-            errno = 0;
-            val = strtol(env, NULL, 10);
-            if ( errno == 0) ptpPort = val;
+            val = atoi(env);
+            if ( val > 0)
+            {
+                ptpPort = val;
+            }
         }
         else
         {

http://git-wip-us.apache.org/repos/asf/trafodion/blob/cd4f7006/core/sqf/monitor/linux/cluster.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/cluster.h b/core/sqf/monitor/linux/cluster.h
index 1d7e1ac..970cf4c 100644
--- a/core/sqf/monitor/linux/cluster.h
+++ b/core/sqf/monitor/linux/cluster.h
@@ -227,7 +227,10 @@ public:
         long fullSize_;
         long compressedSize_;
         long tmLeader_;
-        unsigned long long seqNum_; 
+        long clusterRegistryCount_;
+        long processRegistryCount_;
+        long uniqueStringCount_;
+        unsigned long long seqNum_;
     } snapShotHeader_t; 
 
     enum { ACCEPT_NEW_MONITOR_RETRIES = 120 };  // Maximum retries by creator monitor

http://git-wip-us.apache.org/repos/asf/trafodion/blob/cd4f7006/core/sqf/monitor/linux/config.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/config.cxx b/core/sqf/monitor/linux/config.cxx
index c757e25..4ef9b72 100644
--- a/core/sqf/monitor/linux/config.cxx
+++ b/core/sqf/monitor/linux/config.cxx
@@ -51,6 +51,7 @@ extern CMonStats *MonStats;
 extern CMonTrace *MonTrace;
 extern CMonLog *MonLog;
 extern CReplicate Replicator;
+extern CMonitor *Monitor;
 
 extern char *ErrorMsg (int error_code);
 
@@ -997,3 +998,392 @@ void CConfigContainer::strIdToString( strId_t stringId,  string & value )
 
     TRACE_EXIT;
 }
+
+int CConfigContainer::getRegistrySize()
+{
+    const char method_name[] = "CConfigContainer::getRegistrySize";
+    TRACE_ENTRY;
+    
+    int regClusterCount = 0;
+    int regProcessCount = 0;
+    int regClusterMax = 0;
+    int regCount = 0;
+    int regSize = 0;
+    
+    int rc = tc_get_registry_cluster_set( &regClusterCount
+                                    , regClusterMax
+                                    , NULL );
+    if ( rc )
+    {
+          char la_buf[MON_STRING_BUF_SIZE];
+          snprintf( la_buf, sizeof(la_buf)
+            , "[%s] Cluster scope configuration registry access failed!\n"
+            , method_name );
+          mon_log_write(MON_CONFIGCONT_INIT_2, SQ_LOG_CRIT, la_buf);
+          TRACE_EXIT;
+          return 0;
+     }
+     
+     regCount = regClusterCount;
+     
+     regClusterMax = 0;
+     
+     rc = tc_get_registry_process_set( &regClusterCount
+                                    , regClusterMax
+                                    , NULL );
+     if ( rc )
+     {
+          char la_buf[MON_STRING_BUF_SIZE];
+          snprintf( la_buf, sizeof(la_buf)
+            , "[%s] Cluster scope configuration registry access failed!\n"
+            , method_name );
+          mon_log_write(MON_CONFIGCONT_INIT_2, SQ_LOG_CRIT, la_buf);
+          TRACE_EXIT;
+          return 0;
+      }
+      
+      regCount += regProcessCount;
+      regCount += 10; // just to be safe
+      
+      // cluster_set -> regCount of these
+      // int
+      // int`
+      // int 
+      // int
+      // variable length : [Scope, Key, Value] 
+      
+      regSize = regCount * sizeof (cluster_set); // accounts fore verything but the variable data;
+      regSize = regSize + (regCount*(TC_REGISTRY_KEY_MAX + TC_REGISTRY_KEY_MAX + TC_REGISTRY_VALUE_MAX));
+         
+      TRACE_EXIT;  
+      return regSize;
+}
+
+int CConfigContainer::getUniqueStringsSize() 
+{
+    const char method_name[] = "CConfigContainer::getUniqueStringsSize";
+    TRACE_ENTRY;
+    int maxUniqueId = 0;
+    int totalUniqueIds = 0;
+    int uniqueIdSize = 0;
+    
+    for (int pnid = 0; pnid < Monitor->GetConfigPNodesMax(); pnid++)
+    {
+        tc_get_unique_string_id_max (pnid, &maxUniqueId);
+        totalUniqueIds += maxUniqueId;
+    }
+    
+    totalUniqueIds += 5; // just to be safe
+    uniqueIdSize = totalUniqueIds * sizeof(unique_string_set);
+    uniqueIdSize = uniqueIdSize + (totalUniqueIds*TC_UNIQUE_STRING_VALUE_MAX);
+    
+    TRACE_EXIT;  
+    return uniqueIdSize;
+}
+    
+int CConfigContainer::PackRegistry( char *&buffer, ConfigType type )
+{
+    const char method_name[] = "CConfigContainer::PackRegistry";
+    TRACE_ENTRY;
+    int rc;
+    int regClusterCount = 0;
+    int regClusterMax = 0;
+    TcRegistryConfiguration_t *regClusterConfig = NULL;
+    char *bufPtr = buffer;    
+    
+    struct cluster_set *clusterObj = (struct cluster_set *)bufPtr;
+    char *stringData = &clusterObj->stringData;
+
+    int stringDataLen = 0;
+    int numberOfEntries = 0;
+    
+    switch (type)
+    {
+      case ConfigType_Cluster:
+      {
+          // Get cluster scope configuration registry entries count
+          rc = tc_get_registry_cluster_set( &regClusterCount
+                                    , regClusterMax
+                                    , NULL );
+          if ( rc )
+          {
+              char la_buf[MON_STRING_BUF_SIZE];
+              snprintf( la_buf, sizeof(la_buf)
+                , "[%s] Cluster scope configuration registry access failed!\n"
+                , method_name );
+              mon_log_write(MON_CONFIGCONT_INIT_2, SQ_LOG_CRIT, la_buf);
+              TRACE_EXIT;
+              return 0;
+          }
+    
+          regClusterMax = regClusterCount;
+          regClusterConfig = new TcRegistryConfiguration_t[regClusterMax];
+          rc = tc_get_registry_cluster_set( &regClusterCount
+                                              , regClusterMax
+                                              , regClusterConfig );
+          if ( rc )
+          {
+              char la_buf[MON_STRING_BUF_SIZE];
+              snprintf( la_buf, sizeof(la_buf)
+                    , "[%s] Cluster scope configuration registry access failed!\n"
+                    , method_name );
+              mon_log_write(MON_CONFIGCONT_INIT_2, SQ_LOG_CRIT, la_buf);
+              TRACE_EXIT;
+              return 0;
+          } 
+          break;
+      }
+      
+      case ConfigType_Process:
+      {
+          // Get cluster scope configuration registry entries count
+          rc = tc_get_registry_process_set( &regClusterCount
+                                    , regClusterMax
+                                    , NULL );
+          if ( rc )
+          {
+              char la_buf[MON_STRING_BUF_SIZE];
+              snprintf( la_buf, sizeof(la_buf)
+                , "[%s] Cluster scope configuration registry access failed!\n"
+                , method_name );
+              mon_log_write(MON_CONFIGCONT_INIT_2, SQ_LOG_CRIT, la_buf);
+              TRACE_EXIT;
+              return 0;
+          }
+    
+          regClusterMax = regClusterCount;
+          regClusterConfig = new TcRegistryConfiguration_t[regClusterMax];
+          rc = tc_get_registry_process_set( &regClusterCount
+                                        , regClusterMax
+                                        , regClusterConfig );
+          if ( rc )
+          {
+              char la_buf[MON_STRING_BUF_SIZE];
+              snprintf( la_buf, sizeof(la_buf)
+                    , "[%s] Cluster scope configuration registry access failed!\n"
+                    , method_name );
+              mon_log_write(MON_CONFIGCONT_INIT_2, SQ_LOG_CRIT, la_buf);
+              TRACE_EXIT;
+              return 0;
+          }
+          break;
+       }
+      default:
+      {
+           // programming error
+          char la_buf[MON_STRING_BUF_SIZE];
+          snprintf( la_buf, sizeof(la_buf)
+                    , "[%s]Rregistry access failed!\n"
+                    , method_name );
+          mon_log_write(MON_CONFIGCONT_INIT_2, SQ_LOG_CRIT, la_buf);
+          TRACE_EXIT;
+          return 0;
+          break;
+      }
+    }
+    
+    // Process cluster scope configuration registry entries
+    cluster_set *regClusterEntry = clusterObj;
+    for (int i = 0; i < regClusterCount; i++ )
+    {
+        regClusterEntry->type = type;
+
+        regClusterEntry->scopeLength = strlen (regClusterConfig[i].scope);
+        regClusterEntry->keyLength = strlen (regClusterConfig[i].key);
+        regClusterEntry->valueLength = strlen (regClusterConfig[i].value);
+        if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
+        {
+            trace_printf ("%s%d pack type %d, scope %s (%d), key %s (%d), value %s(%d)\n",method_name, __LINE__,
+                           regClusterEntry->type, regClusterConfig[i].scope, 
+                           regClusterEntry->scopeLength,regClusterConfig[i].key,regClusterEntry->keyLength,  
+                           regClusterConfig[i].value, regClusterEntry->valueLength);
+        }
+     
+        memcpy(stringData, regClusterConfig[i].scope,  regClusterEntry->scopeLength);
+        stringData += regClusterEntry->scopeLength;
+        stringDataLen += regClusterEntry->scopeLength;
+
+        memcpy(stringData, regClusterConfig[i].key,  regClusterEntry->keyLength);
+        stringData += regClusterEntry->keyLength;
+        stringDataLen += regClusterEntry->keyLength;
+
+        memcpy(stringData, regClusterConfig[i].value,  regClusterEntry->valueLength);
+        stringData += regClusterEntry->valueLength;
+        stringDataLen += regClusterEntry->valueLength;
+        ++numberOfEntries;
+
+        if ((i+1) < regClusterCount)
+        {
+            regClusterEntry = (cluster_set *)stringData;
+            stringData = &regClusterEntry->stringData;
+        }
+    }    
+
+    if (numberOfEntries > 0)
+    {
+        buffer = stringData;
+    }
+    
+    if (regClusterConfig)
+    {
+         delete regClusterConfig; 
+    }
+    return numberOfEntries;
+    
+    TRACE_EXIT;
+}
+
+void CConfigContainer::UnpackRegistry( char *&buffer, int count )
+{
+     const char method_name[] = "CConfigContainer::UnpackRegistry";
+     TRACE_ENTRY;
+
+     ConfigType type;
+     char myScope[TC_REGISTRY_KEY_MAX];
+     char myValue [TC_REGISTRY_VALUE_MAX];
+     char myKey[TC_REGISTRY_KEY_MAX];
+
+     if (count <= 0)
+     {
+         TRACE_EXIT;
+         return;
+     }
+     struct cluster_set *clusterObj2 =  (cluster_set *)buffer;
+     char *stringData2 = &clusterObj2->stringData;
+     for (int i = 0; i < count; i++ )
+     {     
+        memset (myScope, '\0', sizeof (myScope));
+        memset (myValue, '\0', sizeof (myValue));
+        memset (myKey, '\0', sizeof (myKey));
+
+        if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
+        {
+            trace_printf ("%s%d scope length %d, key length %d, value length %d\n", method_name, __LINE__,
+                          clusterObj2->scopeLength, 
+                          clusterObj2->keyLength, clusterObj2->valueLength);
+        }
+        type = clusterObj2->type;
+
+        memcpy(myScope, stringData2,  clusterObj2->scopeLength);
+        stringData2 += clusterObj2->scopeLength;
+
+        memcpy(myKey, stringData2,  clusterObj2->keyLength);
+        stringData2 += clusterObj2->keyLength;
+
+        memcpy(myValue, stringData2,  clusterObj2->valueLength);
+        stringData2 += clusterObj2->valueLength;
+
+        if ((i+1) < count)
+        {
+            clusterObj2 = (cluster_set *)stringData2;
+            stringData2 = &clusterObj2->stringData;
+        }
+    } 
+    
+    Set( myScope
+       , type
+       , myValue
+       , myKey
+       , false );
+    
+    buffer = stringData2;
+    TRACE_EXIT; 
+}
+
+int CConfigContainer::PackUniqueStrings( char *&buffer )
+{
+    const char method_name[] = "CConfigContainer::PackUniqueStrings";
+    TRACE_ENTRY;
+    int maxUniqueId = 0;
+    char unique_string[TC_UNIQUE_STRING_VALUE_MAX] = { 0 };
+    int  stringDataLen;
+    char *bufPtr = buffer;
+
+    struct unique_string_set *stringObj = (struct unique_string_set *)bufPtr;
+    char *stringData = &stringObj->stringData;
+    int numberOfEntries = 0;
+
+    for (int pnid = 0; pnid < Monitor->GetConfigPNodesMax(); pnid++)
+    {
+        tc_get_unique_string_id_max (pnid, &maxUniqueId);
+
+        for (int maxId = 0; maxId <= maxUniqueId; maxId++)
+        {
+             memset (unique_string, 0, TC_UNIQUE_STRING_VALUE_MAX);
+             int error = tc_get_unique_string( pnid, maxId, unique_string );
+
+             if (!error)
+             {
+                 stringObj->stringLength = strlen(unique_string);
+                 if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
+                 {
+                      trace_printf ("%s%d  packing nid %d, unique id %d, stringt %s (length %d)\n", method_name, __LINE__,
+                                     pnid, maxId, unique_string,stringObj->stringLength );
+                 } 
+                 stringObj->unique_id = maxId;
+                 stringObj->nid = pnid;
+                 memcpy (stringData, unique_string, stringObj->stringLength);
+                 stringDataLen+= stringObj->stringLength;
+                 stringData+=stringObj->stringLength;
+                 ++numberOfEntries;
+                 if ((pnid + 1) < Monitor->GetConfigPNodesMax())
+                 {
+                      stringObj = ( unique_string_set *)stringData;
+                      stringData = &stringObj->stringData;
+                 }
+             }
+             // don't advance if we didn't write anything
+        }
+
+    }
+    
+    if (numberOfEntries > 0)
+    {
+        buffer = stringData;    
+    }
+
+    TRACE_EXIT;  
+    return numberOfEntries;
+}
+
+void CConfigContainer::UnpackUniqueStrings( char *&buffer, int entries )
+{
+    const char method_name[] = "CConfigContainer::UnpackUniqueStrings";
+    TRACE_ENTRY;
+    
+    if (entries <= 0)
+    { 
+         TRACE_EXIT;
+         return;
+    }
+     
+    struct unique_string_set *stringObj =  (unique_string_set *)buffer;
+    char *stringData = &stringObj->stringData;
+    char unique_string[TC_UNIQUE_STRING_VALUE_MAX] = { 0 };
+    
+    for (int i = 0; i < entries; i++)
+    {
+        if (stringObj)
+        {
+            int maxUniqueId;
+            tc_get_unique_string_id_max (stringObj->nid, &maxUniqueId);
+            memset(unique_string, 0, TC_UNIQUE_STRING_VALUE_MAX);
+            memcpy (unique_string, stringData,stringObj->stringLength);
+            if (stringObj->unique_id > maxUniqueId)
+            {
+                tc_put_unique_string( stringObj->nid, stringObj->unique_id, unique_string );
+            }
+
+            stringData += stringObj->stringLength;
+        }
+        if ((i + 1) < entries)
+        {
+             stringObj = (unique_string_set *)stringData;
+             stringData = &stringObj->stringData;
+        }
+    }
+
+    buffer = stringData;
+    TRACE_EXIT;  
+}
+   

http://git-wip-us.apache.org/repos/asf/trafodion/blob/cd4f7006/core/sqf/monitor/linux/config.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/config.h b/core/sqf/monitor/linux/config.h
index ea606de..80b1089 100644
--- a/core/sqf/monitor/linux/config.h
+++ b/core/sqf/monitor/linux/config.h
@@ -34,6 +34,23 @@
 
 class CConfigGroup;
 
+struct cluster_set
+{
+   ConfigType type;
+   int scopeLength;
+   int keyLength;
+   int valueLength;
+   char stringData;
+};
+
+struct unique_string_set
+{
+   int nid;
+   int unique_id;
+   int stringLength;
+   char stringData;
+};
+
 class CConfigKey
 {
  private:
@@ -127,7 +144,13 @@ public:
     int  getMaxUniqueId( int nid );
     void strIdToString ( strId_t stringId, string & value );
 
-   
+    int    PackRegistry( char *&buffer, ConfigType type );
+    void   UnpackRegistry( char *&buffer, int length );    
+    int    PackUniqueStrings( char *&buffer );
+    void   UnpackUniqueStrings( char *&buffer, int length );
+    int    getRegistrySize();
+    int    getUniqueStringsSize();
+
 protected:
 private:
     CConfigGroup *cluster_;     // predefined cluster global group 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/cd4f7006/core/sqf/monitor/linux/localio.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/localio.h b/core/sqf/monitor/linux/localio.h
index 331ac4c..bcdbae2 100644
--- a/core/sqf/monitor/linux/localio.h
+++ b/core/sqf/monitor/linux/localio.h
@@ -42,8 +42,8 @@ using namespace std;
 
 #define SQ_LIO_MAX_BUFFERS      1000 // shared buffers per node in real cluster,
                                      // SQ_LIO_MAX_BUFFERS/4 in virtual cluster
-#define SQ_LIO_SHM_PERMISSIONS  0640 // shared memory permissions
-#define SQ_LIO_MSQ_PERMISSIONS  0640 // message queue permissions
+#define SQ_LIO_SHM_PERMISSIONS  0660 // shared memory permissions
+#define SQ_LIO_MSQ_PERMISSIONS  0660 // message queue permissions
 
 #define SQ_LIO_NORMAL_MSG          1 // normal messages
 #define SQ_LIO_SIGNAL_TIMEOUT      (5000000) // 5 milliseconds (in nano seconds)

http://git-wip-us.apache.org/repos/asf/trafodion/blob/cd4f7006/core/sqf/monitor/linux/monitor.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/monitor.cxx b/core/sqf/monitor/linux/monitor.cxx
index 6757f2c..d588945 100755
--- a/core/sqf/monitor/linux/monitor.cxx
+++ b/core/sqf/monitor/linux/monitor.cxx
@@ -1559,6 +1559,11 @@ int main (int argc, char *argv[])
         strcpy (short_node_name, str1 );
     }
 
+    if (IsRealCluster) 
+    {
+      strcpy (Node_name, short_node_name );
+    }
+
 #ifdef MULTI_TRACE_FILES
     setThreadVariable( (char *)"mainThread" );
 #endif

http://git-wip-us.apache.org/repos/asf/trafodion/blob/cd4f7006/core/sqf/monitor/linux/reqget.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqget.cxx b/core/sqf/monitor/linux/reqget.cxx
index fe8bab9..d53fdf5 100644
--- a/core/sqf/monitor/linux/reqget.cxx
+++ b/core/sqf/monitor/linux/reqget.cxx
@@ -217,7 +217,7 @@ void CExtGetReq::performRequest()
             sprintf( buf, "%s@%d - Can't find group(%s).\n"
                    , method_name, __LINE__
                    , msg_->u.request.u.get.group);
-            mon_log_write(MON_MONITOR_GETCONF_3, SQ_LOG_ERR, buf);
+            mon_log_write(MON_MONITOR_GETCONF_3, SQ_LOG_INFO, buf);
              
             msg_->u.reply.type = ReplyType_Get;
             msg_->u.reply.u.get.type = ConfigType_Undefined;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/cd4f7006/core/sqf/monitor/linux/reqnewproc.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqnewproc.cxx b/core/sqf/monitor/linux/reqnewproc.cxx
index 972d785..d12ddc2 100644
--- a/core/sqf/monitor/linux/reqnewproc.cxx
+++ b/core/sqf/monitor/linux/reqnewproc.cxx
@@ -438,7 +438,7 @@ void CExtNewProcReq::performRequest()
 
             return;
         }
-    
+
         if (lnode->GetNumProcs() < MAX_PROCESSES)
         {
             strId_t pathStrId = MyNode->GetStringId ( msg_->u.request.u.new_process.path, lnode );

http://git-wip-us.apache.org/repos/asf/trafodion/blob/cd4f7006/core/sqf/monitor/linux/reqqueue.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqqueue.cxx b/core/sqf/monitor/linux/reqqueue.cxx
index c7af4ca..2238d71 100644
--- a/core/sqf/monitor/linux/reqqueue.cxx
+++ b/core/sqf/monitor/linux/reqqueue.cxx
@@ -3622,6 +3622,12 @@ void CIntReviveReq::performRequest()
     if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
         trace_printf("%s@%d - Process Objects unpacked\n", method_name, __LINE__);
 
+    Config->UnpackRegistry(buffer, (header.clusterRegistryCount_ + header.processRegistryCount_));
+    Config->UnpackUniqueStrings(buffer, header.uniqueStringCount_);
+    
+    if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
+        trace_printf("%s@%d - Registry unpacked\n", method_name, __LINE__);
+       
     mem_log_write(MON_REQQUEUE_REVIVE_5);
 
     // process the requests that were deferred to the revive side queue.
@@ -3724,6 +3730,9 @@ void CIntSnapshotReq::performRequest()
     int idsSize = Nodes->GetSNodesCount() * sizeof(int); // spare pnids
     idsSize += (Nodes->GetPNodesCount() + Nodes->GetLNodesCount()) * sizeof(int); // pnid/nid map
     idsSize += Nodes->GetPNodesCount() * 2 * sizeof(int);    // pnid/zid
+    idsSize += Nodes->GetLNodesCount() * sizeof(int);    // nids
+    idsSize += Config->getUniqueStringsSize();
+    idsSize += Config->getRegistrySize();
 
     if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
         trace_printf("%s@%d - Snapshot sizes, procSize = %d, idsSize = %d\n",
@@ -3768,6 +3777,10 @@ void CIntSnapshotReq::performRequest()
     // pack process objects
     header.procCount_ = Monitor->PackProcObjs(buf);
 
+    header.clusterRegistryCount_ =  Config->PackRegistry(buf, ConfigType_Cluster);
+    header.processRegistryCount_ =  Config->PackRegistry(buf, ConfigType_Process);
+    header.uniqueStringCount_   =  Config->PackUniqueStrings(buf);
+    
     mem_log_write(MON_REQQUEUE_SNAPSHOT_6, header.nodeMapCount_, header.procCount_);
 
     header.fullSize_ = buf - snapshotBuf;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/cd4f7006/core/sqf/monitor/linux/shell.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/shell.cxx b/core/sqf/monitor/linux/shell.cxx
index 51206d3..6c5f14b 100644
--- a/core/sqf/monitor/linux/shell.cxx
+++ b/core/sqf/monitor/linux/shell.cxx
@@ -390,6 +390,154 @@ char *ErrorMsg (int error_code)
     return buffer;
 }
 
+bool check_environment( void )
+{
+    bool  rs = true;
+    bool  isNameServerEnabled = false;
+    char* env;
+    char  msgString[MAX_BUFFER] = { 0 };
+    int   val = 0;
+
+    env = getenv("MONITOR_COMM_PORT");
+    if ( env )
+    {
+        val = atoi(env);
+        if ( val <= 0)
+        {
+            if (VirtualNodes)
+            {
+                sprintf( msgString, "[%s] Warning: MONITOR_COMM_PORT value is invalid (%s)!", MyName, env );
+                write_startup_log( msgString );
+                printf("%s\n", msgString );
+            }
+            else
+            {
+                sprintf( msgString, "[%s] Error: MONITOR_COMM_PORT value is invalid (%s)! Set MONITOR_COMM_PORT environment variable and try again.", MyName, env );
+                write_startup_log( msgString );
+                printf("%s\n", msgString );
+                rs = false;
+            }
+        }
+    }
+
+    env = getenv("MONITOR_SYNC_PORT");
+    if ( env )
+    {
+        val = atoi(env);
+        if ( val <= 0)
+        {
+            if (VirtualNodes)
+            {
+                sprintf( msgString, "[%s] Warning: MONITOR_SYNC_PORT value is invalid (%s)!", MyName, env );
+                write_startup_log( msgString );
+                printf("%s\n", msgString );
+            }
+            else
+            {
+                sprintf( msgString, "[%s] Error: MONITOR_SYNC_PORT value is invalid (%s)! Set MONITOR_COMM_PORT environment variable and try again.", MyName, env );
+                write_startup_log( msgString );
+                printf("%s\n", msgString );
+                rs = false;
+            }
+        }
+    }
+
+    env = getenv("SQ_NAMESERVER_ENABLED");
+    if ( env )
+    {
+        val = atoi(env);
+        if ( val > 0)
+        {
+            isNameServerEnabled = (val != 0);
+        }
+    }
+    
+    if (isNameServerEnabled)
+    {
+        env = getenv("NS_COMM_PORT");
+        if ( env )
+        {
+            val = atoi(env);
+            if ( val <= 0)
+            {
+                sprintf( msgString, "[%s] Error: Name Server is enabled and NS_COMM_PORT value is invalid (%s)! Set NS_COMM_PORT environment variable and try again.", MyName, env );
+                write_startup_log( msgString );
+                printf("%s\n", msgString );
+                rs = false;
+            }
+        }
+        else
+        {
+            sprintf( msgString, "[%s] Error: Name Server is enabled and NS_COMM_PORT is undefined! Set NS_COMM_PORT environment variable and try again.", MyName );
+            write_startup_log( msgString );
+            printf("%s\n", msgString );
+            rs = false;
+        }
+
+        env = getenv("NS_SYNC_PORT");
+        if ( env )
+        {
+            val = atoi(env);
+            if ( val <= 0)
+            {
+                sprintf( msgString, "[%s] Error: Name Server is enabled and NS_SYNC_PORT value is invalid (%s)! Set NS_SYNC_PORT environment variable and try again.", MyName, env );
+                write_startup_log( msgString );
+                printf("%s\n", msgString );
+                rs = false;
+            }
+        }
+        else
+        {
+            sprintf( msgString, "[%s] Error: Name Server is enabled and NS_SYNC_PORT is undefined! Set NS_SYNC_PORT environment variable and try again.", MyName );
+            write_startup_log( msgString );
+            printf("%s\n", msgString );
+            rs = false;
+        }
+
+        env = getenv("NS_M2N_COMM_PORT");
+        if ( env )
+        {
+            val = atoi(env);
+            if ( val <= 0)
+            {
+                sprintf( msgString, "[%s] Error: Name Server is enabled and NS_M2N_COMM_PORT value is invalid (%s)! Set NS_M2N_COMM_PORT environment variable and try again.", MyName, env );
+                write_startup_log( msgString );
+                printf("%s\n", msgString );
+                rs = false;
+            }
+        }
+        else
+        {
+            sprintf( msgString, "[%s] Error: Name Server is enabled and NS_M2N_COMM_PORT is undefined! Set NS_M2N_COMM_PORT environment variable and try again.", MyName );
+            write_startup_log( msgString );
+            printf("%s\n", msgString );
+            rs = false;
+        }
+
+        env = getenv("MON2MON_COMM_PORT");
+        if ( env )
+        {
+            val = atoi(env);
+            if ( val <= 0)
+            {
+                sprintf( msgString, "[%s] Error: Name Server is enabled and MON2MON_COMM_PORT value is invalid (%s)! Set MON2MON_COMM_PORT environment variable and try again.", MyName, env );
+                write_startup_log( msgString );
+                printf("%s\n", msgString );
+                rs = false;
+            }
+        }
+        else
+        {
+            sprintf( msgString, "[%s] Error: Name Server is enabled and MON2MON_COMM_PORT is undefined! Set MON2MON_COMM_PORT environment variable and try again.", MyName );
+            write_startup_log( msgString );
+            printf("%s\n", msgString );
+            rs = false;
+        }
+    }
+
+    return(rs);
+}
+
 bool init_pnode_map( void )
 {
     CPNodeConfig   *pnodeConfig;
@@ -5296,7 +5444,7 @@ int start_process (int *nid, PROCESSTYPE type, char *name, bool debug, int prior
 {
     int count;
     char delimiter;
-    char token[MAX_TOKEN];
+    char token[MAX_ARG_SIZE];
     char program[MAX_PROCESS_PATH];
     char path[MAX_SEARCH_PATH];
     char ldpath[MAX_SEARCH_PATH];
@@ -9074,7 +9222,7 @@ bool process_command( char *token, char *cmd_tail, char delimiter )
             write_startup_log( msgString );
             printf ("[%s] Current node (%s) is a configured spare node! Must use non-spare node to startup environment.\n", MyName, MyNode);
         }
-        else
+        else if ( check_environment() )
         {
             if ( start_monitor( cmd_tail,false, false ) )
             {

http://git-wip-us.apache.org/repos/asf/trafodion/blob/cd4f7006/core/sqf/sql/scripts/gensq.pl
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/gensq.pl b/core/sqf/sql/scripts/gensq.pl
index c872cdd..b48ea3b 100755
--- a/core/sqf/sql/scripts/gensq.pl
+++ b/core/sqf/sql/scripts/gensq.pl
@@ -77,6 +77,8 @@ my $SQ_IDTMSRV = $ENV{'SQ_IDTMSRV'};
 my $BDR_ERROR = 70;
 
 
+my $g_insDbUniqStrStmt = 0;
+
 sub printScript {
     ($dWhich, @rest) = @_;
 
@@ -641,6 +643,27 @@ sub doInit {
 
 }
 
+sub setupDbUniqStrings {
+
+    my $my_scripts_dir = "$TRAF_HOME" . "/sql/scripts/" ;
+    for ($i=0; $i < $gdNumNodes; $i++) {
+        sqconfigdb::addDbUniqStr($i, 1, 'shell');
+        sqconfigdb::addDbUniqStr($i, 2, 'pstartd');
+        sqconfigdb::addDbUniqStr($i, 3, 'sqwatchdog');
+        sqconfigdb::addDbUniqStr($i, 4, 'idtmsrv');
+        sqconfigdb::addDbUniqStr($i, 5, 'tm');
+        sqconfigdb::addDbUniqStr($i, 6, 'service_monitor');
+        sqconfigdb::addDbUniqStr($i, 7, 'mxsscp');
+        sqconfigdb::addDbUniqStr($i, 8, 'mxssmp');
+        sqconfigdb::addDbUniqStr($i, 9, 'run_command');
+        sqconfigdb::addDbUniqStr($i, 10, 'mxosrvr');
+        sqconfigdb::addDbUniqStr($i, 11, 'tdm_arkesp');
+        sqconfigdb::addDbUniqStr($i, 12, 'tdm_arkcmp');
+        sqconfigdb::addDbUniqStr($i, 13, 'traf_notify');
+        sqconfigdb::addDbUniqStr($i, 14, 'mxlobsrvr');
+        sqconfigdb::addDbUniqStr($i, 15, 'trafns');
+    }
+}
 
 #
 # Main
@@ -689,6 +712,8 @@ while (<>) {
 
 #printZoneList;
 
+setupDbUniqStrings();
+
 printScriptEndLines;
 
 endGame;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/cd4f7006/core/sqf/sql/scripts/gomon.cold
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/gomon.cold b/core/sqf/sql/scripts/gomon.cold
index 3be86ee..28807fd 100755
--- a/core/sqf/sql/scripts/gomon.cold
+++ b/core/sqf/sql/scripts/gomon.cold
@@ -23,14 +23,13 @@
 # @@@ END COPYRIGHT @@@
 #
 
-
 if [ -f $TRAF_HOME/sql/scripts/sqshell.env ]; then
     . $TRAF_HOME/sql/scripts/sqshell.env
 fi
 
 if [[ -z ${TRAF_AGENT} ]]; then
    echo  "***"
-   echo  "*** Starting Monitor processes"
+   echo  "***" `date`  " - Starting Monitor processes"
    echo  "***"
 
 sqshell <<eof 
@@ -38,71 +37,104 @@ sqshell <<eof
 ! Start the monitor processes across the cluster
 startup
 
+set SQ_MBTYPE=$SQ_MBTYPE
+set MY_NODES=$MY_NODES
+set JAVA_HOME=$JAVA_HOME
+set MY_CLUSTER_ID=$MY_CLUSTER_ID
+set TRAF_FOUNDATION_READY=0
+
 exit
 eof
+
 else
-   echo  "***"
-   echo  "*** Waiting for Monitor processes to start"
-   echo  "***"
-sqshell <<eof 
+   echo `date`" - Waiting for the Trafodion monitor process..."
+
+   # 5 seconds, iterations 240 = 20 minutes
+   let loop_count=0
+   let loop_max=240
+   let monitor_ready=0
+   while [[ $loop_count -lt $loop_max ]];
+   do
+     if sqcheckmon -f
+     then
+       let ++monitor_ready
+       break
+     else
+       echo -n "."
+       sleep 5
+       sleep $wtime
+       let ++loop_count
+     fi
+   done
+
+   if [[ $monitor_ready -lt 1 ]]; then
+      echo "Aborting startup!"
+      cat $TRAF_HOME/logs/sqcheckmon.log
+      exit 1
+   else
+
+# Set initial registry values
+sqshell -a <<eof
 
-! Waiting for the monitor processes to start across the cluster
-delay 15
+set SQ_MBTYPE=$SQ_MBTYPE
+set MY_NODES=$MY_NODES
+set JAVA_HOME=$JAVA_HOME
+set MY_CLUSTER_ID=$MY_CLUSTER_ID
+set TRAF_FOUNDATION_READY=0
 
 exit
 eof
 
-sqshell -c node info
+      echo `date`" - Delaying 15 seconds before continuing with Startup"
+      sleep 15
+      echo `date`" - Continuing with Startup ..."
+      echo
+   fi
 
-fi
+   # Set the number of nodes configured
+   let node_count=`trafconf -nid-count`
+   #echo  "*** node_count = ${node_count}"
+   #echo  "*** TRAF_SCALING_FACTOR = $TRAF_SCALING_FACTOR"
 
-sqcheckmon
-let lv_checkmon_ret=$?
-if [ $lv_checkmon_ret '==' 0 ]; then
-   echo "Continuing with the Startup..."
-   echo
-else
-   echo "Aborting startup."
-   more $TRAF_HOME/logs/sqcheckmon.log
-   exit 1
+   # allow time for other nodes to integrate, scaled to cluster size
+   # scaling factor may be non-integer, so use awk to evaluate
+   start_delay=$( echo "${node_count} $TRAF_SCALING_FACTOR" | awk '{print $1 * $2}')
+   echo  "***"
+   echo  "***" %`date`" - Waiting ${start_delay} seconds for Monitor processes to integrate"
+   echo  "***"
+   sleep $start_delay
 fi
 
+sqshell -c node info
+
 # If the 'shell.env' file does not exist, we are in a real cluster
 if [ -e $TRAF_HOME/sql/scripts/sqshell.env ]; then
    sqshell -c set CLUSTERNAME=$CLUSTERNAME
 fi
 
-sqshell -a <<eof
-
-set SQ_MBTYPE=64d
-set MY_NODES=$MY_NODES
-set JAVA_HOME=$JAVA_HOME
-set MY_CLUSTER_ID=$MY_CLUSTER_ID
-set TRAF_FOUNDATION_READY=0
-
-exit
-eof
-
 # Starting TSID
 
 idtmstart
 sqshell -c delay 1
 
-echo  "***"
-echo  "*** Starting Cluster Monitor"
-echo  "***"
+if [[ $TRAF_AGENT != "CM" ]]
+then
+  echo  "***"
+  echo  "***" `date`  " - Starting Cluster Monitor"
+  echo  "***"
 
-cmonstart
-sqshell -c delay 1
+  cmonstart
+  sqshell -c delay 1
+fi
 
 echo  "***"
-echo  "*** Starting Node Monitors"
+echo  "***" `date`  " - Starting Node Monitors"
 echo  "***"
 
 nmonstart
 
 echo  "***"
-echo  "*** Starting Distributed Transaction Manager (DTM)"
+echo  "***" `date`  " - Starting Distributed Transaction Manager (DTM)"
 echo  "***"
 
 tmstart
@@ -126,7 +158,7 @@ fi
 
 
 echo  "***"
-echo  "*** Trafodion Foundation Services are ready!"
+echo  "***" `date`  " - Trafodion Foundation Services are ready!"
 echo  "***"
 sqshell -a <<eof
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/cd4f7006/core/sqf/sql/scripts/sqconfigdb.pm
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqconfigdb.pm b/core/sqf/sql/scripts/sqconfigdb.pm
index f354900..517a0c8 100644
--- a/core/sqf/sql/scripts/sqconfigdb.pm
+++ b/core/sqf/sql/scripts/sqconfigdb.pm
@@ -319,6 +319,26 @@ sub addDbSpare {
     $insDbSpareStmt->execute;
 }
 
+sub addDbUniqStr {
+
+    if (not defined $DBH) {
+        # Database not available
+        return;
+    }
+
+    my $lv_nid      = $_[0];
+    my $lv_id       = $_[1];
+    my $lv_str      = $_[2];
+
+    my $insDbUniqStrStmt = $DBH->prepare("insert or replace into monRegUniqueStrings values ( ?, ?, ?)");
+
+    $insDbUniqStrStmt->bind_param(1, $lv_nid);
+    $insDbUniqStrStmt->bind_param(2, $lv_id);
+    $insDbUniqStrStmt->bind_param(3, $lv_str);
+
+    $insDbUniqStrStmt->execute;
+}
+
 sub listNodes {
     if (not defined $DBH) {
         # Database not available

http://git-wip-us.apache.org/repos/asf/trafodion/blob/cd4f7006/core/sqf/sql/scripts/sqgen
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqgen b/core/sqf/sql/scripts/sqgen
index a5d2d9d..25c10a1 100755
--- a/core/sqf/sql/scripts/sqgen
+++ b/core/sqf/sql/scripts/sqgen
@@ -29,6 +29,7 @@ function Usage {
     echo $script_name generates various Trafodion files in the $TRAF_HOME/sql/scripts directory.
     echo
     echo "Usage: $script_name [ -? | -h ] [<sqconfig_filename>]"
+    echo "  -?    Help"
     echo "  -h    Help"
     echo "  <sqconfig_filename> Name of the SQ config file (in $TRAF_HOME/sql/scripts directory)(defaults to 'sqconfig')"
     echo
@@ -38,34 +39,31 @@ function Usage {
 
 
 function GetSQcnfg {
-# Get SQ Node configuration
- TempList=`grep -o 'node-name=.[A-Za-z0-9\.\-]*' $TRAF_HOME/sql/scripts/sqconfig | cut -d "=" -f 2 | cut -d ";" -f 1 | sort -u`
+   # Get SQ Node configuration
+   TempList=`grep -o 'node-name=.[A-Za-z0-9\.\-]*' $TRAF_HOME/sql/scripts/sqconfig | cut -d "=" -f 2 | cut -d ";" -f 1 | sort -u`
 
- i=0
- for NODE in $TempList
-   do
-     SQNodeNames[$i]=$NODE
-     ((i=i+1))
+   i=0
+   for NODE in $TempList
+     do
+       SQNodeNames[$i]=$NODE
+       ((i=i+1))
 
      done
 
- # Check that the Node names were corretly added
- NumberOfSQnodes=${#SQNodeNames[*]}
- ExNodeList="$(echo ${SQNodeNames[@]} | tr ' ' ',')"
-
-
- if [ ! -z ${ExNodeList[@]} ]; then   
-     echo "${ExNodeList[@]}"
- 
- else
-     echo
-     echo "Could not parse $TRAF_HOME/sql/scripts/sqconfig file."
-     echo "Please ensure sqenv.sh has been sourced and the sqconfig file is valid.  Then, re-run sqgen."
-     echo
-     exit 1;
- fi
-
- }
+   # Check that the Node names were correctly added
+   NumberOfSQnodes=${#SQNodeNames[*]}
+   ExNodeList="$(echo ${SQNodeNames[@]} | tr ' ' ',')"
+
+   if [ ! -z ${ExNodeList[@]} ]; then   
+      echo "${ExNodeList[@]}"
+   else
+      echo
+      echo "Could not parse $TRAF_HOME/sql/scripts/sqconfig file."
+      echo "Please ensure sqenv.sh has been sourced and the sqconfig file is valid.  Then, re-run sqgen."
+      echo
+      exit 1;
+   fi
+}
 
 ###########################################################
 # MAIN portion of sqgen begins
@@ -118,29 +116,45 @@ fi
 
 cd $TRAF_HOME/sql/scripts
 
-# Check to make sure this is a real cluster
-if  [[ -n "$node_count" ]] && [[ "$node_count" -gt "1" ]]; then 
-    # The configuration database can only be created the first time.
-    # Since nodes can be added and deleted through the 'shell node add/delete'
-    # commands, the 'sqconfig' node section may not reflect the current node
-    # configured. The 'sqregen' script can be used to update the SQCONFIG_FILE
-    # node section to reflect the current node configuration stored in
-    # the SQCONFIG_DB_FILE.
-    echo "Checking for the configuration file ($SQCONFIG_DB_FILE)."
-    if [ -f $SQCONFIG_DB_FILE ]; then
-        echo
-        echo "The configuration file ($SQCONFIG_DB_FILE) exists."
-        echo "Use the 'sqshell node add/delete' commands to change the node membership in the configuration database."
-        echo "Use the 'sqshell persist add/delete' commands to change the persist object configuration in the configuration database."
-        echo "Use the 'sqregen -node' script to update the $SQCONFIG_FILE 'node' section with the"
-        echo "current node membership in the configuration database."
-        echo "Use the 'sqregen -persist' script to update the $SQCONFIG_FILE 'persist' section with the"
-        echo "current persist configuration stored in the configuration database."
-        exit 1
+# Check to make sure this is a real cluster configuration
+if  [[ -n "$node_count" ]] && [[ "$node_count" -gt "1" ]]  || [[ -n ${TRAF_AGENT} ]]; then
+    #
+    # NOTE: Temporarily bypass the following check and always recreate the
+    #       'sqconfig.db' file on the local node when invoked from an
+    #       agent like (CM).
+    #
+    #       Re-enable once the Trafodion Configuration database supports a 
+    #       non-SQLite storage method as well as support for the node add function.
+    #
+    if [[ -z ${TRAF_AGENT} ]]; then
+        if  [[ -n "$node_count" ]] && [[ "$node_count" -gt "1" ]]; then
+            # The configuration database can only be created the first time.
+            # Since nodes can be added and deleted through the 'shell node add/delete'
+            # commands, the 'sqconfig' node section may not reflect the current node
+            # configured. The 'sqregen' script can be used to update the SQCONFIG_FILE
+            # node section to reflect the current node configuration stored in
+            # the SQCONFIG_DB_FILE.
+            echo "Checking for the configuration file ($SQCONFIG_DB_FILE)."
+            if [ -f $SQCONFIG_DB_FILE ]; then
+                echo
+                echo "The configuration file ($SQCONFIG_DB_FILE) exists."
+                echo "Use the 'sqshell node add/delete' commands to change the node membership in the configuration database."
+                echo "Use the 'sqshell persist add/delete' commands to change the persist object configuration in the configuration database."
+                echo "Use the 'sqregen -node' script to update the $SQCONFIG_FILE 'node' section with the"
+                echo "current node membership in the configuration database."
+                echo "Use the 'sqregen -persist' script to update the $SQCONFIG_FILE 'persist' section with the"
+                echo "current persist configuration stored in the configuration database."
+                exit 1
+            fi
+        fi
+    else
+        # Temporary removal of configuration database file
+        rm -f $SQCONFIG_DB_FILE
     fi
 
     GetSQcnfg
 else
+    echo "node_count=${node_Count}"
     echo
     echo "Workstation environment - Not a clustered environment"
     if [ -f $SQCONFIG_DB_FILE ]; then
@@ -168,6 +182,7 @@ export SQLOG_DIR=$TRAF_HOME/logs
 mkdir -p $SQETC_DIR
 mkdir -p $SQLOG_DIR
 mkdir -p $MPI_TMPDIR
+mkdir -p $MPI_TMPDIR/tmp
 # mkdir a dir for CBF data used by SQL IUS feature
 mkdir -p $HOME/cbfs
 
@@ -175,25 +190,32 @@ mkdir -p $HOME/cbfs
 echo "Clean up HBase classpath cache file: $TRAF_VAR/hbase_classpath"
 rm -rf $TRAF_VAR/hbase_classpath
 
-if  [[ -n "$node_count" ]] && [[ "$node_count" -gt "1" ]]; then    
-    echo
-    echo "Creating directories on cluster nodes"
+# Bypass if in agent mode
+if [[ -z ${TRAF_AGENT} ]]; then
+    #If pdsh exists
+    if  [[ -n "$node_count" ]] && [[ "$node_count" -gt "1" ]]; then    
+        echo
+        echo "Creating directories on cluster nodes"
 
-    # Clean HBase classpath cache file on all nodes
-    $PDSH -w ${ExNodeList[@]} -x `uname -n` $PDSH_SSH_CMD rm -rf $TRAF_VAR/hbase_classpath
+        # Clean HBase classpath cache file on all nodes
+        $PDSH -w ${ExNodeList[@]} -x `uname -n` $PDSH_SSH_CMD rm -rf $TRAF_VAR/hbase_classpath
 
-    echo "$PDSH -w ${ExNodeList[@]} -x `uname -n` $PDSH_SSH_CMD mkdir -p $SQETC_DIR "
-    $PDSH -w ${ExNodeList[@]} -x `uname -n` $PDSH_SSH_CMD mkdir -p $SQETC_DIR
+        echo "$PDSH -w ${ExNodeList[@]} -x `uname -n` $PDSH_SSH_CMD mkdir -p $SQETC_DIR "
+        $PDSH -w ${ExNodeList[@]} -x `uname -n` $PDSH_SSH_CMD mkdir -p $SQETC_DIR
+        
+        echo "$PDSH -w ${ExNodeList[@]} -x `uname -n` $PDSH_SSH_CMD mkdir -p $SQLOG_DIR "
+        $PDSH -w ${ExNodeList[@]} -x `uname -n` $PDSH_SSH_CMD mkdir -p $SQLOG_DIR
     
-    echo "$PDSH -w ${ExNodeList[@]} -x `uname -n` $PDSH_SSH_CMD mkdir -p $SQLOG_DIR "
-    $PDSH -w ${ExNodeList[@]} -x `uname -n` $PDSH_SSH_CMD mkdir -p $SQLOG_DIR
-
-    echo "$PDSH -w ${ExNodeList[@]} -x `uname -n` $PDSH_SSH_CMD mkdir -p $MPI_TMPDIR "
-    $PDSH -w ${ExNodeList[@]} -x `uname -n` $PDSH_SSH_CMD mkdir -p $MPI_TMPDIR
-
-    echo "$PDSH -w ${ExNodeList[@]} -x `uname -n` $PDSH_SSH_CMD mkdir -p $PWD "
-    $PDSH -w ${ExNodeList[@]} -x `uname -n` $PDSH_SSH_CMD mkdir -p $PWD
-
+        echo "$PDSH -w ${ExNodeList[@]} -x `uname -n` $PDSH_SSH_CMD mkdir -p $MPI_TMPDIR "
+        $PDSH -w ${ExNodeList[@]} -x `uname -n` $PDSH_SSH_CMD mkdir -p $MPI_TMPDIR
+    
+        echo "$PDSH -w ${ExNodeList[@]} -x `uname -n` $PDSH_SSH_CMD mkdir -p $MPI_TMPDIR/tmp "
+        $PDSH -w ${ExNodeList[@]} -x `uname -n` $PDSH_SSH_CMD mkdir -p $MPI_TMPDIR/tmp
+    
+        echo "$PDSH -w ${ExNodeList[@]} -x `uname -n` $PDSH_SSH_CMD mkdir -p $PWD "
+        $PDSH -w ${ExNodeList[@]} -x `uname -n` $PDSH_SSH_CMD mkdir -p $PWD
+    
+    fi
 fi
 
 SQSCRIPT_FILE=./gomon
@@ -253,42 +275,40 @@ if [ -f $SQESPENV_FILE ]; then
     fi
 fi
 
-if  [[ -n "$node_count" ]] && [[ "$node_count" -gt "1" ]]; then    
-    echo
-    echo
-    echo "Copying the generated files to all the nodes in the cluster"
-    echo
-
-    echo
-    echo "Copying $SQETC_DIR/ms.env to $SQETC_DIR of all the nodes"
-    echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` $SQETC_DIR/ms.env   $SQETC_DIR "
-    $PDCP -w ${ExNodeList[@]} -x `uname -n` $SQETC_DIR/ms.env   $SQETC_DIR
+# Bypass if in agent mode
+if [[ -z ${TRAF_AGENT} ]]; then
+    if  [[ -n "$node_count" ]] && [[ "$node_count" -gt "1" ]]; then    
+        echo
+        echo
+        echo "Copying the generated files to all the nodes in the cluster"
+        echo
+        echo "Copying $SQETC_DIR/ms.env to $SQETC_DIR of all the nodes"
+        echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` $SQETC_DIR/ms.env   $SQETC_DIR "
+        $PDCP -w ${ExNodeList[@]} -x `uname -n` $SQETC_DIR/ms.env   $SQETC_DIR
 
-    echo
-    echo "Copying $SQETC_DIR/seamonster.env to $SQETC_DIR of all the nodes"
-    echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` $SQETC_DIR/seamonster.env   $SQETC_DIR "
-    $PDCP -w ${ExNodeList[@]} -x `uname -n` $SQETC_DIR/seamonster.env   $SQETC_DIR
 
-    if [[ $sq_seamonster == 1 ]]; then 
-        if [ -f $SQESPENV_FILE ]; then
-            echo
-            echo "Copying $SQESPENV_FILE to $TRAF_HOME/sql/scripts of all the nodes"
-            echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` $SQESPENV_FILE   $TRAF_HOME/sql/scripts "
-            $PDCP -w ${ExNodeList[@]} -x `uname -n` $SQESPENV_FILE   $TRAF_HOME/sql/scripts
+        echo
+        echo "Copying $SQETC_DIR/seamonster.env to $SQETC_DIR of all the nodes"
+        echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` $SQETC_DIR/seamonster.env   $SQETC_DIR "
+        $PDCP -w ${ExNodeList[@]} -x `uname -n` $SQETC_DIR/seamonster.env   $SQETC_DIR
+
+        if [[ $sq_seamonster == 1 ]]; then 
+            if [ -f $SQESPENV_FILE ]; then
+                echo
+                echo "Copying $SQESPENV_FILE to $TRAF_HOME/sql/scripts of all the nodes"
+                echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` $SQESPENV_FILE   $TRAF_HOME/sql/scripts "
+                $PDCP -w ${ExNodeList[@]} -x `uname -n` $SQESPENV_FILE   $TRAF_HOME/sql/scripts
+            fi
         fi
-    fi
 
-    echo
-    echo "Copying rest of the generated files to $PWD"
-
-    echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` sqconfig sqshell gomon.cold rmsstart rmsstop rmscheck.sql ssmpstart ssmpstop sscpstart sscpstop $PWD"
-    $PDCP -w ${ExNodeList[@]} -x `uname -n` sqconfig sqshell gomon.cold rmsstart rmsstop rmscheck.sql ssmpstart ssmpstop sscpstart sscpstop $PWD
-
-    echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` $SQCONFIG_FILE $SQCONFIG_DB_FILE $PWD "
-    $PDCP -w ${ExNodeList[@]} -x `uname -n` $SQCONFIG_FILE $SQCONFIG_DB_FILE $PWD
+        echo
+        echo "Copying Trafodion Configuration files to $PWD"
 
+        echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` $SQCONFIG_FILE $SQCONFIG_DB_FILE $PWD "
+        $PDCP -w ${ExNodeList[@]} -x `uname -n` $SQCONFIG_FILE $SQCONFIG_DB_FILE $PWD
 
-    echo
+        echo
+    fi
 fi
 
 # mkdir a dir for CBF data used by SQL IUS feature
@@ -297,13 +317,12 @@ mkdir -p $HOME/cbfs
 echo
 echo "******* Generate public/private certificates *******"
 echo
-# Generate certificates for ODBC, ...
 if (test -f $TRAF_HOME/sql/scripts/sqcertgen); then
-   $TRAF_HOME/sql/scripts/sqcertgen 2>/dev/null
-   echo
+  $TRAF_HOME/sql/scripts/sqcertgen 2>/dev/null
+  echo
 else
-   echo
-   echo "ERROR: Certificate generation script (sqcertgen) does not exist in $TRAF_HOME/sql/scripts folder"
-   echo
-   exit 1
+  echo
+  echo "ERROR: Certificate generation script (sqcertgen) does not exist in $TRAF_HOME/sql/scripts folder"
+  echo
+  exit 1
 fi

http://git-wip-us.apache.org/repos/asf/trafodion/blob/cd4f7006/core/sqf/sql/scripts/sqstart
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqstart b/core/sqf/sql/scripts/sqstart
index 8e41afc..30fedff 100755
--- a/core/sqf/sql/scripts/sqstart
+++ b/core/sqf/sql/scripts/sqstart
@@ -22,7 +22,7 @@
 # @@@ END COPYRIGHT @@@
 #
 
-#SQ Startup Driver Script. Use sqgen prior to this to generate various files required for startup.
+#Trafodion startup Script. 
 
 function LogIt {
     echo  "`date`: $1" >> $TRAF_HOME/logs/startup.log
@@ -72,14 +72,6 @@ function GetOpts {
     done
 }
 
-function chkReturnCode {
-    if [[ $2 != 0 ]]; then
-       LogIt "End $script_name $sq_start, exit code: $2"
-       echo "$1 returned error $2, Exiting..."
-       exit $2;
-    fi
-}
-
 function echoLog {
 
     echo $1 | tee -a $SQMON_LOG
@@ -138,35 +130,40 @@ function getJobInfo {
 
 }
 
-function SQStartProcesses {
+function TrafodionStartProcesses {
 
-    echoLog "Starting the SQ Environment (Executing $SQSCRIPT_FILE)"
+    echoLog "Starting the Trafodion Environment (Executing $SQSCRIPT_FILE)"
     echoLog
     $SQSCRIPT_FILE > $SQMON_LOG 2>&1
 
     sqstart_stat=$?
     echo
     if [[ $sqstart_stat == 0 ]]; then
-        echoLog "SQ Startup script ($SQSCRIPT_FILE) ran successfully. Performing further checks..."
+        echoLog "Trafodion Startup script ($SQSCRIPT_FILE) ran successfully. Performing further checks..."
         echo "0" > $SQSTART_EXIT_STATUS
     else
         echoLog "Error while executing the startup script!!!"
-        sqcheck -f
-        sq_stat=$?
-        if [[ $sq_stat == 0 ]]; then
-            echoLog "Even though all the SQ processes started up, the startup did not succeed!"
+        # Bypass if in agent mode
+        if [[ -z ${TRAF_AGENT} ]]; then
+            sqcheck -f
+            sq_stat=$?
+            if [[ $sq_stat == 0 ]]; then
+                echoLog "Even though all the Trafodion processes started up, the startup did not succeed!"
+            fi
         fi
         echoLog
-        echoLog "Please check the SQ shell log file : $SQMON_LOG"
+        echoLog "Please check the Trafodion shell log file : $SQMON_LOG"
         echoLog
-        echoLog "SQ Startup (from $PWD) Failed"
+        echoLog "For additional information, please check the monitor mon.*.log file in $TRAF_HOME/logs"
+        echoLog
+        echoLog "Trafodion Startup (from $PWD) Failed"
         echoLog
         echo "1" > $SQSTART_EXIT_STATUS
     fi
 
 }
 
-function SQCheckOrphanProcesses {
+function TrafodionCheckOrphanProcesses {
 
     let lv_orphans_exist=0
     let lv_orphan_process_count=0
@@ -177,7 +174,11 @@ function SQCheckOrphanProcesses {
     echo -n "Checking orphan processes"
     while [ $lv_sqcop_done '==' 0 ]; do
     echo -n "."
-    lv_orphan_process_count=`cstat -h | wc -l`
+    if [[ -z ${TRAF_AGENT} ]]; then
+        lv_orphan_process_count=`cstat -h | wc -l`
+    else     
+        lv_orphan_process_count=`pstat -h | wc -l`
+    fi
     let lv_orphans_exist=(lv_orphan_process_count '>' 2)
 
     if [ $lv_orphans_exist '==' 1 ]; then
@@ -195,11 +196,15 @@ function SQCheckOrphanProcesses {
 
     echo
     if [ $lv_orphans_exist '==' 1 ]; then
-        lv_msg1="There are orphan processes from a previous SQ instance."
+        lv_msg1="There are orphan processes from a previous Trafodion instance."
         echo "$lv_msg1"
-        cstat
+        if [[ -z ${TRAF_AGENT} ]]; then
+            cstat
+        else
+            pstat
+        fi
         echo
-        lv_msg2="SQ startup has not been initiated. Exiting..."
+        lv_msg2="Trafodion startup has not been initiated. Exiting..."
         echo "$lv_msg"
         LogIt "End $script_name, exit code: 1, $lv_msg1 $lv_msg2"
         exit 1
@@ -233,16 +238,6 @@ function checkKerberos {
 }
 
 function checkUlimit {
-  
- #check max_pid 
- userProc=`cat /proc/sys/kernel/pid_max`
- if [[ $userProc -gt 65535 ]] ; then
-    echoLog ""
-    echoLog "ERROR: issue detected during startup. Please make sure your kernel parameter (sysctl) is set up correctly."
-    echoLog "ERROR: max_pid should not be greater than 65535"
-    echoLog ""
-    return
- fi
 
  #check ulimit -l
  maxLockMem=`ulimit -l`
@@ -282,7 +277,7 @@ STARTtime=$(date +%s)
 
 GetOpts $BASH_ARGV
 
-if [ ! -z $TRAF_HOME ]; then
+if [[ ! -z $TRAF_HOME ]]; then
     cd $TRAF_HOME/sql/scripts
 else
     echoLog
@@ -295,7 +290,6 @@ fi
 checkUlimit
 
 let nameserver_configured=`trafconf -ns | grep nodes | wc -l`
-
 if [[ "$SQ_NAMESERVER_ENABLED" == "1" ]]; then
    if [ $nameserver_configured '<' 1 ]; then
      echoLog
@@ -306,24 +300,6 @@ if [[ "$SQ_NAMESERVER_ENABLED" == "1" ]]; then
    fi
 fi
 
-# Check SeaMonster kernel module if SeaMonster is enabled
-if [[ $SQ_SEAMONSTER == "1" ]]; then
-    echoLog
-    echoLog "SeaMonster is enabled, checking SeaMonster Kernel Module installed version..."
-    echoLog
-    sminfo_out=`$TRAF_HOME/export/bin${SQ_MBTYPE}/sminfo 2>&1`
-    if [ $? -gt 0 ]; then
-       echoLog "$sminfo_out"
-       lv_msg="Correct SeaMonster Kernel Module in not installed; please resolve this issue and re-run $script_name!"
-       echo "$lv_msg"
-       LogIt "End $script_name $sq_start, exit code: 1, $lv_msg"
-       exit 1
-    fi
-    echoLog "$sminfo_out"
-    LogIt "$sminfo_out"
-    echoLog
-fi
-
 if [[ ! -e $TRAF_HOME/sql/scripts/sw_env.sh ]]; then
    checkKerberos
    if [[ $? -ne 0 ]]; then
@@ -347,22 +323,30 @@ if [ $lv_len_mysqroot '>' $lv_max_mysqroot_len ]; then
     exit 1;
 fi
 
-LogIt "Begin $script_name $sq_start"
-sqcheck -i 1 -d 1 > /dev/null 2>&1
-sq_stat=$?
-if [[ $sq_stat == 0 ]]; then
-    lv_msg="SQ environment is already up."
-    echoLog "$lv_msg"
-    LogIt "End $script_name $sq_start, exit code: 1, $lv_msg"
-    exit 1
-elif [[ $sq_stat == 1 ]]; then
-    lv_msg="SQ environment is partially up."
-    echoLog "$lv_msg"
-    LogIt "End $script_name $sq_start, exit code: 1, $lv_msg"
-    exit 1
-fi
+# Bypass if in agent mode
+if [[ -z ${TRAF_AGENT} ]]; then
+    LogIt "Begin $script_name $sq_start"
+    sqcheck -i 1 -d 1 > /dev/null 2>&1
+    sq_stat=$?
+    if [[ $sq_stat == 0 ]]; then
+        lv_msg="Trafodion environment is already up."
+        echoLog "$lv_msg"
+        LogIt "End $script_name $sq_start, exit code: 1, $lv_msg"
+        exit 1
+    elif [[ $sq_stat == 1 ]]; then
+        lv_msg="Trafodion environment is partially up."
+        echoLog "$lv_msg"
+        LogIt "End $script_name $sq_start, exit code: 1, $lv_msg"
+        exit 1
+    fi
 
-SQCheckOrphanProcesses
+    if ( [[ ! -z CHECK_ORPHANS ]] &&
+         [[ ${CHECK_ORPHANS} == 0 ]] ); then
+        echo "Not checking for orphans." 
+    else
+        TrafodionCheckOrphanProcesses
+    fi
+fi
 
 if [[ $run_chk_dbperms == 1 ]]; then
     chk_dbperms=$TRAF_HOME/sql/scripts/chk_dbperms
@@ -423,22 +407,29 @@ fi
 echoLog "Removing old mpijob* files from $MPI_TMPDIR"
 echoLog  ""
 rm -f $MPI_TMPDIR/mpijob*
-echoLog "Removing old monitor.port* files from $MPI_TMPDIR"
-echoLog  ""
-rm -f $MPI_TMPDIR/monitor.port.*
 
+# Bypass if in agent mode
+if [[ -z ${TRAF_AGENT} ]]; then
+    # This code assumes that gomon.cold executes 'shell startup' to create the 
+    # monitor processes. 
+    # This pre-startup cleanup must be done in the CSD script monitor.sh.
+    echoLog "Removing old monitor.port* files from $MPI_TMPDIR"
+    echoLog  ""
+    rm -f $MPI_TMPDIR/monitor.port.*
 
-setup_sqpdsh
 
-# Clean HBase classpath cache file
-echo "Clean up HBase classpath cache file: $TRAF_VAR/hbase_classpath"
-$SQPDSHA "rm -rf $TRAF_VAR/hbase_classpath"
+    setup_sqpdsh
 
-# Clear unique strings
-$SQPDSHA "cd $TRAF_HOME/sql/scripts; utilConfigDb -u"
+    # Clean HBase classpath cache file
+    echo "Clean up HBase classpath cache file: $TRAF_VAR/hbase_classpath"
+    $SQPDSHA "rm -rf $TRAF_VAR/hbase_classpath"
 
-echoLog "Executing sqipcrm (output to sqipcrm.out)"
-sqipcrm > sqipcrm.out
+    # Clear unique strings
+    $SQPDSHA "cd $TRAF_HOME/sql/scripts; utilConfigDb -u"
+
+    echoLog "Executing sqipcrm (output to sqipcrm.out)"
+    sqipcrm > sqipcrm.out
+fi
 
 echoLog "Executing cleanZKNodes (output to cleanZKNodes.out)"
 cleanZKNodes > cleanZKNodes.out 2>&1
@@ -453,14 +444,14 @@ if [ $? != 0 ]; then
 fi
 
 rm -f $SQSTART_EXIT_STATUS
-SQStartProcesses &
-getJobInfo SQStartProcesses
+TrafodionStartProcesses &
+getJobInfo TrafodionStartProcesses
 
 if [ ! -z "$gv_job_pid" ]; then
     lv_sqstartup_job_pid=$gv_job_pid
-    echoLog "Background SQ Startup job (pid: $lv_sqstartup_job_pid)"
+    echoLog "Background Trafodion Startup job (pid: $lv_sqstartup_job_pid)"
 else
-    lv_msg="Some problem with the initiation of the job to startup SQ processes"
+    lv_msg="Some problem with the initiation of the job to startup Trafodion processes"
     echoLog "$lv_msg"
     LogIt "End $script_name $sqstart, exit code: 3, $lv_msg"
     exit 3
@@ -511,7 +502,11 @@ do
       let lv_done=1
   else
 
-      lv_process_count_curr=`cstat 2>/dev/null | grep -v "\-\-\-   \-\-\-\-" | grep -v 'pid   ppid' | wc -l`
+      if [[ -z ${TRAF_AGENT} ]]; then
+         lv_process_count_curr=`cstat 2>/dev/null | grep -v "\-\-\-   \-\-\-\-" | grep -v 'pid   ppid' | wc -l`
+      else
+         lv_process_count_curr=`pstat 2>/dev/null | grep -v "\-\-\-   \-\-\-\-" | grep -v 'pid   ppid' | wc -l`
+      fi
       let lv_cnt_check=(lv_process_count_curr '>' lv_process_count_last)
 
       if [ $lv_cnt_check '==' 1 ]; then
@@ -519,39 +514,17 @@ do
       fi
       lv_process_count_last=lv_process_count_curr
 
-#      lv_TM0_started=`cstat 2>/dev/null | grep -v "\-\-\-   \-\-\-\-" | grep -v 'pid   ppid' | grep TM | wc -l`
-
-#      if [ $lv_TM0_started '!=' 0 ]; then
-#         let lv_num_checks=0
-#         lv_recovery_tx_cnt=`sqshell -c show | grep -v 'Configuration Change Notice' | grep DTM_RECOVERING_TX_COUNT | cut -d= -f2 | sed -e 's/^[[:space:]]*//'`
-#         if [ "$lv_recovery_tx_cnt" -gt "0" ]; then
-#            echo -ne "\r# of Transactions being recovered: $lv_recovery_tx_cnt "
-#         else
-#            if [ "$lv_tm_svc_ready" -eq 0 ]; then
-#               echo -ne "\r# of Transactions being recovered: $lv_recovery_tx_cnt "
-#               sqregck -r SQ_TXNSVC_READY -d 5 -i 5
-#               lv_tm_svc_ready=$?
-#            else
-#               if [ $tx_srvc_ready_printed -eq 0 ]; then
-#                 echo -ne "\rTransaction Services Ready          "
-#                 tx_srvc_ready_printed=1
-#               fi
-#               let lv_tm_svc_ready=1
-#            fi
-#         fi
-#      else
-         if [ $lv_num_checks '==' 0 ]; then
-            echo -ne "\r# of SQ processes: $lv_process_count_last "
-         else
-            echo -n "."
-         fi
-#      fi
+      if [ $lv_num_checks '==' 0 ]; then
+         echo -ne "\r# of Trafodion processes: $lv_process_count_last "
+      else
+         echo -n "."
+      fi
 
-      getJobInfo SQStartProcesses
+      getJobInfo TrafodionStartProcesses
       if [ -z "$gv_job_pid" ]; then
           if [ ! -e $SQSTART_EXIT_STATUS ]; then
-              echoLog "The background SQ job (pid: $lv_sqstartup_job_pid) that was starting up the SQ processes exitted abnormally."
-              echoLog "There are still $lv_process_count_curr SQ processes that exist in the environment."
+              echoLog "The background Trafodion job (pid: $lv_sqstartup_job_pid) that was starting up the Trafodion processes exited abnormally."
+              echoLog "There are still $lv_process_count_curr Trafodion processes that exist in the environment."
               echoLog "Exiting."
               let lv_done=1
               lv_startup_status=3
@@ -567,8 +540,8 @@ do
       if [ $lv_done '==' 1 ]; then
           lv_startup_status=2
           echoLog ""
-          echoLog "SQ Startup is taking longer than usual and seems to be stalled at $lv_process_count_curr processes. "
-          echoLog "The background SQ job (pid: $lv_sqstartup_job_pid) that is starting up the SQ processes is still running."
+          echoLog "Trafodion Startup is taking longer than usual and seems to be stalled at $lv_process_count_curr processes. "
+          echoLog "The background Trafodion job (pid: $lv_sqstartup_job_pid) that is starting up the Trafodion processes is still running."
           echoLog "Exiting."
       fi
       sleep 10
@@ -595,7 +568,7 @@ if [ $lv_startup_status '==' 0 ]; then
             let lv_done=1
         else
             if [ $lv_num_iterations '==' 0 ]; then
-                echo "The SQ environment is partially up! Continuing checks."
+                echo "The Trafodion environment is partially up! Continuing checks."
                 echo -n "Checking"
             fi
             echo -n "."

http://git-wip-us.apache.org/repos/asf/trafodion/blob/cd4f7006/core/sqf/sql/scripts/sqstop
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqstop b/core/sqf/sql/scripts/sqstop
index c09169b..c4da486 100755
--- a/core/sqf/sql/scripts/sqstop
+++ b/core/sqf/sql/scripts/sqstop
@@ -74,13 +74,15 @@ if [[ ! -e $SQGOMON_FILE ]]; then
 fi
 
 # Check if the SQ environment is up or not
-sqcheck -i 1 -d 1 > /dev/null 2>&1
-sq_stat=$?
-if [[ $sq_stat -eq 255 ]]; then
-    lv_msg="SQ environment is not up."
-    echo "$lv_msg"
-    LogIt "End $script_name $shutdowntype, exit code: 0, $lv_msg"
-    exit 0;
+if [[ $shutdowntype == "normal" ]]; then  
+    sqcheck -i 1 -d 1 > /dev/null 2>&1
+    sq_stat=$?
+    if [[ $sq_stat -eq 255 ]]; then
+       lv_msg="The Trafodion environment is not up. Please issue 'sqstop abrupt' or 'ckillall' to kill any orphan processes."
+       echo "$lv_msg"
+       LogIt "End $script_name $shutdowntype, exit code: 0, $lv_msg"
+       exit 0;
+    fi
 fi
 
 rm -f $SQSTOP_EXIT_STATUS
@@ -95,7 +97,7 @@ dcsstop
 #lobstop
 
 # Issue the shutdown request
-echoLog "Shutting down ($shutdowntype) the SQ environment!"
+echoLog "Shutting down ($shutdowntype) the Trafodion environment!"
 echoLog "`date`"
 sqshell -a <<eof
 ps
@@ -104,7 +106,6 @@ eof
 
 echoLog "Issued a 'shutdown $shutdowntype' request"
 
-
 sleep 2
 
 # Now check whether the SQ environment is still up or not
@@ -118,14 +119,17 @@ declare -i lv_process_count_curr
 declare -i lv_process_count_last
 declare -i lv_displayed_process_still_executing
 declare -i lv_exit_status
+declare -i lv_sleep_time
+declare -i lv_total_sleep_time
 
 let lv_num_checks=0
-let lv_max_checks=200
+let lv_max_checks=30
 let lv_done=0
 let lv_process_count_curr=0
 let lv_process_count_last=0
 let lv_displayed_process_still_executing=0
-
+let lv_sleep_time=5
+let lv_total_sleep_time=(lv_sleep_time '*' lv_max_checks)
 
 bFirst=1
 sq_stat=0
@@ -134,10 +138,9 @@ echoLog "Shutdown in progress";
 
 echoLog
 
-
 while [[ $sq_stat == 0 ]]; do
 
-    sleep 5
+    sleep ${lv_sleep_time}
 
     # Count the number of processes
     lv_process_count_curr=`cstat 2>/dev/null | grep -v "\-\-\-   \-\-\-\-" | grep -v 'pid   ppid' | wc -l`
@@ -165,19 +168,22 @@ while [[ $sq_stat == 0 ]]; do
         if [ $lv_displayed_process_still_executing '==' 0 ]; then
 	    let lv_displayed_process_still_executing=1
 	    echoLog 
-	    echoLog "These are the processes still running. Please check if any application process (such as sqlci) is still running that might hamper shutdown"
+	    echoLog "These are the processes still running. Please check if any application process (such as sqlci) is still running that might hamper shutdown. Please ctl-c within the next ${lv_total_sleep_time} seconds if you want those processes to continue..."
 	    cstat | tee -a $SQMON_LOG
+	    echoLog "Please check if any application process (such as sqlci) is still running that might hamper shutdown. Please ctl-c within the next ${lv_total_sleep_time} seconds if you want those processes to continue..."
 	    let lv_num_checks=0
 	else
 	    lv_shutdown_status=2
+	    echoLog
 	    echoLog "`date`"
 	    lv_msg="SQ Shutdown is taking longer than usual and seems to be stalled at $lv_process_count_curr processes. "
 	    echoLog "$lv_msg"
 	    cstat >> $SQMON_LOG
-	    echoLog "Exiting."
+	    echoLog "Issuing 'sqstop abrupt'."
 	    let lv_exit_status=1
 	    LogIt "End $script_name $shutdowntype, exit code: $lv_exit_status, $lv_msg"
 	    echo "$lv_exit_status" > $SQSTOP_EXIT_STATUS
+	    sqstop abrupt
 	    exit $lv_exit_status
 	fi
     fi

http://git-wip-us.apache.org/repos/asf/trafodion/blob/cd4f7006/core/sqf/src/trafconf/Makefile
----------------------------------------------------------------------
diff --git a/core/sqf/src/trafconf/Makefile b/core/sqf/src/trafconf/Makefile
index 2c84dec..42e81bc 100644
--- a/core/sqf/src/trafconf/Makefile
+++ b/core/sqf/src/trafconf/Makefile
@@ -44,7 +44,7 @@ LIBS		= $(LIBTRAFCONFIG)
 LIBSX	+= -lrt
 
 # need -lsqlite3 for SQLite
-LIBSX	+=  -lsqlite3
+LIBSX	+=  -lsqlite3 -lpthread
 
 PROGS		= $(TRAFCONF)
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/cd4f7006/core/sqf/src/trafconf/clusterconf.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/trafconf/clusterconf.cpp b/core/sqf/src/trafconf/clusterconf.cpp
index e3d8848..d3938ce 100644
--- a/core/sqf/src/trafconf/clusterconf.cpp
+++ b/core/sqf/src/trafconf/clusterconf.cpp
@@ -376,9 +376,52 @@ bool CClusterConfig::LoadNodeConfig( void )
         return( false );
     }
 
+    bool lv_is_real_cluster = true;
+    if ( getenv( "SQ_VIRTUAL_NODES" ) )
+    {
+        lv_is_real_cluster = false;
+    }
+
     // Process logical nodes
     for (int i =0; i < nodeCount; i++ )
     {
+        char *tmpptr = nodeConfigData[i].node_name;
+        while ( *tmpptr )
+        {
+            *tmpptr = (char)tolower( *tmpptr );
+            tmpptr++;
+        }
+    
+        if (lv_is_real_cluster)
+        {
+            // Remove the domain portion of the name if any
+            char short_node_name[TC_PROCESSOR_NAME_MAX];
+            char str1[TC_PROCESSOR_NAME_MAX];
+            memset( str1, 0, TC_PROCESSOR_NAME_MAX );
+            memset( short_node_name, 0, TC_PROCESSOR_NAME_MAX );
+            strcpy (str1, nodeConfigData[i].node_name );
+
+            char *str1_dot = strchr( (char *) str1, '.' );
+            if ( str1_dot )
+            {
+                memcpy( short_node_name, str1, str1_dot - str1 );
+            }
+            else
+            {
+                strcpy (short_node_name, str1 );
+            }
+
+            strcpy(nodeConfigData[i].node_name, short_node_name);
+
+        }
+
+        if ( TcTraceSettings & TC_TRACE_INIT )
+        {
+            trace_printf( "%s@%d nodename=%s\n"
+                          , method_name, __LINE__
+                          , nodeConfigData[i].node_name);
+        }
+
         ProcessLNode( nodeConfigData[i], pnodeConfigInfo, lnodeConfigInfo );
         // We want to pick the first configured node so all monitors pick the same one
         // This only comes into play for a Trafodion start from scratch

http://git-wip-us.apache.org/repos/asf/trafodion/blob/cd4f7006/core/sqf/src/trafconf/tctrace.h
----------------------------------------------------------------------
diff --git a/core/sqf/src/trafconf/tctrace.h b/core/sqf/src/trafconf/tctrace.h
index 4d4d6a3..5d58e4d 100644
--- a/core/sqf/src/trafconf/tctrace.h
+++ b/core/sqf/src/trafconf/tctrace.h
@@ -82,7 +82,7 @@ private:
                             , const char *key_cmp );
 
     // The number of trace areas held in "traceAreaList"
-    int   numTraceAreas_;
+    long   numTraceAreas_;
     bool  tracingEnabled_;
 
     // Save area for retaining prior trace settings if tracing is


[26/50] [abbrv] trafodion git commit: Update.

Posted by su...@apache.org.
Update.


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

Branch: refs/heads/master
Commit: 8175d4456ed95a09a9e17a05629ccd5c5625a943
Parents: 2d774d9
Author: Dave George <de...@gmail.com>
Authored: Wed Apr 11 20:32:24 2018 +0000
Committer: Dave George <de...@gmail.com>
Committed: Wed Apr 11 20:32:24 2018 +0000

----------------------------------------------------------------------
 core/sqf/src/seabed/test/tmerge.cpp | 64 +++++++++++++++++++++++---------
 1 file changed, 46 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/8175d445/core/sqf/src/seabed/test/tmerge.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/seabed/test/tmerge.cpp b/core/sqf/src/seabed/test/tmerge.cpp
index 6b7e3ba..5feb266 100644
--- a/core/sqf/src/seabed/test/tmerge.cpp
+++ b/core/sqf/src/seabed/test/tmerge.cpp
@@ -21,6 +21,7 @@
 //
 // @@@ END COPYRIGHT @@@
 
+#include <assert.h>
 #include <ctype.h>
 #include <stdio.h>
 
@@ -48,6 +49,7 @@ public:
     void  read_line();
 
 private:
+    enum { MAX_PEEK = 50 };
     void  set_ok(bool ok_in);
     bool  ts_ok();
     void  ts_set(char *line, long *ts_ret);
@@ -56,7 +58,8 @@ private:
     char *indent;
     char *lp;
     bool  ok;
-    char *peekp;
+    char *peekp[MAX_PEEK];
+    int   peekp_inx;
     long  ts;
 };
 
@@ -64,7 +67,9 @@ CFile::CFile(char *file_str, int indent_col) {
     fp = fopen(file_str, "r");
     lp = NULL;
     ok = (fp != NULL);
-    peekp = NULL;
+    peekp_inx = -1;
+    for (int inx = 0; inx < MAX_PEEK; inx++)
+        peekp[inx] = NULL;
     indent = new char[indent_col+1];
     for (int inx = 0; inx < indent_col; inx++)
         indent[inx] = ' ';
@@ -74,8 +79,9 @@ CFile::CFile(char *file_str, int indent_col) {
 CFile::~CFile() {
     if (lp != NULL)
         free(lp);
-    if (peekp != NULL)
-        free(peekp);
+    for (int inx = 0; inx < MAX_PEEK; inx++)
+        if (peekp[inx] != NULL)
+            free(peekp[inx]);
     if (fp != NULL)
         fclose(fp);
     delete [] indent;
@@ -108,7 +114,8 @@ bool CFile::lt(CFile &f) {
     if (is_ok() && f.is_ok()) {
         if (ts_ok()) {
             ret = (ts < f.ts);
-        }
+        } else
+            ret = true;
     }
     if (verbose)
         printf("lt=%d, ts1=%ld, t2s=%ld\n",
@@ -118,16 +125,31 @@ bool CFile::lt(CFile &f) {
 
 long CFile::peek_ts() {
     long ret = 0;
-    size_t len = 0;
-    ssize_t gl_ret = getline(&peekp, &len, fp);
-    if (gl_ret != -1) {
-        if (gl_ret > 0) {
-            if (peekp[gl_ret - 1] == '\n')
-                peekp[gl_ret - 1] = '\0';
-        }
-        ts_set(peekp, &ret);
-    } else
-        set_ok(false);
+    size_t len;
+    for (int inx = 0; inx <= peekp_inx; inx++) {
+        ts_set(peekp[inx], &ret);
+        if (ret != 0)
+            break;
+    }
+    if (ret == 0) {
+        do {
+            peekp_inx++;
+            assert(peekp_inx < MAX_PEEK);
+            len = 0;
+            ssize_t gl_ret = getline(&peekp[peekp_inx], &len, fp);
+            if (gl_ret != -1) {
+                if (gl_ret > 0) {
+                    if (peekp[peekp_inx][gl_ret - 1] == '\n')
+                        peekp[peekp_inx][gl_ret - 1] = '\0';
+                }
+                ts_set(peekp[peekp_inx], &ret);
+            } else {
+                set_ok(false);
+                ret = 0;
+                break;
+            }
+        } while (ret == 0);
+    }
     return ret;
 }
 
@@ -147,11 +169,13 @@ void CFile::print_line_ts(long delta_ts) {
         else
             sprintf(delta, "(>%8ld)", delta_ts);
         printf("%s%s%s %s\n", indent, lp, delta, &lp[17]);
+    } else if (lp != NULL) {
+        printf("%s%s\n", indent, lp);
     }
 }
 
 void CFile::read_line() {
-    if (peekp == NULL) {
+    if (peekp_inx < 0) {
         if (lp != NULL) {
             free(lp);
             lp = NULL;
@@ -167,8 +191,12 @@ void CFile::read_line() {
         } else
             set_ok(false);
     } else {
-        lp = peekp;
-        peekp = NULL;
+        assert(peekp_inx >= 0);
+        lp = peekp[0];
+        for (int inx = 0; inx < peekp_inx; inx++)
+            peekp[inx] = peekp[inx+1];
+        peekp[peekp_inx] = NULL;
+        peekp_inx--;
         ts_set(lp, NULL);
     }
 }


[32/50] [abbrv] trafodion git commit: Name Server enabled fixes of problems during shutdown.

Posted by su...@apache.org.
Name Server enabled fixes of problems during shutdown.


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

Branch: refs/heads/master
Commit: db656603237af4f376a2cca27fe0500b7461380a
Parents: a528474
Author: Zalo Correa <za...@esgyn.com>
Authored: Wed Apr 18 11:41:21 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Wed Apr 18 11:41:21 2018 -0700

----------------------------------------------------------------------
 core/sqf/monitor/linux/cluster.cxx         | 214 ++++++++++++++++++---
 core/sqf/monitor/linux/cluster.h           |   8 +-
 core/sqf/monitor/linux/nameserver.cxx      |   2 +-
 core/sqf/monitor/linux/nscommacceptmon.cxx |   5 +-
 core/sqf/monitor/linux/nscommacceptmon.h   |   2 +
 core/sqf/monitor/linux/nsreqprocinfons.cxx | 160 +++++++++++-----
 core/sqf/monitor/linux/nsreqshutdown.cxx   |  18 +-
 core/sqf/monitor/linux/pnode.cxx           | 239 +++++++++++++++++++++++-
 core/sqf/monitor/linux/pnode.h             |  16 ++
 core/sqf/monitor/linux/process.cxx         |  24 +++
 core/sqf/monitor/linux/reqtmleader.cxx     |  36 ++++
 11 files changed, 635 insertions(+), 89 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/db656603/core/sqf/monitor/linux/cluster.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/cluster.cxx b/core/sqf/monitor/linux/cluster.cxx
index e2f7dbf..4646433 100644
--- a/core/sqf/monitor/linux/cluster.cxx
+++ b/core/sqf/monitor/linux/cluster.cxx
@@ -66,6 +66,8 @@ using namespace std;
 #include "meas.h"
 #ifdef NAMESERVER_PROCESS
 #include "nscommacceptmon.h"
+#else
+#include "nameserver.h"
 #endif
 
 extern bool IAmIntegrating;
@@ -85,6 +87,7 @@ extern char MySyncPort[MPI_MAX_PORT_NAME];
 extern CCommAcceptMon CommAcceptMon;
 extern char MyMon2NsPort[MPI_MAX_PORT_NAME];
 #else
+extern CNameServer *NameServer;
 extern bool NameServerEnabled;
 extern char MyPtPPort[MPI_MAX_PORT_NAME];
 #endif
@@ -120,6 +123,8 @@ extern CReplicate Replicator;
 
 extern char *ErrorMsg (int error_code);
 
+extern const char *ProcessTypeString( PROCESSTYPE type );
+
 const char *JoiningPhaseString( JOINING_PHASE phase);
 const char *StateString( STATE state);
 #ifndef NAMESERVER_PROCESS
@@ -538,6 +543,13 @@ void CCluster::AssignTmLeader( int pnid, bool checkProcess )
 
     int TmLeaderPNid = LNode[tmLeaderNid_]->GetNode()->GetPNid();
 
+    if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+    {
+        trace_printf( "%s@%d - pnid=%d, checkProcess=%d, tmLeaderNid_=%d, TmLeaderPNid=%d\n"
+                    , method_name, __LINE__
+                    , pnid, checkProcess, tmLeaderNid_, TmLeaderPNid );
+    }
+
     if (TmLeaderPNid != pnid)
     {
         node = LNode[tmLeaderNid_]->GetNode();
@@ -561,6 +573,36 @@ void CCluster::AssignTmLeader( int pnid, bool checkProcess )
                 }
                 return;
             }
+            else
+            {
+                if (NameServerEnabled)
+                {
+                    if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+                    {
+                        trace_printf( "%s@%d - Getting process from Name Server, nid=%d, type%s\n"
+                                    , method_name, __LINE__
+                                    , tmLeaderNid_, ProcessTypeString(ProcessType_DTM) );
+                    }
+                
+                    process = Nodes->GetProcessLByTypeNs( tmLeaderNid_, ProcessType_DTM );
+                    if (process)
+                    {
+                        if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+                        {
+                            if (node)
+                                trace_printf( "%s@%d - Node pnid=%d (%s), phase=%s, "
+                                              "isSoftNodeDown=%d, checkProcess=%d\n"
+                                            , method_name, __LINE__
+                                            , node->GetPNid()
+                                            , node->GetName()
+                                            , NodePhaseString(node->GetPhase())
+                                            , node->IsSoftNodeDown()
+                                            , checkProcess );
+                        }
+                        return;
+                    }
+                }
+            }
         }
         else
         {
@@ -698,6 +740,7 @@ CCluster::CCluster (void)
       reconnectSeqNum_(0),
       seqNum_(1),
       waitForWatchdogExit_(false)
+      ,waitForNameServerExit_(false)
       ,checkSeqNum_(false)
       ,validateNodeDown_(false)
       ,enqueuedDown_(false)
@@ -1455,8 +1498,8 @@ int CCluster::HardNodeUp( int pnid, char *node_name )
     TRACE_ENTRY;
 
     if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
-       trace_printf( "%s@%d - pnid=%d, name=%s (MyPNID = %d)\n"
-                   , method_name, __LINE__, pnid, node_name, MyPNID );
+       trace_printf( "%s@%d - pnid=%d, name=%s (MyPNID = %d), currentNodes_=%d\n"
+                   , method_name, __LINE__, pnid, node_name, MyPNID, currentNodes_ );
 
     if ( pnid == -1 )
     {
@@ -3170,13 +3213,19 @@ void CCluster::InitializeConfigCluster( void )
         char *nodes = getenv( "SQ_VIRTUAL_NODES" );
         worldSize = atoi(nodes);
         if ( worldSize <= 0 )
+        {
             worldSize = 1;
+        }
     }
 #endif
     int rankToPnid[worldSize];
     CClusterConfig *clusterConfig = Nodes->GetClusterConfig();
 
+#ifdef NAMESERVER_PROCESS
+    currentNodes_ = 1;  // non-master Name Servers join set through master Name Server
+#else
     currentNodes_ = worldSize;
+#endif
 
     if ( IsRealCluster )
     {
@@ -7361,7 +7410,38 @@ bool CCluster::checkIfDone (  )
     const char method_name[] = "CCluster::checkIfDone";
     TRACE_ENTRY;
 
-    if (trace_settings & TRACE_SYNC_DETAIL)
+#ifdef NAMESERVER_PROCESS
+    int nameServerCount = 0;
+    CClusterConfig *clusterConfig = Nodes->GetClusterConfig();
+    CNameServerConfigContainer *nameServerConfig = NULL;
+
+    if (clusterConfig)
+    {
+        nameServerConfig = Nodes->GetNameServerConfig();
+        if (nameServerConfig)
+        {
+            nameServerCount = nameServerConfig->GetCount();
+        }
+    }
+
+    if (trace_settings & (TRACE_PROCESS | TRACE_PROCESS_DETAIL | TRACE_SYNC))
+        trace_printf("%s@%d - Node %d shutdown level=%d, state=%s.  Process "
+                     "count=%d, internal state=%d, currentNodes_=%d, "
+                     "local process count=%d, shutdownNameServer=%d, "
+                     "nameServerCount=%d\n",
+                     method_name, __LINE__, 
+                     MyNode->GetPNid(),
+                     MyNode->GetShutdownLevel(),
+                     StateString(MyNode->GetState()),
+                     Nodes->ProcessCount(),
+                     MyNode->getInternalState(),
+                     currentNodes_, 
+                     MyNode->GetNumProcs(),
+                     MyNode->IsShutdownNameServer(),
+                     nameServerCount );
+
+#else
+    if (trace_settings & (TRACE_PROCESS | TRACE_PROCESS_DETAIL | TRACE_SYNC))
         trace_printf("%s@%d - Node %d shutdown level=%d, state=%s.  Process "
                      "count=%d, internal state=%d, currentNodes_=%d, "
                      "local process count=%d\n",
@@ -7372,45 +7452,117 @@ bool CCluster::checkIfDone (  )
                      MyNode->getInternalState(),
                      currentNodes_, MyNode->GetNumProcs());
 
+#endif            
     // Check if we are also done
     if (( MyNode->GetState() != State_Down    ) &&
         ( MyNode->GetState() != State_Stopped )   )
     {
         if ( MyNode->GetShutdownLevel() != ShutdownLevel_Undefined )
         {
-            if ( Nodes->ProcessCount() == 0 )  // all WDTs exited
-            {
-                if (trace_settings & TRACE_SYNC)
-                   trace_printf("%s@%d - Monitor signaled to exit.\n", method_name, __LINE__);
+#ifdef NAMESERVER_PROCESS
+            if ( (Nodes->ProcessCount() <= nameServerCount )   // only Name Servers alive
+                 && (MyNode->GetNumProcs() <= MAX_PRIMITIVES ) // only My Name Server alive
+                 && MyNode->IsShutdownNameServer()   // monitor shutdown Name Server received
+                 && !MyNode->isInQuiesceState() )    // post-quiescing will
+                                                     // expire WDG (cluster)
+            {
+                if (trace_settings & (TRACE_PROCESS | TRACE_PROCESS_DETAIL | TRACE_SYNC))
+                   trace_printf("%s@%d - Name Server signaled to exit.\n", method_name, __LINE__);
                 MyNode->SetState( State_Stopped );
                 MyNode->SetInternalState(State_Ready_To_Exit);
 
                 // we need to sync one more time so other nodes see our state
                 return false;
             }
-            else if ( (Nodes->ProcessCount() <=
-                      (currentNodes_*MAX_PRIMITIVES))        // only WDGs alive
-                      && !MyNode->isInQuiesceState()    // post-quiescing will
-                                                        // expire WDG (cluster)
-                      && !waitForWatchdogExit_ )        // WDG not yet exiting
+#else
+            if ( NameServerEnabled )
             {
-                if (trace_settings & TRACE_SYNC)
-                   trace_printf("%s@%d - Stopping watchdog process.\n",
-                                method_name, __LINE__);
-
-                waitForWatchdogExit_ = true;
-                // stop the watchdog timer first
-                HealthCheck.setState(MON_STOP_WATCHDOG);
-                // let the watchdog process exit
-                HealthCheck.setState(MON_EXIT_PRIMITIVES);
+                
+                if ( Nodes->ProcessCount() == 0 )  // all Name Servers exited
+                {
+                    if (trace_settings & (TRACE_PROCESS | TRACE_PROCESS_DETAIL | TRACE_SYNC))
+                       trace_printf("%s@%d - Monitor signaled to exit.\n", method_name, __LINE__);
+                    MyNode->SetState( State_Stopped );
+                    MyNode->SetInternalState(State_Ready_To_Exit);
+    
+                    // we need to sync one more time so other nodes see our state
+                    return false;
+                }
+                else if ( (Nodes->ProcessCount() <= 
+                            (currentNodes_ * (MAX_PRIMITIVES+1)) ) // only WDGs and Name Servers alive
+                          && (MyNode->GetNumProcs() <=
+                            (MAX_PRIMITIVES+1) )                   // only WDGs and Name Servers alive
+                          && !MyNode->isInQuiesceState()    // post-quiescing will
+                                                            // expire WDG (cluster)
+                          && !waitForWatchdogExit_ )        // WDG not yet exiting
+                {
+                    if (trace_settings & (TRACE_PROCESS | TRACE_PROCESS_DETAIL | TRACE_SYNC))
+                       trace_printf("%s@%d - Stopping watchdog process. "
+                                    "(process count: cluster=%d, MyNode=%d)\n",
+                                    method_name, __LINE__,
+                                    Nodes->ProcessCount(), MyNode->ProcessCount());
+    
+                    waitForWatchdogExit_ = true;
+                    // stop the watchdog timer first
+                    HealthCheck.setState(MON_STOP_WATCHDOG);
+                    // let the watchdog process exit
+                    HealthCheck.setState(MON_EXIT_PRIMITIVES);
+                }
+                else if ( (Nodes->ProcessCount() <= 
+                            (currentNodes_ * (MAX_PRIMITIVES)) ) // only Name Servers alive
+                          && (MyNode->GetNumProcs() <=
+                            (MAX_PRIMITIVES) )                   // only Name Servers alive
+                          && !MyNode->isInQuiesceState()    // post-quiescing will
+                                                            // expire WDG (cluster)
+                          && !waitForNameServerExit_ )      // Name Server not yet exiting
+                {
+                    if (trace_settings & (TRACE_PROCESS | TRACE_PROCESS_DETAIL | TRACE_SYNC))
+                       trace_printf("%s@%d - Stopping Name Server process. "
+                                    "(process count: cluster=%d, MyNode=%d)\n",
+                                    method_name, __LINE__,
+                                    Nodes->ProcessCount(), MyNode->ProcessCount());
+    
+                    waitForNameServerExit_ = true;
+                    NameServer->ProcessShutdown();
+                }
+            }
+            else
+            {
+                if ( Nodes->ProcessCount() == 0 )  // all WDTs exited
+                {
+                    if (trace_settings & (TRACE_PROCESS | TRACE_PROCESS_DETAIL | TRACE_SYNC))
+                       trace_printf("%s@%d - Monitor signaled to exit.\n", method_name, __LINE__);
+                    MyNode->SetState( State_Stopped );
+                    MyNode->SetInternalState(State_Ready_To_Exit);
+    
+                    // we need to sync one more time so other nodes see our state
+                    return false;
+                }
+                else if ( (Nodes->ProcessCount() <=
+                          (currentNodes_*MAX_PRIMITIVES))        // only WDGs alive
+                          && !MyNode->isInQuiesceState()    // post-quiescing will
+                                                            // expire WDG (cluster)
+                          && !waitForWatchdogExit_ )        // WDG not yet exiting
+                {
+                    if (trace_settings & (TRACE_PROCESS | TRACE_PROCESS_DETAIL | TRACE_SYNC))
+                       trace_printf("%s@%d - Stopping watchdog process.\n",
+                                    method_name, __LINE__);
+    
+                    waitForWatchdogExit_ = true;
+                    // stop the watchdog timer first
+                    HealthCheck.setState(MON_STOP_WATCHDOG);
+                    // let the watchdog process exit
+                    HealthCheck.setState(MON_EXIT_PRIMITIVES);
+                }
             }
+#endif
         }
     }
     else if ( MyNode->GetShutdownLevel() != ShutdownLevel_Undefined
               && MyNode->GetState() == State_Down
               && MyNode->GetNumProcs() == 0)
     {
-        if (trace_settings & TRACE_SYNC)
+        if (trace_settings & (TRACE_PROCESS | TRACE_PROCESS_DETAIL | TRACE_SYNC))
             trace_printf("%s@%d - No processes remaining, monitor exiting.\n",
                          method_name, __LINE__);
 
@@ -8483,13 +8635,15 @@ void CCluster::InitServerSock( void )
                 , (int)((unsigned char *)addr)[3]
                 , mon2nsPort );
         MyNode->SetMon2NsPort( MyMon2NsPort );
+        MyNode->SetMon2NsSocketPort( mon2nsPort );
 
         if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
             trace_printf( "%s@%d Initialized my mon2ns comm socket port, "
-                          "pnid=%d (%s:%s) (Mon2NsCommPort=%s)\n"
+                          "pnid=%d (%s:%s) (Mon2NsPort=%s, Mon2NsSocketPort=%d)\n"
                         , method_name, __LINE__
                         , MyPNID, MyNode->GetName(), MyMon2NsPort
-                        , MyNode->GetMon2NsPort() );
+                        , MyNode->GetMon2NsPort()
+                        , MyNode->GetMon2NsSocketPort() );
 
     }
 #else
@@ -8883,7 +9037,17 @@ int CCluster::Connect( const char *portName )
     return ( sock );
 }
 
-#ifndef NAMESERVER_PROCESS
+#ifdef NAMESERVER_PROCESS
+void CCluster::ConnectToMon2NsCommSelf( void )
+{
+    const char method_name[] = "CCluster::ConnectToMon2NsCommSelf";
+    TRACE_ENTRY;
+
+    Connect( MyNode->GetMon2NsSocketPort() );
+
+    TRACE_EXIT;
+}
+#else
 void CCluster::ConnectToPtPCommSelf( void )
 {
     const char method_name[] = "CCluster::ConnectToPtPCommSelf";

http://git-wip-us.apache.org/repos/asf/trafodion/blob/db656603/core/sqf/monitor/linux/cluster.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/cluster.h b/core/sqf/monitor/linux/cluster.h
index f4f9147..49939ac 100644
--- a/core/sqf/monitor/linux/cluster.h
+++ b/core/sqf/monitor/linux/cluster.h
@@ -113,9 +113,14 @@ public:
 #endif
     int  Connect( const char *portName );
     void Connect( int socketPort );
-#ifndef NAMESERVER_PROCESS
+#ifdef NAMESERVER_PROCESS
+    void ConnectToMon2NsCommSelf( void );
+#else
     void ConnectToPtPCommSelf( void );
 #endif
+#ifdef NAMESERVER_PROCESS
+    void ConnectToMonCommSelf( void );
+#endif
     void ConnectToSelf( void );
     int  SetKeepAliveSockOpt( int sock );
     int  MkCltSock( const char *portName );
@@ -318,6 +323,7 @@ private:
     int cumulativeDelaySec_;
 
     bool waitForWatchdogExit_;    // set when watchdog exit has already been issued
+    bool waitForNameServerExit_;  // set when Name Server exit has already been issued
 
     typedef struct state_def
     {

http://git-wip-us.apache.org/repos/asf/trafodion/blob/db656603/core/sqf/monitor/linux/nameserver.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nameserver.cxx b/core/sqf/monitor/linux/nameserver.cxx
index ef67562..d367085 100644
--- a/core/sqf/monitor/linux/nameserver.cxx
+++ b/core/sqf/monitor/linux/nameserver.cxx
@@ -629,7 +629,7 @@ int CNameServer::ProcessShutdown( void )
     msgshutdown->nid = -1;
     msgshutdown->pid = -1;
     //msgshutdown->level = msgIn->u.request.u.shutdown.level;
-    msgshutdown->level = ShutdownLevel_Abrupt;
+    msgshutdown->level = ShutdownLevel_Normal;
 
     int error = SendReceive(&msg );
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/db656603/core/sqf/monitor/linux/nscommacceptmon.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nscommacceptmon.cxx b/core/sqf/monitor/linux/nscommacceptmon.cxx
index cc91eba..6282b0a 100644
--- a/core/sqf/monitor/linux/nscommacceptmon.cxx
+++ b/core/sqf/monitor/linux/nscommacceptmon.cxx
@@ -53,6 +53,7 @@ CCommAcceptMon::CCommAcceptMon()
            : accepting_(false)
            , shutdown_(false)
            , thread_id_(0)
+           , process_thread_id_(0)
 {
     const char method_name[] = "CCommAcceptMon::CCommAcceptMon";
     TRACE_ENTRY;
@@ -668,7 +669,7 @@ void CCommAcceptMon::processNewSock( int joinFd )
     Context *ctx = new Context();
     ctx->this_ = this;
     ctx->pendingFd_ = joinFd;
-    rc = pthread_create(&thread_id_, NULL, mon2nsProcess, ctx);
+    rc = pthread_create(&process_thread_id_, NULL, mon2nsProcess, ctx);
     if (rc != 0)
     {
         char buf[MON_STRING_BUF_SIZE];
@@ -777,7 +778,7 @@ void CCommAcceptMon::shutdownWork(void)
 
     // Set flag that tells the commAcceptor thread to exit
     shutdown_ = true;
-    Monitor->ConnectToSelf();
+    Monitor->ConnectToMon2NsCommSelf();
     CLock::wakeOne();
 
     if ( trace_settings & ( TRACE_NS ) )

http://git-wip-us.apache.org/repos/asf/trafodion/blob/db656603/core/sqf/monitor/linux/nscommacceptmon.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nscommacceptmon.h b/core/sqf/monitor/linux/nscommacceptmon.h
index 30daa92..41b2c9b 100644
--- a/core/sqf/monitor/linux/nscommacceptmon.h
+++ b/core/sqf/monitor/linux/nscommacceptmon.h
@@ -70,6 +70,8 @@ private:
 
     // commAccept thread's id
     pthread_t                      thread_id_;
+    // commAccept thread's id
+    pthread_t                      process_thread_id_;
 
     enum { HEURISTIC_COUNT = 10 };
 };

http://git-wip-us.apache.org/repos/asf/trafodion/blob/db656603/core/sqf/monitor/linux/nsreqprocinfons.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nsreqprocinfons.cxx b/core/sqf/monitor/linux/nsreqprocinfons.cxx
index 3be8ddb..dbbf80c 100644
--- a/core/sqf/monitor/linux/nsreqprocinfons.cxx
+++ b/core/sqf/monitor/linux/nsreqprocinfons.cxx
@@ -39,6 +39,8 @@ extern CNodeContainer *Nodes;
 extern CReplicate Replicator;
 extern int MyPNID;
 
+extern const char *ProcessTypeString( PROCESSTYPE type );
+
 CExtProcInfoNsReq::CExtProcInfoNsReq( reqQueueMsg_t msgType,
                                       int nid, int pid, int sockFd,
                                       struct message_def *msg )
@@ -55,48 +57,110 @@ CExtProcInfoNsReq::~CExtProcInfoNsReq()
 }
 
 // Copy information for a specific process into the reply message buffer.
-void CExtProcInfoNsReq::copyInfo(CProcess *process, ProcessInfoNs_reply_def &processInfo)
+void CExtProcInfoNsReq::copyInfo(CProcess *process, ProcessInfoNs_reply_def &process_info_ns)
 {
-    CProcess *parent;
+    const char method_name[] = "CNameServer::SendReceive";
+    TRACE_ENTRY;
 
-    processInfo.nid = process->GetNid();
-    processInfo.pid = process->GetPid();
-    processInfo.verifier = process->GetVerifier();
-    strncpy( processInfo.process_name, process->GetName(), MAX_PROCESS_NAME );
-    processInfo.type = process->GetType();
+    CProcess *parent;
 
-    parent = process->GetParent();
+    process_info_ns.nid = process->GetNid();
+    process_info_ns.pid = process->GetPid();
+    process_info_ns.verifier = process->GetVerifier();
+    strncpy( process_info_ns.process_name, process->GetName(), MAX_PROCESS_NAME );
+    process_info_ns.type = process->GetType();
+    parent = (process->GetParentNid() == -1 ? 
+              NULL : 
+              Nodes->GetLNode(process->GetParentNid())
+                 ->GetProcessL(process->GetParentPid()));
     if (parent)
     {
-        processInfo.parent_nid = parent->GetNid();
-        processInfo.parent_pid = parent->GetPid();
-        processInfo.parent_verifier = parent->GetVerifier();
-//        strncpy(processInfo.parent_name, parent->GetName(), MAX_PROCESS_NAME );
+        process_info_ns.parent_nid = parent->GetNid();
+        process_info_ns.parent_pid = parent->GetPid();
+        process_info_ns.parent_verifier = parent->GetVerifier();
     }
     else
     {
-        processInfo.parent_nid = -1;
-        processInfo.parent_pid = -1;
-        processInfo.parent_verifier = -1;
-//        processInfo.parent_name[0] = '\0';
+        process_info_ns.parent_nid = -1;
+        process_info_ns.parent_pid = -1;
+        process_info_ns.parent_verifier = -1;
     }
 
-    processInfo.priority = process->GetPriority();
-    processInfo.backup = process->IsBackup();
-    processInfo.state = process->GetState();
-    processInfo.unhooked = process->IsUnhooked();
-    processInfo.event_messages = process->IsEventMessages();
-    processInfo.system_messages = process->IsSystemMessages();
-    strncpy( processInfo.program, process->program(), MAX_PROCESS_PATH );
-    processInfo.pathStrId = process->pathStrId();
-    processInfo.ldpathStrId = process->ldPathStrId();
-    processInfo.programStrId = process->programStrId();
-    strncpy( processInfo.port_name, process->GetPort(), MPI_MAX_PORT_NAME );
-    processInfo.argc = process->argc();
-    memcpy( processInfo.argv, process->userArgv(), process->userArgvLen() );
-    strncpy( processInfo.infile, process->infile(), MAX_PROCESS_PATH );
-    strncpy( processInfo.outfile, process->outfile(), MAX_PROCESS_PATH );
-    processInfo.creation_time = process->GetCreationTime();
+    process_info_ns.priority = process->GetPriority();
+    process_info_ns.backup = process->IsBackup();
+    process_info_ns.state = process->GetState();
+    process_info_ns.unhooked = process->IsUnhooked();
+    process_info_ns.event_messages = process->IsEventMessages();
+    process_info_ns.system_messages = process->IsSystemMessages();
+    strncpy( process_info_ns.program, process->program(), MAX_PROCESS_PATH );
+    process_info_ns.pathStrId = process->pathStrId();
+    process_info_ns.ldpathStrId = process->ldPathStrId();
+    process_info_ns.programStrId = process->programStrId();
+    strncpy( process_info_ns.port_name, process->GetPort(), MPI_MAX_PORT_NAME );
+    process_info_ns.argc = process->argc();
+    memcpy( process_info_ns.argv, process->userArgv(), process->userArgvLen() );
+    strncpy( process_info_ns.infile, process->infile(), MAX_PROCESS_PATH );
+    strncpy( process_info_ns.outfile, process->outfile(), MAX_PROCESS_PATH );
+    process_info_ns.creation_time = process->GetCreationTime();
+    if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+    {
+        char desc[2048];
+        char* descp = desc;
+        sprintf( desc, 
+                 "process-info-ns reply:\n"
+                 "        process_info_ns.nid=%d\n"
+                 "        process_info_ns.pid=%d\n"
+                 "        process_info_ns.verifier=%d\n"
+                 "        process_info_ns.process_name=%s\n"
+                 "        process_info_ns.type=%d\n"
+                 "        process_info_ns.parent_nid=%d\n"
+                 "        process_info_ns.parent_pid=%d\n"
+                 "        process_info_ns.parent_verifier=%d\n"
+                 "        process_info_ns.priority=%d\n"
+                 "        process_info_ns.backup=%d\n"
+                 "        process_info_ns.state=%d\n"
+                 "        process_info_ns.unhooked=%d\n"
+                 "        process_info_ns.event_messages=%d\n"
+                 "        process_info_ns.system_messages=%d\n"
+                 "        process_info_ns.program=%s\n"
+                 "        process_info_ns.pathStrId=%d:%d\n"
+                 "        process_info_ns.ldpathStrId=%d:%d\n"
+                 "        process_info_ns.programStrId=%d:%d\n"
+                 "        process_info_ns.port_name=%s\n"
+                 "        process_info_ns.argc=%d\n"
+                 "        process_info_ns.infile=%s\n"
+                 "        process_info_ns.outfile=%s\n"
+                 "        process_info_ns.return_code=%d"
+                 , process_info_ns.nid
+                 , process_info_ns.pid
+                 , process_info_ns.verifier
+                 , process_info_ns.process_name
+                 , process_info_ns.type
+                 , process_info_ns.parent_nid
+                 , process_info_ns.parent_pid
+                 , process_info_ns.parent_verifier
+                 , process_info_ns.priority
+                 , process_info_ns.backup
+                 , process_info_ns.state
+                 , process_info_ns.unhooked
+                 , process_info_ns.event_messages
+                 , process_info_ns.system_messages
+                 , process_info_ns.program
+                 , process_info_ns.pathStrId.nid
+                 , process_info_ns.pathStrId.id
+                 , process_info_ns.ldpathStrId.nid
+                 , process_info_ns.ldpathStrId.id
+                 , process_info_ns.programStrId.nid
+                 , process_info_ns.programStrId.id
+                 , process_info_ns.port_name
+                 , process_info_ns.argc
+                 , process_info_ns.infile
+                 , process_info_ns.outfile
+                 , process_info_ns.return_code );
+        trace_printf( "%s@%d - %s\n"
+                    , method_name, __LINE__, descp );
+    }
+    TRACE_EXIT;
 }
 
 void CExtProcInfoNsReq::populateRequestString( void )
@@ -148,30 +212,42 @@ void CExtProcInfoNsReq::performRequest()
     target_process_name = (const char *) msg_->u.request.u.process_info.target_process_name;
     target_verifier  = msg_->u.request.u.process_info.target_verifier;
 
+    PROCESSTYPE target_type  = msg_->u.request.u.process_info.type;
+
     if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
     {
         trace_printf( "%s@%d request #%ld: ProcessInfoNs, for (%d, %d:%d), "
-                      "process type=%d\n"
+                      "process type=%s\n"
                     , method_name, __LINE__, id_
                     , target_nid, target_pid, target_verifier
-                    , msg_->u.request.u.process_info.type);
+                    , ProcessTypeString(target_type));
     }
 
-    if ( target_process_name.size() )
+    if (target_process_name.size())
     { // find by name (don't check node state, don't check process state, not backup)
         process = Nodes->GetProcess( target_process_name.c_str()
                                    , target_verifier
                                    , false, false, false );
     }
     else
-    { // find by nid (don't check node state, don't check process state, backup is Ok)
-        process = Nodes->GetProcess( target_nid
-                                   , target_pid
-                                   , target_verifier
-                                   , false, false, true );
+    {
+        if (target_pid != -1)
+        { // find by nid,pid (don't check node state, don't check process state, backup is Ok)
+            process = Nodes->GetProcess( target_nid
+                                       , target_pid
+                                       , target_verifier
+                                       , false, false, true );
+        }
+        else
+        {
+            CLNode *lnode = Nodes->GetLNode( target_nid );
+            if (lnode)
+            {
+                process = lnode->GetProcessLByType( target_type );
+            }
+        }
     }
 
-
     if (process)
     {
         msg_->u.reply.type = ReplyType_ProcessInfoNs;
@@ -182,7 +258,7 @@ void CExtProcInfoNsReq::performRequest()
     {
         if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
         {
-           trace_printf( "%s@%d - Kill %s (%d, %d:%d) -- can't find target process\n"
+           trace_printf( "%s@%d - ProcessInfoNs %s (%d, %d:%d) -- can't find target process\n"
                        , method_name, __LINE__
                        , msg_->u.request.u.process_info.target_process_name
                        , msg_->u.request.u.process_info.target_nid

http://git-wip-us.apache.org/repos/asf/trafodion/blob/db656603/core/sqf/monitor/linux/nsreqshutdown.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nsreqshutdown.cxx b/core/sqf/monitor/linux/nsreqshutdown.cxx
index 0fd6896..e5888d2 100644
--- a/core/sqf/monitor/linux/nsreqshutdown.cxx
+++ b/core/sqf/monitor/linux/nsreqshutdown.cxx
@@ -84,22 +84,12 @@ void CExtShutdownNsReq::performRequest()
                      msg_->u.request.u.shutdown.level);
     }
 
-    if ( msg_->u.request.u.shutdown.level == ShutdownLevel_Abrupt )
+    if (( MyNode->GetState() != State_Down    ) &&
+        ( MyNode->GetState() != State_Stopped )   )
     {
-        // Replicate a shutdown request so that all nodes begin to shutdown locally.
-        CReplShutdown *repl = new CReplShutdown(msg_->u.request.u.shutdown.level);
-        Replicator.addItem(repl);
-    }
-    else
-    {
-        // normal shutdown
-        // propagate the shutdown level before killing any processes.
+        MyNode->SetShutdownNameServer( true );
         MyNode->SetShutdownLevel( msg_->u.request.u.shutdown.level );
-
-        if (MyNode->GetState() == State_Up)
-        {
-            MyNode->SetState( State_Shutdown );
-        }
+        MyNode->SetState( State_Shutdown );
     }
 
     msg_->u.reply.u.generic.return_code = MPI_SUCCESS;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/db656603/core/sqf/monitor/linux/pnode.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnode.cxx b/core/sqf/monitor/linux/pnode.cxx
index b5fa4ed..033a19a 100644
--- a/core/sqf/monitor/linux/pnode.cxx
+++ b/core/sqf/monitor/linux/pnode.cxx
@@ -169,15 +169,22 @@ CNode::CNode( char *name, int pnid, int rank )
       ,tmSyncState_(SyncState_Null)
 #endif
       ,shutdownLevel_(ShutdownLevel_Undefined)
+      ,shutdownNameServer_(false)
       ,wdtKeepAliveTimerValue_(WDT_KeepAliveTimerDefault)
       ,zid_(pnid)
+      ,commPort_("")
+      ,syncPort_("")
 #ifdef NAMESERVER_PROCESS
+      ,mon2NsPort_("")
+      ,mon2NsSocketPort_(-1)
       ,monConnCount_(0)
 #else
+      ,ptpPort_("")
       ,ptpSocketPort_(-1)
 #endif
       ,commSocketPort_(-1)
       ,syncSocketPort_(-1)
+      ,uniqStrId_(-1)
       ,procStatFile_(NULL)
       ,procMeminfoFile_(-1)
 {
@@ -302,8 +309,22 @@ CNode::CNode( char *name
       ,tmSyncNid_(-1)
       ,tmSyncState_(SyncState_Suspended)
       ,shutdownLevel_(ShutdownLevel_Undefined)
+      ,shutdownNameServer_(false)
       ,wdtKeepAliveTimerValue_(WDT_KeepAliveTimerDefault)
       ,zid_(-1)
+      ,commPort_("")
+      ,syncPort_("")
+#ifdef NAMESERVER_PROCESS
+      ,mon2NsPort_("")
+      ,mon2NsSocketPort_(-1)
+      ,monConnCount_(-1)
+#else
+      ,ptpPort_("")
+      ,ptpSocketPort_(-1)
+#endif
+      ,commSocketPort_(-1)
+      ,syncSocketPort_(-1)
+      ,uniqStrId_(-1)
       ,procStatFile_(NULL)
       ,procMeminfoFile_(-1)
 {
@@ -560,8 +581,6 @@ void CNode::CheckShutdownProcessing( void )
         sprintf(buf, "Broadcasting shutdown notice, level = %d\n", shutdownLevel_);
         mon_log_write(MON_NODE_SHUTDOWN_1, SQ_LOG_WARNING, buf);
         Bcast (msg);
-        if ( NameServerEnabled )
-            NameServer->ProcessShutdown();
         delete msg;
     }
 #endif
@@ -2458,6 +2477,20 @@ void CNodeContainer::CancelDeathNotification( int nid
 }
 #endif
    
+void CNodeContainer::DeleteCloneProcess( CProcess *process )
+{
+    const char method_name[] = "CNodeContainer::DeleteCloneProcess";
+    TRACE_ENTRY;
+
+    CNode *node;
+    node = Nodes->GetLNode(process->GetNid())->GetNode();
+    node->DelFromNameMap ( process );
+    node->DelFromPidMap ( process );
+    node->DeleteFromList( process );
+
+    TRACE_EXIT;
+}
+
 void CNodeContainer::DeletedNode( CNode *node )
 {
     const char method_name[] = "CNodeContainer::DeletedNode";
@@ -3009,6 +3042,200 @@ CProcess *CNodeContainer::GetProcessByName( const char *name, bool checkstate )
 }
 
 #ifndef NAMESERVER_PROCESS
+int CNodeContainer::GetProcessInfoNs( int nid
+                                    , int pid
+                                    , Verifier_t verifier
+                                    , ProcessInfoNs_reply_def *processInfo )
+{
+    const char method_name[] = "CNodeContainer::GetProcessInfoNs";
+    TRACE_ENTRY;
+
+    int rc = MPI_SUCCESS;
+
+    struct message_def msg;
+    msg.type = MsgType_Service;
+    msg.noreply = false;
+    msg.reply_tag = REPLY_TAG;
+    msg.u.request.type = ReqType_ProcessInfoNs;
+
+    struct ProcessInfo_def *process_info = &msg.u.request.u.process_info;
+    process_info->nid = -1;
+    process_info->pid = -1;
+    process_info->verifier = -1;
+    process_info->process_name[0] = 0;
+    process_info->target_nid = nid;
+    process_info->target_pid = pid;
+    process_info->target_verifier = verifier;
+    process_info->target_process_name[0] = 0;
+    process_info->target_process_pattern[0] = 0;
+    process_info->type = ProcessType_Undefined;
+    
+    int error = NameServer->ProcessInfoNs(&msg); // in reqQueue thread (CExternalReq)
+    if (error == 0)
+    {
+        if ( (msg.type == MsgType_Service) &&
+             (msg.u.reply.type == ReplyType_ProcessInfoNs) )
+        {
+            if ( msg.u.reply.u.process_info_ns.return_code == MPI_SUCCESS )
+            {
+                *processInfo = msg.u.reply.u.process_info_ns;
+            }
+            else
+            {
+                char buf[MON_STRING_BUF_SIZE];
+                snprintf( buf, sizeof(buf),
+                          "[%s] ProcessInfo failed, rc=%d\n"
+                        , method_name, msg.u.reply.u.process_info_ns.return_code );
+                mon_log_write( MON_NODE_GETPROCESSNS_1, SQ_LOG_ERR, buf );
+            }
+            rc = msg.u.reply.u.process_info_ns.return_code;
+        }
+        else
+        {
+            char buf[MON_STRING_BUF_SIZE];
+            snprintf( buf, sizeof(buf),
+                      "[%s], Invalid MsgType(%d)/ReplyType(%d) for "
+                      "ProcessInfoNs\n"
+                    , method_name, msg.type, msg.u.reply.type );
+            mon_log_write( MON_NODE_GETPROCESSNS_2, SQ_LOG_ERR, buf );
+            rc = MPI_ERR_OP;
+        }
+    }
+    else
+    {
+        rc = MPI_ERR_OP;
+    }
+
+    TRACE_EXIT;
+    return( rc );
+}
+
+int CNodeContainer::GetProcessInfoNs( const char *name
+                                    , Verifier_t verifier
+                                    , ProcessInfoNs_reply_def *processInfo )
+{
+    const char method_name[] = "CNodeContainer::GetProcessInfoNs";
+    TRACE_ENTRY;
+
+    int rc = MPI_SUCCESS;
+
+    struct message_def msg;
+    msg.type = MsgType_Service;
+    msg.noreply = false;
+    msg.reply_tag = REPLY_TAG;
+    msg.u.request.type = ReqType_ProcessInfoNs;
+
+    struct ProcessInfo_def *process_info = &msg.u.request.u.process_info;
+    process_info->nid = -1;
+    process_info->pid = -1;
+    process_info->verifier = -1;
+    process_info->process_name[0] = 0;
+    process_info->target_nid = -1;
+    process_info->target_pid = -1;
+    process_info->target_verifier = verifier;
+    STRCPY( process_info->target_process_name, name);
+    process_info->target_process_pattern[0] = 0;
+    process_info->type = ProcessType_Undefined;
+
+    int error = NameServer->ProcessInfoNs(&msg); // in reqQueue thread (CExternalReq)
+    if (error == 0)
+    {
+        if ( (msg.type == MsgType_Service) &&
+             (msg.u.reply.type == ReplyType_ProcessInfoNs) )
+        {
+            if ( msg.u.reply.u.process_info_ns.return_code == MPI_SUCCESS )
+            {
+                *processInfo = msg.u.reply.u.process_info_ns;
+            }
+            else
+            {
+                char buf[MON_STRING_BUF_SIZE];
+                snprintf( buf, sizeof(buf),
+                          "[%s] ProcessInfo failed, rc=%d\n"
+                        , method_name, msg.u.reply.u.process_info_ns.return_code );
+                mon_log_write( MON_NODE_GETPROCESSNS_3, SQ_LOG_ERR, buf );
+            }
+            rc = msg.u.reply.u.process_info_ns.return_code;
+        }
+        else
+        {
+            char buf[MON_STRING_BUF_SIZE];
+            snprintf( buf, sizeof(buf),
+                      "[%s], Invalid MsgType(%d)/ReplyType(%d) for "
+                      "ProcessInfo\n"
+                    , method_name, msg.type, msg.u.reply.type );
+            mon_log_write( MON_NODE_GETPROCESSNS_4, SQ_LOG_ERR, buf );
+            rc = MPI_ERR_OP;
+        }
+    }
+    else
+    {
+        rc = MPI_ERR_OP;
+    }
+
+    TRACE_EXIT;
+    return( rc );
+}
+
+CProcess *CNodeContainer::GetProcessLByTypeNs( int nid, PROCESSTYPE type )
+{
+    const char method_name[] = "CNodeContainer::GetProcessLByTypeNs";
+    TRACE_ENTRY;
+
+    CProcess *process = NULL;
+
+    struct message_def msg;
+    msg.type = MsgType_Service;
+    msg.noreply = false;
+    msg.reply_tag = REPLY_TAG;
+    msg.u.request.type = ReqType_ProcessInfoNs;
+
+    struct ProcessInfo_def *processInfo = &msg.u.request.u.process_info;
+    processInfo->nid = -1;
+    processInfo->pid = -1;
+    processInfo->verifier = -1;
+    processInfo->process_name[0] = 0;
+    processInfo->target_nid = nid;
+    processInfo->target_pid = -1;
+    processInfo->target_verifier = -1;
+    processInfo->target_process_name[0] = 0;
+    processInfo->target_process_pattern[0] = 0;
+    processInfo->type = type;
+
+    int error = NameServer->ProcessInfoNs(&msg); // in reqQueue thread (CExternalReq)
+    if (error == 0)
+    {
+        if ( (msg.type == MsgType_Service) &&
+             (msg.u.reply.type == ReplyType_ProcessInfoNs) )
+        {
+            if ( msg.u.reply.u.process_info_ns.return_code == MPI_SUCCESS )
+            {
+                process = AddCloneProcess( &msg.u.reply.u.process_info_ns );
+            }
+            else
+            {
+                char buf[MON_STRING_BUF_SIZE];
+                snprintf( buf, sizeof(buf),
+                          "[%s] ProcessInfo failed, rc=%d\n"
+                        , method_name, msg.u.reply.u.process_info_ns.return_code );
+                mon_log_write( MON_NODE_GETPROCESSNS_3, SQ_LOG_ERR, buf );
+            }
+        }
+        else
+        {
+            char buf[MON_STRING_BUF_SIZE];
+            snprintf( buf, sizeof(buf),
+                      "[%s], Invalid MsgType(%d)/ReplyType(%d) for "
+                      "ProcessInfo\n"
+                    , method_name, msg.type, msg.u.reply.type );
+            mon_log_write( MON_NODE_GETPROCESSNS_4, SQ_LOG_ERR, buf );
+        }
+    }
+
+    TRACE_EXIT;
+    return( process );
+}
+
 CProcess *CNodeContainer::GetProcessNs( int nid
                                       , int pid
                                       , Verifier_t verifier )
@@ -3019,11 +3246,11 @@ CProcess *CNodeContainer::GetProcessNs( int nid
     CProcess *process = NULL;
 
     struct message_def msg;
-    memset(&msg, 0, sizeof(msg) ); // TODO: remove!
     msg.type = MsgType_Service;
     msg.noreply = false;
     msg.reply_tag = REPLY_TAG;
     msg.u.request.type = ReqType_ProcessInfoNs;
+
     struct ProcessInfo_def *processInfo = &msg.u.request.u.process_info;
     processInfo->nid = -1;
     processInfo->pid = -1;
@@ -3033,6 +3260,8 @@ CProcess *CNodeContainer::GetProcessNs( int nid
     processInfo->target_pid = pid;
     processInfo->target_verifier = verifier;
     processInfo->target_process_name[0] = 0;
+    processInfo->target_process_pattern[0] = 0;
+    processInfo->type = ProcessType_Undefined;
     
     int error = NameServer->ProcessInfoNs(&msg); // in reqQueue thread (CExternalReq)
     if (error == 0)
@@ -3076,11 +3305,11 @@ CProcess *CNodeContainer::GetProcessNs( const char *name, Verifier_t verifier )
     CProcess *process = NULL;
 
     struct message_def msg;
-    memset(&msg, 0, sizeof(msg) ); // TODO: remove!
     msg.type = MsgType_Service;
     msg.noreply = false;
     msg.reply_tag = REPLY_TAG;
     msg.u.request.type = ReqType_ProcessInfoNs;
+
     struct ProcessInfo_def *processInfo = &msg.u.request.u.process_info;
     processInfo->nid = -1;
     processInfo->pid = -1;
@@ -3090,6 +3319,8 @@ CProcess *CNodeContainer::GetProcessNs( const char *name, Verifier_t verifier )
     processInfo->target_pid = -1;
     processInfo->target_verifier = verifier;
     STRCPY( processInfo->target_process_name, name);
+    processInfo->target_process_pattern[0] = 0;
+    processInfo->type = ProcessType_Undefined;
 
     int error = NameServer->ProcessInfoNs(&msg); // in reqQueue thread (CExternalReq)
     if (error == 0)

http://git-wip-us.apache.org/repos/asf/trafodion/blob/db656603/core/sqf/monitor/linux/pnode.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnode.h b/core/sqf/monitor/linux/pnode.h
index b13fbef..44008ea 100644
--- a/core/sqf/monitor/linux/pnode.h
+++ b/core/sqf/monitor/linux/pnode.h
@@ -76,6 +76,7 @@ public:
                                    , int verifier
                                    , _TM_Txid_External trans_id );
     void    ChangedNode( CNode *node );
+    void    DeleteCloneProcess( CProcess *process );
     void    DeletedNode( CNode *node );
     bool    DeleteNode( int pnid );
     void    DeleteNode( CNode *node );
@@ -112,6 +113,15 @@ public:
                         , bool checkstate=true
                         , bool backupOk=false );
     CProcess *GetProcessByName( const char *name, bool checkstate=true );
+    int     GetProcessInfoNs( int nid
+                            , int pid
+                            , Verifier_t verifier
+                            , ProcessInfoNs_reply_def *processInfo );
+    int     GetProcessInfoNs( const char *name
+                            , Verifier_t verifier
+                            , ProcessInfoNs_reply_def *processInfo );
+    CProcess *GetProcessLByTypeNs( int nid
+                                 , PROCESSTYPE type );
     CProcess *GetProcessNs( int nid
                           , int pid
                           , Verifier_t verifier );
@@ -243,6 +253,7 @@ public:
     inline const char *GetSyncPort( void ) { return syncPort_.c_str(); }
 #ifdef NAMESERVER_PROCESS
     inline const char *GetMon2NsPort( void ) { return mon2NsPort_.c_str(); }
+    inline int   GetMon2NsSocketPort( void ) { return( mon2NsSocketPort_ ); }
     inline int GetMonConnCount( void ) { return monConnCount_; }
 #else
     inline const char *GetPtPPort( void ) { return ptpPort_.c_str(); }
@@ -271,6 +282,7 @@ public:
     inline bool  IsSpareNode( void ) { return( spareNode_ ); }
     inline bool  IsSoftNodeDown( void ) { return( internalState_ == State_SoftDown ); }
     inline bool  IsSoftNodeUp( void ) { return( internalState_ == State_SoftUp ); }
+    inline bool  IsShutdownNameServer( void ) { return( shutdownNameServer_ ); }
 
     CNode  *Link( CNode *entry );
     void    MoveLNodes( CNode *targetNode );
@@ -318,6 +330,7 @@ public:
     inline void SetSyncPort( char *syncPort) { syncPort_ = syncPort; }
 #ifdef NAMESERVER_PROCESS
     inline void SetMon2NsPort( char *mon2NsPort) { mon2NsPort_ = mon2NsPort; }
+    inline void SetMon2NsSocketPort( int mon2NsSocketPort) { mon2NsSocketPort_ = mon2NsSocketPort; }
 #else
     inline void SetPtPPort( char *ptpPort) { ptpPort_ = ptpPort; }  
     inline void SetPtPSocketPort( int ptpSocketPort) { ptpSocketPort_ = ptpSocketPort; }
@@ -326,6 +339,7 @@ public:
     inline void SetCommSocketPort( int commSocketPort) { commSocketPort_ = commSocketPort; }
     inline void SetSyncSocketPort( int syncSocketPort) { syncSocketPort_ = syncSocketPort; }
     inline void SetSpareNode( void ) { spareNode_ = true; }
+    inline void SetShutdownNameServer( bool shutdown ) { shutdownNameServer_ = shutdown; }
     inline void SetShutdownLevel( ShutdownLevel level ) { shutdownLevel_ = level; }
     void SetState( STATE state );
     inline void SetTmSyncNid( int nid ) { tmSyncNid_ = nid; }
@@ -403,6 +417,7 @@ private:
     int           tmSyncNid_;    // Logical Node of TM that initiated sync
     SyncState     tmSyncState_;  // Sync operation state with TMs
     ShutdownLevel shutdownLevel_;
+    bool          shutdownNameServer_; // true when monitor shutdown Name Server request is received
     int           wdtKeepAliveTimerValue_; // expiration time
     struct timeval todStart_;    // time of last watchdog reset
 
@@ -417,6 +432,7 @@ private:
     string        syncPort_;          // monitor socket allgather port
 #ifdef NAMESERVER_PROCESS
     string        mon2NsPort_;        // monitor to ns port
+    int           mon2NsSocketPort_;  // monitor to ns socket port
     int           monConnCount_;      // monitor connections
 #else
     string        ptpPort_;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/db656603/core/sqf/monitor/linux/process.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/process.cxx b/core/sqf/monitor/linux/process.cxx
index fce323c..5ecaf50 100644
--- a/core/sqf/monitor/linux/process.cxx
+++ b/core/sqf/monitor/linux/process.cxx
@@ -2939,6 +2939,30 @@ void CProcess::Exit( CProcess *parent )
 
     SetState(State_Stopped);
 
+    if (parent && NameServerEnabled)
+    {
+        ProcessInfoNs_reply_def processInfo;
+        int rc = Nodes->GetProcessInfoNs( parent->GetNid()
+                                        , parent->GetPid()
+                                        , parent->GetVerifier()
+                                        , &processInfo);
+        if (rc == MPI_ERR_NAME)
+        {
+            if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+            {
+                trace_printf( "%s@%d - Deleting clone process %s, (%d,%d:%d)\n"
+                            , method_name, __LINE__
+                            , parent->GetName()
+                            , parent->GetNid()
+                            , parent->GetPid()
+                            , parent->GetVerifier() );
+            }
+            Nodes->DeleteCloneProcess( parent );
+            parent = NULL;
+        }
+    
+    }
+
     // if the env is set to not deliver death messages upon node down,
     // check the state of the process' node.
     bool supplyProcessDeathNotices = true;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/db656603/core/sqf/monitor/linux/reqtmleader.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqtmleader.cxx b/core/sqf/monitor/linux/reqtmleader.cxx
index 9cfe6ea..9d4fb96 100644
--- a/core/sqf/monitor/linux/reqtmleader.cxx
+++ b/core/sqf/monitor/linux/reqtmleader.cxx
@@ -28,11 +28,13 @@
 #include "montrace.h"
 #include "monsonar.h"
 #include "monlogging.h"
+#include "nameserver.h"
 
 extern CMonStats *MonStats;
 extern CNode *MyNode;
 extern CNodeContainer *Nodes;
 extern CMonitor *Monitor;
+extern bool NameServerEnabled;
 
 CExtTmLeaderReq::CExtTmLeaderReq (reqQueueMsg_t msgType, int pid,
                                   struct message_def *msg )
@@ -117,11 +119,27 @@ void CExtTmLeaderReq::performRequest()
             Monitor->ExitSyncCycle();
         }
 
+        if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+        {
+            trace_printf( "%s@%d - tmLeaderNid=%d\n"
+                        , method_name, __LINE__, tmLeaderNid );
+        }
+
         if ( MyNode->GetShutdownLevel() == ShutdownLevel_Undefined )
         {
             CProcess *process;
 
             process = Nodes->GetLNode(tmLeaderNid)->GetProcessLByType( ProcessType_DTM );
+            if (!process && NameServerEnabled)
+            {
+                if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+                {
+                    trace_printf( "%s@%d - Getting process from Name Server, nid=%d, type=ProcessType_DTM\n"
+                                , method_name, __LINE__, tmLeaderNid );
+                }
+            
+                process = Nodes->GetProcessLByTypeNs( tmLeaderNid, ProcessType_DTM );
+            }
 
             if (!process)
             {
@@ -150,6 +168,24 @@ void CExtTmLeaderReq::performRequest()
             msg_->u.reply.u.generic.pid = process->GetPid();
             msg_->u.reply.u.generic.verifier = process->GetVerifier();
             strcpy (msg_->u.reply.u.generic.process_name, process->GetName());
+
+            if (process && NameServerEnabled)
+            {
+                if (!MyNode->IsMyNode( process->GetNid() ))
+                {
+                    if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+                    {
+                        trace_printf( "%s@%d - Deleting clone process %s, (%d,%d:%d)\n"
+                                    , method_name, __LINE__
+                                    , process->GetName()
+                                    , process->GetNid()
+                                    , process->GetPid()
+                                    , process->GetVerifier() );
+                    }
+                    Nodes->DeleteCloneProcess( process );
+                }
+            
+            }
         }
         else
         {


[12/50] [abbrv] trafodion git commit: Update.

Posted by su...@apache.org.
Update.


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

Branch: refs/heads/master
Commit: 8b025eaebf2d5085a76f770dde6a4562df7e989b
Parents: 38935a4
Author: Dave George <de...@gmail.com>
Authored: Tue Apr 3 22:57:47 2018 +0000
Committer: Dave George <de...@gmail.com>
Committed: Tue Apr 3 22:57:47 2018 +0000

----------------------------------------------------------------------
 core/sqf/monitor/linux/msgdef.h            |   3 +
 core/sqf/monitor/linux/nameserver.cxx      |   4 +
 core/sqf/monitor/linux/nscommacceptmon.cxx |  12 +
 core/sqf/monitor/linux/nsreqdelproc.cxx    |  27 +-
 core/sqf/monitor/linux/nsreqnewproc.cxx    |  24 +-
 core/sqf/monitor/linux/nsreqqueue.cxx      |   8 +-
 core/sqf/monitor/linux/process.cxx         | 350 ++++++++++++------------
 core/sqf/monitor/linux/reqprocinfo.cxx     |   2 +-
 core/sqf/monitor/linux/reqqueue.cxx        | 250 ++++++++---------
 core/sqf/src/seabed/test/Makefile          |  12 +-
 core/sqf/src/seabed/test/tdelta.cpp        | 269 ++++++++++++++++++
 core/sqf/src/seabed/test/tmerge.cpp        | 294 ++++++++++++++++++++
 12 files changed, 925 insertions(+), 330 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/8b025eae/core/sqf/monitor/linux/msgdef.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/msgdef.h b/core/sqf/monitor/linux/msgdef.h
index b76862d..8d15d68 100644
--- a/core/sqf/monitor/linux/msgdef.h
+++ b/core/sqf/monitor/linux/msgdef.h
@@ -564,6 +564,9 @@ struct NewProcessNs_def
     int   parent_nid;                       // parent's node id
     int   parent_pid;                       // parent's process id
     Verifier_t parent_verifier;             // parent's process verifier
+    int  pair_parent_nid;                   // node id of real process pair parent process
+    int  pair_parent_pid;                   // process id of real process pair parent process
+    Verifier_t pair_parent_verifier;        // process id of real process pair parent process
     int  nid;                               // node id
     int  pid;                               // process id
     Verifier_t verifier;                    // process verifier

http://git-wip-us.apache.org/repos/asf/trafodion/blob/8b025eae/core/sqf/monitor/linux/nameserver.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nameserver.cxx b/core/sqf/monitor/linux/nameserver.cxx
index 1e32972..cc1b575 100644
--- a/core/sqf/monitor/linux/nameserver.cxx
+++ b/core/sqf/monitor/linux/nameserver.cxx
@@ -559,11 +559,15 @@ int CNameServer::ProcessNew(CProcess* process )
         msgnew->parent_pid = -1;
         msgnew->parent_verifier = -1;
     }
+    msgnew->pair_parent_nid = process-> GetPairParentNid();
+    msgnew->pair_parent_pid = process-> GetPairParentPid();
+    msgnew->pair_parent_verifier = process-> GetPairParentVerifier();
     msgnew->nid = process->GetNid();
     msgnew->pid = process->GetPid();
     msgnew->verifier = process->GetVerifier();
     msgnew->type = process->GetType();
     msgnew->priority = process->GetPriority();
+    msgnew->backup = process->IsBackup();
     msgnew->event_messages = process->IsEventMessages();
     msgnew->system_messages = process->IsSystemMessages();
     strcpy( msgnew->process_name, process->GetName() );

http://git-wip-us.apache.org/repos/asf/trafodion/blob/8b025eae/core/sqf/monitor/linux/nscommacceptmon.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nscommacceptmon.cxx b/core/sqf/monitor/linux/nscommacceptmon.cxx
index 39213f7..9b60f90 100644
--- a/core/sqf/monitor/linux/nscommacceptmon.cxx
+++ b/core/sqf/monitor/linux/nscommacceptmon.cxx
@@ -252,9 +252,15 @@ void CCommAcceptMon::monReqNewProcess( struct message_def* msg, int sockFd )
                       "        msg.new_process_ns.parent_nid=%d\n"
                       "        msg.new_process_ns.parent_pid=%d\n"
                       "        msg.new_process_ns.parent_verifier=%d\n"
+                      "        msg.new_process_ns.pair_parent_nid=%d\n"
+                      "        msg.new_process_ns.pair_parent_pid=%d\n"
+                      "        msg.new_process_ns.pair_parent_verifier=%d\n"
                       "        msg.new_process_ns.nid=%d\n"
                       "        msg.new_process_ns.pid=%d\n"
                       "        msg.new_process_ns.verifier=%d\n"
+                      "        msg.new_process_ns.backup=%d\n"
+                      "        msg.new_process_ns.event_messages=%d\n"
+                      "        msg.new_process_ns.system_messages=%d\n"
                       "        msg.new_process_ns.type=%d\n"
                       "        msg.new_process_ns.priority=%d\n"
                       "        msg.new_process_ns.process_name=%s\n"
@@ -262,9 +268,15 @@ void CCommAcceptMon::monReqNewProcess( struct message_def* msg, int sockFd )
                     , msg->u.request.u.new_process_ns.parent_nid
                     , msg->u.request.u.new_process_ns.parent_pid
                     , msg->u.request.u.new_process_ns.parent_verifier
+                    , msg->u.request.u.new_process_ns.pair_parent_nid
+                    , msg->u.request.u.new_process_ns.pair_parent_pid
+                    , msg->u.request.u.new_process_ns.pair_parent_verifier
                     , msg->u.request.u.new_process_ns.nid
                     , msg->u.request.u.new_process_ns.pid
                     , msg->u.request.u.new_process_ns.verifier
+                    , msg->u.request.u.new_process_ns.backup
+                    , msg->u.request.u.new_process_ns.event_messages
+                    , msg->u.request.u.new_process_ns.system_messages
                     , msg->u.request.u.new_process_ns.type
                     , msg->u.request.u.new_process_ns.priority
                     , msg->u.request.u.new_process_ns.process_name

http://git-wip-us.apache.org/repos/asf/trafodion/blob/8b025eae/core/sqf/monitor/linux/nsreqdelproc.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nsreqdelproc.cxx b/core/sqf/monitor/linux/nsreqdelproc.cxx
index c348e7d..8de0c6a 100644
--- a/core/sqf/monitor/linux/nsreqdelproc.cxx
+++ b/core/sqf/monitor/linux/nsreqdelproc.cxx
@@ -79,7 +79,6 @@ void CExtDelProcessNsReq::performRequest()
 {
     bool status = FAILURE;
     CProcess *process = NULL;
-    CProcess *backup = NULL;
 
     const char method_name[] = "CExtDelProcessNsReq::performRequest";
     TRACE_ENTRY;
@@ -120,27 +119,11 @@ void CExtDelProcessNsReq::performRequest()
     target_process_name = (const char *) msg_->u.request.u.del_process_ns.target_process_name;
     target_verifier  = msg_->u.request.u.del_process_ns.target_verifier;
 
-    if ( target_process_name.size() )
-    { // find by name (don't check node state, don't check process state, not backup)
-        process = Nodes->GetProcess( target_process_name.c_str()
-                                   , target_verifier
-                                   , false, false, false );
-        if ( process &&
-            (msg_->u.request.u.del_process_ns.target_nid == -1 ||
-             msg_->u.request.u.del_process_ns.target_pid == -1))
-        {
-            backup = process->GetBackup ();
-        }
-    }
-    else
-    { // find by nid (don't check node state, don't check process state, backup is Ok)
-        process = Nodes->GetProcess( target_nid
-                                   , target_pid
-                                   , target_verifier
-                                   , false, false, true );
-        backup = NULL;
-    }
-
+    // find by nid (don't check node state, don't check process state, backup is Ok)
+    process = Nodes->GetProcess( target_nid
+                               , target_pid
+                               , target_verifier
+                               , false, false, true );
 
     if (process)
     {

http://git-wip-us.apache.org/repos/asf/trafodion/blob/8b025eae/core/sqf/monitor/linux/nsreqnewproc.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nsreqnewproc.cxx b/core/sqf/monitor/linux/nsreqnewproc.cxx
index 105ff95..76d289c 100644
--- a/core/sqf/monitor/linux/nsreqnewproc.cxx
+++ b/core/sqf/monitor/linux/nsreqnewproc.cxx
@@ -76,19 +76,39 @@ void CExtNewProcNsReq::performRequest()
     CNode *node;
     CLNode *parent_lnode;
     CNode *parent_node;
+    CProcess *parent;
     int result;
     lnode = Nodes->GetLNode( nid_ );
     node = lnode->GetNode();
     parent_lnode = Nodes->GetLNode( msg_->u.request.u.new_process_ns.parent_nid );
-    parent_node = NULL;
     if ( parent_lnode )
         parent_node = parent_lnode->GetNode();
+    else
+        parent_node = NULL;
     strId_t pathStrId = node->GetStringId ( msg_->u.request.u.new_process_ns.path );
     strId_t ldpathStrId = node->GetStringId (msg_->u.request.u.new_process_ns.ldpath );
     strId_t programStrId = node->GetStringId ( msg_->u.request.u.new_process_ns.program );
-    CProcess *parent = NULL;
     if ( parent_node )
         parent = parent_node->GetProcess( msg_->u.request.u.new_process_ns.parent_pid );
+    else
+        parent = NULL;
+    if ( parent )
+    {
+        int parentVerifier = msg_->u.request.u.new_process_ns.parent_verifier;
+
+        if ( (parentVerifier == -1) || 
+             (parentVerifier == parent->GetVerifier()) )
+        {
+            if ( msg_->u.request.u.new_process_ns.backup && 
+                (parent->GetPairParentNid() == -1 && 
+                 parent->GetPairParentPid() == -1))
+            {
+                parent->SetPairParentNid( msg_->u.request.u.new_process_ns.pair_parent_nid );
+                parent->SetPairParentPid( msg_->u.request.u.new_process_ns.pair_parent_pid );
+                parent->SetPairParentVerifier( msg_->u.request.u.new_process_ns.pair_parent_verifier );
+            }
+        }
+    }
     CProcess *process = node->CreateProcess ( parent,
                                               msg_->u.request.u.new_process_ns.nid,
                                               msg_->u.request.u.new_process_ns.pid,

http://git-wip-us.apache.org/repos/asf/trafodion/blob/8b025eae/core/sqf/monitor/linux/nsreqqueue.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nsreqqueue.cxx b/core/sqf/monitor/linux/nsreqqueue.cxx
index aeb1d53..f741b85 100644
--- a/core/sqf/monitor/linux/nsreqqueue.cxx
+++ b/core/sqf/monitor/linux/nsreqqueue.cxx
@@ -53,16 +53,16 @@ void CRequest::monreply(struct message_def *msg, int sockFd, int *error)
             size += sizeof(struct DelProcessNs_reply_def);
             if (trace_settings & (TRACE_NS | TRACE_PROCESS_DETAIL))
             {
-                trace_printf("%s@%d reply type=%d(DelProcessNs), size=%d, sock=%d\n", method_name, __LINE__,
-                             msg->u.reply.type, size, sockFd);
+                trace_printf("%s@%d reply type=%d(DelProcessNs), size=%d, sock=%d, rc=%d\n", method_name, __LINE__,
+                             msg->u.reply.type, size, sockFd, msg->u.reply.u.del_process_ns.return_code);
             }
             break;
         case ReplyType_NewProcessNs:
             size += sizeof(struct NewProcessNs_reply_def);
             if (trace_settings & (TRACE_NS | TRACE_PROCESS_DETAIL))
             {
-                trace_printf("%s@%d reply type=%d(NewProcessNs), size=%d, sock=%d\n", method_name, __LINE__,
-                             msg->u.reply.type, size, sockFd);
+                trace_printf("%s@%d reply type=%d(NewProcessNs), size=%d, sock=%d, rc=%d\n", method_name, __LINE__,
+                             msg->u.reply.type, size, sockFd, msg->u.reply.u.new_process_ns.return_code);
             }
             break;
         case ReplyType_ProcessInfo:

http://git-wip-us.apache.org/repos/asf/trafodion/blob/8b025eae/core/sqf/monitor/linux/process.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/process.cxx b/core/sqf/monitor/linux/process.cxx
index fffd750..29a115b 100644
--- a/core/sqf/monitor/linux/process.cxx
+++ b/core/sqf/monitor/linux/process.cxx
@@ -162,7 +162,7 @@ CProcess::CProcess (CProcess * parent, int nid, int pid,
     Parent (parent),
     PairParentNid (-1),
     PairParentPid (-1),
-    PairParentVerifier (-1), 
+    PairParentVerifier (-1),
     ReplyTag (REPLY_TAG),           // will be set again when we have a pending reply
     OpenedCount (0),
     LastNid (nid),
@@ -170,7 +170,7 @@ CProcess::CProcess (CProcess * parent, int nid, int pid,
     DumpStatus (Dump_Success),
     DumperNid (-1),
     DumperPid (-1),
-    DumperVerifier (-1), 
+    DumperVerifier (-1),
     priorPid_ (0),
     State_ (State_Unknown),
     next_(NULL),
@@ -477,12 +477,12 @@ bool CProcess::CancelDeathNotification( int nid
 
     while( notice )
     {
-        if ((( notice->Nid == nid    ) && 
-             ( notice->Pid == pid    ) && 
-             ( notice->verifier_ == verifier ) && 
+        if ((( notice->Nid == nid    ) &&
+             ( notice->Pid == pid    ) &&
+             ( notice->verifier_ == verifier ) &&
              ( isInvalid( trans_id ) || isEqual( notice->TransID, trans_id )))
          || (( nid == -1 || pid == -1             ) &&
-             ( isEqual(notice->TransID, trans_id) ) ) ) 
+             ( isEqual(notice->TransID, trans_id) ) ) )
         {
             next = notice->GetNext();
 
@@ -529,7 +529,7 @@ bool CProcess::CancelDeathNotification( int nid
 
 #ifndef NAMESERVER_PROCESS
 // Death notice registration for a process
-bool CProcess::procExitReg(CProcess *targetProcess, 
+bool CProcess::procExitReg(CProcess *targetProcess,
                            _TM_Txid_External transId)
 {
     const char method_name[] = "CProcess::ProcExitReg";
@@ -549,7 +549,7 @@ bool CProcess::procExitReg(CProcess *targetProcess,
         deathInterest_.push_back ( target );
         deathInterestLock_.unlock();
 
-        // Register interest with the target process 
+        // Register interest with the target process
         targetProcess->RegisterDeathNotification( Nid
                                                 , Pid
                                                 , Verifier
@@ -569,7 +569,7 @@ bool CProcess::procExitReg(CProcess *targetProcess,
                          transId.txid[3] );
         }
     }
-    
+
 
     TRACE_EXIT;
     return status;
@@ -712,7 +712,7 @@ void CProcess::CompleteDump(DUMPSTATUS status, char *core_file)
                 parentContext( NULL );
             }
         }
-    }                                                                                                     
+    }
 
     DumpState = Dump_Ready;
 
@@ -782,7 +782,7 @@ void CProcess::CompleteProcessStartup (char *port, int os_pid, bool event_messag
         {
              Devices->CreateDevice( this );
         }
-        
+
         if ((Type == ProcessType_TSE) ||
             (Type == ProcessType_DTM) ||
             (Type == ProcessType_ASE) )
@@ -797,7 +797,7 @@ void CProcess::CompleteProcessStartup (char *port, int os_pid, bool event_messag
             (Type == ProcessType_ASE) )
         {
              MyNode->addToQuiesceExitPids( GetPid(), GetVerifier() );
-            
+
              if (trace_settings & (TRACE_SYNC_DETAIL | TRACE_PROCESS_DETAIL | TRACE_REQUEST_DETAIL))
                  trace_printf("%s%d: pid %d added to quiesce exit list\n", method_name, __LINE__, GetPid());
         }
@@ -823,8 +823,8 @@ void CProcess::CompleteProcessStartup (char *port, int os_pid, bool event_messag
         if ( MyNode->GetShutdownLevel() == ShutdownLevel_Abrupt )
         {
             // killing the process will not remove the process object because
-            // exit processing will get queued until this completes. 
-            kill( Pid, SIGKILL ); 
+            // exit processing will get queued until this completes.
+            kill( Pid, SIGKILL );
             if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
                 trace_printf( "%s@%d - Shutdown abrupt in process, completed kill for %s (%d, %d)\n"
                             , method_name, __LINE__, Name, Nid, os_pid);
@@ -860,22 +860,22 @@ void CProcess::CompleteProcessStartup (char *port, int os_pid, bool event_messag
         ssmpNoticesLock_.unlock();
 
         if ( Type == ProcessType_SMS )
-        {  
+        {
             // let healthcheck thread know that the SMService process is up and running.
-            HealthCheck.setState(HC_UPDATE_SMSERVICE, (long long)this); 
+            HealthCheck.setState(HC_UPDATE_SMSERVICE, (long long)this);
         }
         if ( Type == ProcessType_Watchdog )
-        {  
+        {
             // let healthcheck thread know that the watchdog process is up and running.
-            HealthCheck.setState(HC_UPDATE_WATCHDOG, (long long)this); 
+            HealthCheck.setState(HC_UPDATE_WATCHDOG, (long long)this);
             // start the watchdog timer
             HealthCheck.setState(MON_START_WATCHDOG);
         }
-        if ( Type == ProcessType_PSD && 
+        if ( Type == ProcessType_PSD &&
             (IAmIntegrated || MyNode->IsActivatingSpare() || MyNode->IsSoftNodeDown()) )
         {
              MyNode->StartPStartDPersistent();
-            
+
              if (trace_settings & (TRACE_RECOVERY | TRACE_REQUEST | TRACE_INIT))
                  trace_printf("%s%d: Sent start persistent processes event to PSD process %s (pid=%d)\n", method_name, __LINE__, GetName(), GetPid());
         }
@@ -917,7 +917,7 @@ void CProcess::CompleteRequest( int status )
             msg->u.reply.u.generic.verifier = Verifier;
             msg->u.reply.u.generic.process_name[0] = '\0';
             msg->u.reply.u.generic.return_code = status;
-    
+
             CRequest::lioreply (msg, Pid);
             parentContext( NULL );
         }
@@ -974,7 +974,7 @@ bool CProcess::PickStdfile(PickStdFile_t whichStdfile,
         if (node)
         {
             ancestor = node->GetProcessL(nextPid);
-            if ( ancestor  &&  
+            if ( ancestor  &&
                  (( ! MyNode->IsMyNode(ancestor->GetNid())) ||
                   (ancestor->CreationTime.tv_sec  < earlyCreationTime.tv_sec ||
                    (ancestor->CreationTime.tv_sec == earlyCreationTime.tv_sec  &&
@@ -1312,7 +1312,7 @@ void CProcess::SetupPipe(int orig_fd, int unused_pipe_fd, int pipe_fd)
     }
 
     // Duplicate pipe file desciptor to original file descriptor number
-    newfd = dup2(pipe_fd, orig_fd);    
+    newfd = dup2(pipe_fd, orig_fd);
     if (newfd == -1)
     {
         snprintf(buf, sizeof(buf), "[%s], dup2(%d, %d) error, %s.\n",
@@ -1674,7 +1674,7 @@ bool CProcess::Create (CProcess *parent, int & result)
     setEnvStrVal ( childEnv, nextEnv, "MPI_ERROR_LEVEL", mpi_error_level );
 
     setEnvStr ( childEnv, nextEnv, "MPI_RDMA_MSGSIZE=32768,131072,4194304" );
- 
+
     setEnvStr ( childEnv, nextEnv, "HPMP_SQ=1" );
 
     setEnvStr ( childEnv, nextEnv, "MALLOC_ARENA_MAX=1" );
@@ -1998,7 +1998,7 @@ bool CProcess::Create (CProcess *parent, int & result)
     argv[j + 7] = new char[6];
     sprintf (argv[j + 7], "%5.5d", MyNode->GetZone());
 
-    SetVerifier();
+    SetVerifier(); // CProcess::Create
     argv[j + 8] = new char[6];
     sprintf (argv[j + 8], "%5.5d", Verifier);
 
@@ -2098,7 +2098,7 @@ bool CProcess::Create (CProcess *parent, int & result)
     int pipefd[2];
     pipe(pipefd);
     bool childGoAway = false;
-        
+
     SetCreationTime(-1);
     os_pid = fork ();
     if (os_pid == -1)
@@ -2120,11 +2120,11 @@ bool CProcess::Create (CProcess *parent, int & result)
         }
 
         // check if process already exists with the same pid.
-        if (MyNode->GetProcess(os_pid) != NULL) 
+        if (MyNode->GetProcess(os_pid) != NULL)
         {
             rc = result = MPI_ERR_SPAWN;
             // tell the child to go away
-            childGoAway = true; 
+            childGoAway = true;
             snprintf(la_buf, sizeof(la_buf),
                   "[%s], pid already exists, aborting process create: pid = %d\n",
                   method_name, os_pid );
@@ -2133,11 +2133,11 @@ bool CProcess::Create (CProcess *parent, int & result)
 
         // tell the child to stay or go away
         close(pipefd[0]); // close the read-end of the pipe, not going to use
-        write(pipefd[1], &childGoAway, sizeof(childGoAway)); 
-        close(pipefd[1]); // close the write-end of the pipe, sending EOF. 
+        write(pipefd[1], &childGoAway, sizeof(childGoAway));
+        close(pipefd[1]); // close the write-end of the pipe, sending EOF.
 
-        if (childGoAway) 
-        {   // no need to continue connecting with child 
+        if (childGoAway)
+        {   // no need to continue connecting with child
             goto forkExit;
         }
 
@@ -2155,7 +2155,7 @@ bool CProcess::Create (CProcess *parent, int & result)
         //       descriptors monitored.
         if (pfds_stdin[1] != -1)
         {
-            close(pfds_stdin[0]);  
+            close(pfds_stdin[0]);
 
             // Decide on standard input source for the
             // process.  It will either be a filename on this node
@@ -2186,7 +2186,7 @@ bool CProcess::Create (CProcess *parent, int & result)
         //       descriptors monitored.
         if (pfds_stdout[0] != -1)
         {
-            close(pfds_stdout[1]);  
+            close(pfds_stdout[1]);
 
             // Decide on standard output destination for the
             // process.  It will either be a filename on this node
@@ -2259,10 +2259,10 @@ bool CProcess::Create (CProcess *parent, int & result)
         int sem_rc;
         struct timeval logTime;
         struct tm *ltime;
-        
+
         gettimeofday(&logTime, NULL);
         ltime = localtime(&logTime.tv_sec);
-        
+
         struct timespec ts;
         ts.tv_sec  = 1;
         ts.tv_nsec = 0;
@@ -2306,13 +2306,13 @@ bool CProcess::Create (CProcess *parent, int & result)
             write (2, la_buf, strlen(la_buf));
         }
 
-        // check if monitor wanted child to stay or go away 
+        // check if monitor wanted child to stay or go away
         close(pipefd[1]); // close the write-end, not going to use
         // read till EOF
-        while (read(pipefd[0], &childGoAway, sizeof(childGoAway)) > 0); 
+        while (read(pipefd[0], &childGoAway, sizeof(childGoAway)) > 0);
         close(pipefd[0]); // close the read-end of the pipe
 
-        if (childGoAway) 
+        if (childGoAway)
         {
             _exit( ENOEXEC );
         }
@@ -2361,7 +2361,7 @@ bool CProcess::Create (CProcess *parent, int & result)
         size_t len;
         len = strlen(filename) + 1;
 
-        // Allocate space to hold the pathnames + filename 
+        // Allocate space to hold the pathnames + filename
         size_t alloclen;
         alloclen = pathlen + len + 1;
         name = new char[alloclen];
@@ -2398,7 +2398,7 @@ bool CProcess::Create (CProcess *parent, int & result)
 
             // Try to execute this name.  If it works, execve will not return.
             execve( startp, argv, childEnv);
-            
+
             switch  (errno)
             {
             case EACCES:
@@ -2580,7 +2580,7 @@ bool CProcess::Dump (CProcess *dumper, char *core_path)
 #ifndef NAMESERVER_PROCESS
 static void cprocess_dump_cb(void *ctx, pid_t pid, int status)
 {
-    CLNode   *lnode = static_cast<CLNode *>(ctx); 
+    CLNode   *lnode = static_cast<CLNode *>(ctx);
     lnode->DumpCallback( lnode->GetNid(), pid, status );
 }
 #endif
@@ -2639,7 +2639,7 @@ void CProcess::DumpBegin (int nid, int pid, Verifier_t verifier, char *core_path
                 Pid,
                 cmd);
         corefile_ = core_file;
-        
+
         if (trace_settings & TRACE_PROCESS)
             trace_printf("%s@%d - starting mondump for pid=%d, core-file=%s\n",
                          method_name, __LINE__, Pid, core_file);
@@ -2656,7 +2656,7 @@ void CProcess::DumpBegin (int nid, int pid, Verifier_t verifier, char *core_path
            argv[4] = getenv("MPI_TMPDIR");
            argv[5] = NULL;
         }
-        CLNode   *lnode = Nodes->GetLNode( Nid ); 
+        CLNode   *lnode = Nodes->GetLNode( Nid );
         err = IntProcess.create(argv[0],
                                 argv,
                                 cprocess_dump_cb, // cb
@@ -2695,7 +2695,7 @@ void CProcess::DumpBegin (int nid, int pid, Verifier_t verifier, char *core_path
 const char *DumpStateString( DUMPSTATE state)
 {
     const char *str;
-    
+
     switch( state )
     {
         case Dump_Unknown:
@@ -2751,7 +2751,7 @@ struct message_def * CProcess::DeathMessage( )
 
     const char method_name[] = "CProcess::DeathMessage";
     TRACE_ENTRY;
-    
+
     // Record statistics (sonar counters)
     if (sonar_verify_state(SONAR_ENABLED | SONAR_MONITOR_ENABLED))
        MonStats->notice_death_Incr();
@@ -2803,7 +2803,7 @@ void CProcess::Exit( CProcess *parent )
     // check the state of the process' node.
     bool supplyProcessDeathNotices = true;
     if (!Monitor->IsNodeDownDeathNotices())
-    { 
+    {
         CNode * node = Nodes->GetLNode(GetNid())->GetNode();
         // if process' node is being killed, do not supply process death notices
         supplyProcessDeathNotices = node->IsSoftNodeDown()
@@ -2821,7 +2821,7 @@ void CProcess::Exit( CProcess *parent )
         NoticeHead->NotifyAll();
     }
 #endif
-    
+
     if ( !Clone && !Paired )
     {
         switch (Type)
@@ -2840,12 +2840,12 @@ void CProcess::Exit( CProcess *parent )
                 {
                     if (MyNode->isQuiesceExitPidsEmpty())
                     {
-                        HealthCheck.setState(MON_SCHED_NODE_DOWN);  // schedule a node down req 
+                        HealthCheck.setState(MON_SCHED_NODE_DOWN);  // schedule a node down req
                     }
                 }
 #endif
                 else
-                {   // unmount volumes only if node is not quiescing. 
+                {   // unmount volumes only if node is not quiescing.
 #ifndef NAMESERVER_PROCESS
                     Devices->UnMountVolume( Name, Backup );
 #endif
@@ -2985,7 +2985,7 @@ void CProcess::Exit( CProcess *parent )
                 // No special handling needed on exit
                 break;
             default:
-             
+
                 snprintf(la_buf, sizeof(la_buf),
                          "[CProcess::Exit], Invalid process type!\n");
                 mon_log_write(MON_PROCESS_EXIT_1, SQ_LOG_ERR, la_buf);
@@ -2996,7 +2996,7 @@ void CProcess::Exit( CProcess *parent )
         {
             parent->childRemove( Nid, Pid);
         }
-    
+
         // Check if we need to output a entry into the process id map log file
         if ( PidMap )
         {
@@ -3007,12 +3007,12 @@ void CProcess::Exit( CProcess *parent )
                                          parent ? parent->GetVerifier() : -1,
                                          program() );
 #endif
-        }    
+        }
     }
     if ( Clone && Pid != -1 )
     {
-        if ( Type == ProcessType_SPX && 
-             MyNode->GetShutdownLevel() == ShutdownLevel_Undefined && 
+        if ( Type == ProcessType_SPX &&
+             MyNode->GetShutdownLevel() == ShutdownLevel_Undefined &&
              supplyProcessDeathNotices )
         {
             // Send local SPX this SPX's death message
@@ -3052,7 +3052,7 @@ void CProcess::Exit( CProcess *parent )
                         , ProcessTypeString(GetType()), NodePhaseString( MyNode->GetPhase() )
                         , supplyProcessDeathNotices );
 
-        if ( Type == ProcessType_DTM && 
+        if ( Type == ProcessType_DTM &&
              MyNode->GetPhase() == Phase_Ready &&
              supplyProcessDeathNotices )
         {
@@ -3090,10 +3090,10 @@ void CProcess::Exit( CProcess *parent )
 
     if ( parent && !parent->IsClone() && Pid != -1 )
     {
-    
+
         // If process and parent are DTMs suppress death
         // message here, it was delivered above
-        if ( parent->IsSystemMessages()   && 
+        if ( parent->IsSystemMessages()   &&
              parent->GetState() == State_Up &&
              !MyNode->IsKillingNode() &&
              !(GetType() == ProcessType_DTM &&
@@ -3127,7 +3127,7 @@ void CProcess::Exit( CProcess *parent )
 void CProcess::GenerateEvent( int event_id, int length, char *data )
 {
     struct message_def *msg;
-    
+
     const char method_name[] = "CProcess::GenerateEvent";
     TRACE_ENTRY;
     if( Clone )
@@ -3202,7 +3202,7 @@ CProcess *CProcess::GetProcessByType( PROCESSTYPE type )
         if (entry->Type == type)
         {
             // Only return entry if it has completed startup
-            if (entry->State_ != State_Up) 
+            if (entry->State_ != State_Up)
             {
                 entry = NULL;
             }
@@ -3228,7 +3228,7 @@ CProcess *CProcess::GetProcessLByType( PROCESSTYPE type )
         if (entry->Type == type)
         {
             // Only return entry if it has completed startup
-            if (entry->State_ != State_Up) 
+            if (entry->State_ != State_Up)
             {
                 entry = NULL;
             }
@@ -3385,7 +3385,7 @@ bool CProcess::Open (CProcess * opened_process, int death_notification)
     if ((opened_process->StartupCompleted) &&
         (opened_process->State_ == State_Up) && (State_ == State_Up))
     {
-        if ( death_notification 
+        if ( death_notification
              && !((opened_process->Parent_Nid == Nid) &&
                   (opened_process->Parent_Pid == Pid)) )
         {
@@ -3405,7 +3405,7 @@ bool CProcess::Open (CProcess * opened_process, int death_notification)
         snprintf(buf, sizeof(buf), "[CProcess::Open], Can't Open Process %s "
                  "has not completed startup protocol!\n", opened_process->Name);
         mon_log_write(MON_PROCESS_OPEN_1, SQ_LOG_ERR, buf);
-       
+
         status = FAILURE;
     }
     TRACE_EXIT;
@@ -3445,10 +3445,10 @@ CNotice *CProcess::RegisterDeathNotification( int nid
                                             , _TM_Txid_External trans_id )
 {
     CNotice *notice = NULL;
-    
+
     const char method_name[] = "CProcess::RegisterDeathNotification";
     TRACE_ENTRY;
-    
+
     deathInterestLock_.lock();
 
     if ( NoticeHead )
@@ -3646,7 +3646,7 @@ CProcessContainer::CProcessContainer (void)
 
     // Add eyecatcher sequence as a debugging aid
     memcpy(&eyecatcher_, "PCTR", 4);
-    
+
     //create & initialize existing semaphore
     char sem_name[MAX_PROCESS_PATH];
     snprintf(sem_name,sizeof(sem_name), "/monitor.sem.%s", getenv("USER"));
@@ -3661,7 +3661,7 @@ CProcessContainer::CProcessContainer (void)
         sem_unlink(sem_name);
         abort();
     }
-    
+
     TRACE_EXIT;
 }
 
@@ -3675,10 +3675,10 @@ CProcessContainer::CProcessContainer( bool nodeContainer )
 {
     const char method_name[] = "CProcessContainer::CProcessContainer";
     TRACE_ENTRY;
- 
+
     // Add eyecatcher sequence as a debugging aid
     memcpy(&eyecatcher_, "PCTR", 4);
-   
+
     //create & initialize existing semaphore
     char sem_name[MAX_PROCESS_PATH];
     snprintf(sem_name,sizeof(sem_name), "/monitor.sem.%s", getenv("USER"));
@@ -3701,7 +3701,7 @@ CProcessContainer::CProcessContainer( bool nodeContainer )
         }
         abort();
     }
-    
+
     if ( nodeContainer_ )
     {
         nameMap_ = new nameMap_t;
@@ -3715,7 +3715,7 @@ CProcessContainer::~CProcessContainer (void)
 {
     const char method_name[] = "CProcessContainer::~CProcessContainer";
     TRACE_ENTRY;
-    
+
     if ( nodeContainer_ )
     {
         CleanUpProcesses();
@@ -3736,7 +3736,7 @@ CProcessContainer::~CProcessContainer (void)
 
     // Alter eyecatcher sequence as a debugging aid to identify deleted object
     memcpy(&eyecatcher_, "pctr", 4);
-    
+
     TRACE_EXIT;
 }
 
@@ -3862,7 +3862,7 @@ void CProcessContainer::AddToNameMap( CProcess *process )
             // necessarily an error.  One sceario where this can happen is
             // if a new process request contains a user assigned process
             // name and the process is to be created on another node.
-            // When the InternalType_ProcInit replication message is 
+            // When the InternalType_ProcInit replication message is
             // processed on the originating node we'll attempt to re-add
             // the name (a system generated name will be added for the first
             // time at this point.)
@@ -3904,7 +3904,7 @@ void CProcessContainer::DelFromNameMap( CProcess *process )
         if (trace_settings & (TRACE_PROCESS | TRACE_PROCESS_DETAIL))
         {
             trace_printf("%s@%d not removing from nameMap %p: %s (%d, %d)."
-                         "  No such mapping\n", 
+                         "  No such mapping\n",
                          method_name, __LINE__, nameMap_,
                          process->GetName(), process->GetNid(), process->GetPid());
         }
@@ -3916,7 +3916,7 @@ void CProcessContainer::DelFromNameMap( CProcess *process )
         if (trace_settings & (TRACE_PROCESS | TRACE_PROCESS_DETAIL))
         {
             trace_printf("%s@%d not removing from nameMap %p: %s (%d, %d)."
-                         "  Map contains %s (%d, %d)\n", 
+                         "  Map contains %s (%d, %d)\n",
                          method_name, __LINE__, nameMap_,
                          process->GetName(), process->GetNid(), process->GetPid(),
                          p2->GetName(), p2->GetNid(), p2->GetPid());
@@ -3974,7 +3974,7 @@ void CProcessContainer::AddToList(CProcess *process)
         // link it to the CLNode container
         CLNode *lnode = Nodes->GetLNode( process->Nid );
         lnode->AddToListL( process );
-        
+
         if (trace_settings & (TRACE_PROCESS_DETAIL))
         {
             CNode *node = lnode->GetNode();
@@ -3988,7 +3988,7 @@ void CProcessContainer::AddToList(CProcess *process)
         }
 
     }
-    
+
     TRACE_EXIT;
 }
 
@@ -4050,10 +4050,10 @@ void CProcessContainer::AttachProcessCheck ( struct message_def *msg )
         mon_log_write(MON_PROCESSCONT_ATTACHPCHECK_1, SQ_LOG_ERR, la_buf);
 
         abort(); // TODO: revisit
-    } else if ((MyNode->GetState() != State_Up && 
-                MyNode->GetState() != State_Shutdown) && 
+    } else if ((MyNode->GetState() != State_Up &&
+                MyNode->GetState() != State_Shutdown) &&
                ( strcmp(msg->u.request.u.startup.program,"shell")!=0 )   )
-    { 
+    {
         // Check if we can accept a connection
         snprintf(la_buf, sizeof(la_buf), "[%s], Can't accept %s because node is logically down\n", method_name, msg->u.request.u.startup.process_name);
         mon_log_write(MON_PROCESSCONT_ATTACHPCHECK_1, SQ_LOG_ERR, la_buf);
@@ -4064,8 +4064,8 @@ void CProcessContainer::AttachProcessCheck ( struct message_def *msg )
         msg->u.reply.u.generic.verifier = -1;
         msg->u.reply.u.generic.process_name[0] = '\0';
         msg->u.reply.u.generic.return_code = MPI_ERR_OP;
-    }        
-    
+    }
+
     // shell is trying to attach across all nodes
     else if (msg->u.request.u.startup.paired)
     {
@@ -4140,7 +4140,7 @@ void CProcessContainer::AttachProcessCheck ( struct message_def *msg )
                     strId_t progStrId = MyNode->GetStringId( msg->u.request.u.startup.program );
                     strId_t nullStrId = { -1, -1 };
                     process =
-                        new CProcess( NULL, nid, msg->u.request.u.startup.os_pid, ProcessType_Generic, 0, 0, false, true, (char *) "", 
+                        new CProcess( NULL, nid, msg->u.request.u.startup.os_pid, ProcessType_Generic, 0, 0, false, true, (char *) "",
                         nullStrId, nullStrId, progStrId, (char *) "", (char *) "" );
                     if ( process == NULL )
                     {
@@ -4161,15 +4161,15 @@ void CProcessContainer::AttachProcessCheck ( struct message_def *msg )
                     }
                     else
                     {
-                        process->SetName( 
+                        process->SetName(
                             MyNode->NormalizeName( msg->u.request.u.startup.process_name ) );
                     }
                     process->SetAttached( true );
                     process->SetupFifo( process->GetNid( ), msg->u.request.u.startup.os_pid );
                     process->SetCreationTime( msg->u.request.u.startup.os_pid );
-                    process->SetVerifier( );
+                    process->SetVerifier( ); // CProcessContainer::AttachProcessCheck
                     AddToList( process );
-                    process->CompleteProcessStartup( msg->u.request.u.startup.port_name,
+                    process->CompleteProcessStartup( msg->u.request.u.startup.port_name, // CProcessContainer::AttachProcessCheck
                                                      msg->u.request.u.startup.os_pid,
                                                      msg->u.request.u.startup.event_messages,
                                                      msg->u.request.u.startup.system_messages,
@@ -4228,7 +4228,7 @@ void CProcessContainer::AttachProcessCheck ( struct message_def *msg )
             msg->u.reply.u.generic.process_name[0] = '\0';
             msg->u.reply.u.generic.return_code = MPI_ERR_NAME;
         }
-    }  
+    }
     // complete a monitor child process startup
     else
     {
@@ -4272,7 +4272,7 @@ void CProcessContainer::Bcast (struct message_def *msg)
                             , process->GetNid()
                             , process->GetPid()
                             , process->GetVerifier() );
- 
+
             if (!shm)
             {   // First process, allocate a buffer for the notice image
                 // and initialize it.
@@ -4319,11 +4319,11 @@ char *CProcessContainer::BuildOurName( int nid, int pid, char *name )
     int i;
     int rem;
     int cnt[4];
-    
+
     const char method_name[] = "CProcessContainer::BuildOurName";
     TRACE_ENTRY;
-    
-    // Convert Pid into base 35 acsii 
+
+    // Convert Pid into base 35 acsii
     cnt[0] = pid / 42875;
     rem = pid - ( cnt[0] * 42875 );
     cnt[1] = rem / 1225;
@@ -4355,7 +4355,7 @@ char *CProcessContainer::BuildOurName( int nid, int pid, char *name )
         }
     }
     name[8] = '\0';
-       
+
 
     TRACE_EXIT;
     return name;
@@ -4369,7 +4369,7 @@ bool CProcessContainer::CancelDeathNotification( int nid
 {
     bool status = FAILURE;
     CProcess *process = head_;
-    
+
     // we will loop through all processes on the node ... return FAILURE
     // only if we don't find any notices to cancel.
     while (process)
@@ -4377,7 +4377,7 @@ bool CProcessContainer::CancelDeathNotification( int nid
         status = process->CancelDeathNotification (nid, pid, verifier, trans_id);
         process = process->GetNext ();
     }
-    
+
     return status;
 }
 #endif
@@ -4391,9 +4391,9 @@ void CProcessContainer::Child_Exit ( CProcess * parent )
     TRACE_ENTRY;
     if (trace_settings & TRACE_ENTRY_EXIT)
         trace_printf("%s@%d with parent (%d, %d)\n", method_name, __LINE__, parent->GetNid(), parent->GetPid() );
-    
+
     if ( parent &&
-           ((MyNode->GetState() != State_Shutdown && 
+           ((MyNode->GetState() != State_Shutdown &&
              MyNode->GetShutdownLevel() == ShutdownLevel_Undefined)
            || (parent->GetType() == ProcessType_SPX) ) )
     {
@@ -4416,7 +4416,7 @@ void CProcessContainer::Child_Exit ( CProcess * parent )
                                  method_name, __LINE__, process->GetName(),
                                  process->GetNid(), process->GetPid(),
                                  parent->GetNid(), parent->GetPid());
-                
+
                 childNode->SetProcessState( process, State_Down, true );
                 if ( !process->IsClone() )
                 {
@@ -4426,7 +4426,7 @@ void CProcessContainer::Child_Exit ( CProcess * parent )
                     }
                     else
                     {
-                        kill (process->GetPid(), Monitor->GetProcTermSig()); 
+                        kill (process->GetPid(), Monitor->GetProcTermSig());
                     }
                 }
                 if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
@@ -4573,12 +4573,12 @@ CProcess *CProcessContainer::CloneProcess (int nid,
 
     if (process)
     {
-        process->SetVerifier(verifier);
+        process->SetVerifier(verifier); // CProcessContainer::CloneProcess
         process->SetParentVerifier(parent_verifier);
 
         AddToList( process );
 
-        process->CompleteProcessStartup (port, os_pid, event_messages, system_messages, os_pid==-1, creation_time, origPNidNs);
+        process->CompleteProcessStartup (port, os_pid, event_messages, system_messages, os_pid==-1, creation_time, origPNidNs); // CProcessContainer::CloneProcess
     }
 
     TRACE_EXIT;
@@ -4612,7 +4612,7 @@ CProcess *CProcessContainer::CompleteProcessStartup (char *process_name,
     if (process)
     {
         if (process->GetPid() != os_pid)
-        { // Process id changed from when we started the process. 
+        { // Process id changed from when we started the process.
             if ( !process->IsUnhooked() )
             {   // Parent process object keeps track of child processes
                 // created on this node.  Needed in case parent process
@@ -4656,7 +4656,7 @@ CProcess *CProcessContainer::CompleteProcessStartup (char *process_name,
             }
             AddToPidMap ( os_pid, process );
         }
-        process->CompleteProcessStartup (port, os_pid, event_messages, system_messages, false, creation_time, origPNidNs);
+        process->CompleteProcessStartup (port, os_pid, event_messages, system_messages, false, creation_time, origPNidNs); // CProcessContainer::CompleteProcessStartup
     }
     // When using process maps do not log an error if the process is
     // not found.  This method can be called from
@@ -4674,7 +4674,7 @@ CProcess *CProcessContainer::CreateProcess (CProcess * parent,
                                             int backup,
                                             bool unhooked,
                                             char *process_name,
-                                            strId_t pathStrId, 
+                                            strId_t pathStrId,
                                             strId_t ldpathStrId,
                                             strId_t programStrId,
                                             char *infile,
@@ -4736,14 +4736,14 @@ CProcess *CProcessContainer::CreateProcess (CProcess * parent,
     }
 
     process =
-        new CProcess (parent, nid, -1, type, priority, backup, debug, unhooked, process_name, 
+        new CProcess (parent, nid, -1, type, priority, backup, debug, unhooked, process_name,
                       pathStrId, ldpathStrId, programStrId, infile, outfile);
     if (process)
     {
         AddToList( process );
-        if (type == ProcessType_NameServer || 
-            type == ProcessType_Watchdog || 
-            type == ProcessType_PSD ||  
+        if (type == ProcessType_NameServer ||
+            type == ProcessType_Watchdog ||
+            type == ProcessType_PSD ||
             type == ProcessType_SMS )
         {
             if (type == ProcessType_NameServer)
@@ -4770,7 +4770,7 @@ void CProcessContainer::DeleteFromList( CProcess *process )
 {
     const char method_name[] = "CProcessContainer::DeleteFromList";
     TRACE_ENTRY;
-    
+
     if ( ! nodeContainer_ )
     {
         // Programmer bonehead :^)
@@ -4811,7 +4811,7 @@ void CProcessContainer::RemoveFromList( CProcess *process )
 {
     const char method_name[] = "CProcessContainer::RemoveFromList";
     TRACE_ENTRY;
-    
+
     if ( ! nodeContainer_ )
     {
         // Programmer bonehead :^)
@@ -4823,7 +4823,7 @@ void CProcessContainer::RemoveFromList( CProcess *process )
     {
         CLNode *lnode = Nodes->GetLNode( process->Nid );
         lnode->RemoveFromListL( process );
-        
+
         if (head_ == process)
             head_ = process->next_;
         if (tail_ == process)
@@ -4848,7 +4848,7 @@ void CProcessContainer::RemoveFromListL( CProcess *process )
 {
     const char method_name[] = "CProcessContainer::RemoveFromListL";
     TRACE_ENTRY;
-    
+
     if ( nodeContainer_ )
     {
         // Programmer bonehead :^)
@@ -4858,7 +4858,7 @@ void CProcessContainer::RemoveFromListL( CProcess *process )
 
     if (process)
     {
-        
+
         if (head_ == process)
             head_ = process->nextL_;
         if (tail_ == process)
@@ -4904,8 +4904,8 @@ void CProcessContainer::DumpCallback( int nid, pid_t pid, int status )
         // This must only be called from CLNode (the logical node)
         abort();
     }
-    
-    CLNode   *lnode = Nodes->GetLNode( nid ); 
+
+    CLNode   *lnode = Nodes->GetLNode( nid );
     CNode    *node = lnode->GetNode();
 
     CProcess *process = node->GetProcess( pid );
@@ -4957,7 +4957,7 @@ CProcess * CProcessContainer::ParentNewProcReply ( CProcess *process, int result
 
     if (process->GetParentNid() != -1)
     {
-        parent = Nodes->GetProcess( process->GetParentNid(), 
+        parent = Nodes->GetProcess( process->GetParentNid(),
                                     process->GetParentPid() );
     }
 
@@ -4970,7 +4970,7 @@ CProcess * CProcessContainer::ParentNewProcReply ( CProcess *process, int result
 #endif
             struct message_def *reply_msg;
             reply_msg = process->parentContext();
- 
+
             if ( reply_msg )
             {
                 // send reply to the parent
@@ -4986,7 +4986,7 @@ CProcess * CProcessContainer::ParentNewProcReply ( CProcess *process, int result
             process->SendProcessCreatedNotice(parent, result);
         }
 #endif
-    }  
+    }
 
     TRACE_EXIT;
 
@@ -5049,7 +5049,7 @@ void CProcessContainer::Exit_Process (CProcess *process, bool abend, int downNod
                      process->GetPid());
             mon_log_write(MON_PROCESSCONT_EXITPROCESS_2, SQ_LOG_ERR, buf);
         }
-      
+
         if (trace_settings & (TRACE_SYNC_DETAIL | TRACE_REQUEST_DETAIL | TRACE_PROCESS_DETAIL))
             trace_printf( "%s@%d - Process %s is exiting, persistent=%d, abended=%d\n"
                         , method_name, __LINE__
@@ -5065,7 +5065,7 @@ void CProcessContainer::Exit_Process (CProcess *process, bool abend, int downNod
 
         if ( parent == NULL)
         {
-            parent = Nodes->GetProcess( process->GetParentNid(), 
+            parent = Nodes->GetProcess( process->GetParentNid(),
                                         process->GetParentPid() );
         }
 
@@ -5078,7 +5078,7 @@ void CProcessContainer::Exit_Process (CProcess *process, bool abend, int downNod
 
         // Handle the process termination
         process->Exit( parent );
-        
+
         process->Switch( parent ); // switch process pair roles if needed
 
         if ( process->IsPersistent() &&
@@ -5086,8 +5086,8 @@ void CProcessContainer::Exit_Process (CProcess *process, bool abend, int downNod
             !MyNode->IsActivatingSpare() &&
             !MyNode->IsKillingNode() &&
              MyNode->GetShutdownLevel() == ShutdownLevel_Undefined &&
-            (process->IsAbended()|| 
-             process->GetNid() == downNode || 
+            (process->IsAbended()||
+             process->GetNid() == downNode ||
              process->GetType() == ProcessType_SPX))
         {
             // see if we can restart the process
@@ -5097,10 +5097,10 @@ void CProcessContainer::Exit_Process (CProcess *process, bool abend, int downNod
                 if (!process->IsClone() && !MyNode->isInQuiesceState())
                 {
                     // Replicate the exit to other nodes
-//TRK-TODO 
+//TRK-TODO
             //        if (NameServerEnabled)
                     {
-                        //message to monitor  
+                        //message to monitor
                     }
             //        else
                     {
@@ -5130,17 +5130,17 @@ void CProcessContainer::Exit_Process (CProcess *process, bool abend, int downNod
         else
         {
             process->SetState (State_Stopped);
-            if ( !process->IsClone() && 
+            if ( !process->IsClone() &&
                  (!MyNode->IsKillingNode() || MyNode->IsSoftNodeDown()) &&
                  !MyNode->isInQuiesceState() &&
-                 !(process->GetType() == ProcessType_DTM && 
+                 !(process->GetType() == ProcessType_DTM &&
                    process->IsAbended() &&
                    MyNode->GetShutdownLevel() == ShutdownLevel_Undefined) )
             {
-//TRK-TODO 
+//TRK-TODO
       //        if (NameServerEnabled)
                 {
-                    //message to monitor  
+                    //message to monitor
                 }
         //        else
                 {
@@ -5162,13 +5162,13 @@ void CProcessContainer::Exit_Process (CProcess *process, bool abend, int downNod
             }
             process->SetDeletePending ( true );
             if (process->IsAbended() || process->GetType() == ProcessType_SPX)
-            { 
+            {
                 Child_Exit(process);
             }
 
             if (!process->IsClone() && process->GetType() == ProcessType_Watchdog)
             {
-                HealthCheck.setState(HC_UPDATE_WATCHDOG, (long long)NULL); 
+                HealthCheck.setState(HC_UPDATE_WATCHDOG, (long long)NULL);
             }
             CNode * node;
             node = Nodes->GetLNode(process->GetNid())->GetNode();
@@ -5304,7 +5304,7 @@ CProcess *CProcessContainer::GetProcess( int pid
     {
         entry = CProcessContainer::GetProcess( pid );
     }
-    
+
     if ( entry )
     {
         if ( (verifier != -1) && (verifier != entry->GetVerifier()) )
@@ -5316,7 +5316,7 @@ CProcess *CProcessContainer::GetProcess( int pid
                           , pid
                           , verifier
                           , entry->GetVerifier() );
-           }            
+           }
            entry = NULL;
         }
     }
@@ -5361,7 +5361,7 @@ CProcess *CProcessContainer::GetProcess( const char *name
     {
         entry = CProcessContainer::GetProcess( name, checkstate );
     }
-    
+
     if ( entry )
     {
         if ( (verifier != -1) && (verifier != entry->GetVerifier()) )
@@ -5373,7 +5373,7 @@ CProcess *CProcessContainer::GetProcess( const char *name
                           , name
                           , verifier
                           , entry->GetVerifier() );
-           }            
+           }
            entry = NULL;
         }
     }
@@ -5478,7 +5478,7 @@ void CProcessContainer::KillAll( STATE node_State, CProcess *requester )
                 {
                     if ( !killedIsClone && killedPid != -1)
                     {
-                        kill (killedPid, SIGKILL); 
+                        kill (killedPid, SIGKILL);
                         if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
                             trace_printf("%s@%d - Completed kill for (%d, %d)\n", method_name, __LINE__, killedNid, killedPid);
                     }
@@ -5511,7 +5511,7 @@ void CProcessContainer::KillAllDown()
     CProcess *process  = NULL;
     int nid = -1;
     int pid = -1;
-    
+
     const char method_name[] = "CProcessContainer::KillAllDown";
     TRACE_ENTRY;
 
@@ -5548,17 +5548,17 @@ void CProcessContainer::KillAllDown()
         // Delete pid map entry
         DelFromPidMap ( process );
 
-        // valid for virtual cluster only. 
+        // valid for virtual cluster only.
         if ( !process->IsClone() && pid != -1 )
         {
             // killing the process will not remove the process object because
-            // exit processing will get queued until this completes. 
-            kill( pid, SIGKILL ); 
+            // exit processing will get queued until this completes.
+            kill( pid, SIGKILL );
             PROCESSTYPE type = process->GetType();
             if ( type == ProcessType_TSE ||
                  type == ProcessType_ASE )
             {
-                // unmount volume would acquire nameMapLock_ internally. 
+                // unmount volume would acquire nameMapLock_ internally.
                 Devices->UnMountVolume( process->GetName(), process->IsBackup() );
             }
             if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
@@ -5570,7 +5570,7 @@ void CProcessContainer::KillAllDown()
         Exit_Process( process, true, nid );
     }
 
-    // clean up clone processes on this node that do not have entries in 
+    // clean up clone processes on this node that do not have entries in
     // nameMap_ or pidMap_ yet and restart persistent processes
     CProcess *nextProc = NULL;
     process = head_;
@@ -5727,7 +5727,7 @@ bool CProcessContainer::Open_Process (int nid, int pid, Verifier_t verifier, int
                                 verifier,
                                 opener_process->GetVerifier());
                 }
-            } 
+            }
             else
             {
                 status = opener_process->Open (process,death_notification);
@@ -5823,7 +5823,7 @@ bool CProcessContainer::RestartPersistentProcess( CProcess *process, int downNid
         mon_log_write(MON_PROCESS_PERSIST_2, SQ_LOG_ERR, buf);
         return false;
     }
-    
+
     // if 1st time retrying to restart process
     if (process->GetPersistentCreateTime() == 0)
     {
@@ -5845,7 +5845,7 @@ bool CProcessContainer::RestartPersistentProcess( CProcess *process, int downNid
 
     currentLNode = Nodes->GetLNode( process->GetNid() );
     newLNode     = Nodes->GetLNodeNext( process->GetNid() );
-    
+
     switch (persistConfig->GetProcessNameNidFormat())
     {
     case Nid_ALL:       // one process in each <nid>
@@ -5867,7 +5867,7 @@ bool CProcessContainer::RestartPersistentProcess( CProcess *process, int downNid
             // Is this a node down and node going down is process' node?
             if ( downNid != -1 && currentLNode->GetNid() == downNid )
             {
-                if (trace_settings & 
+                if (trace_settings &
                     (TRACE_SYNC_DETAIL | TRACE_REQUEST_DETAIL | TRACE_PROCESS_DETAIL))
                     trace_printf( "%s@%d - original node is not available, nid=%d, downNid=%d\n"
                                 , method_name, __LINE__
@@ -5878,7 +5878,7 @@ bool CProcessContainer::RestartPersistentProcess( CProcess *process, int downNid
             {
                 if ( currentLNode->GetState() == State_Up)
                 {
-                    if (trace_settings & 
+                    if (trace_settings &
                         (TRACE_SYNC_DETAIL | TRACE_REQUEST_DETAIL | TRACE_PROCESS_DETAIL))
                     {
                         trace_printf( "%s@%d - original node is available, nid=%d\n"
@@ -5892,7 +5892,7 @@ bool CProcessContainer::RestartPersistentProcess( CProcess *process, int downNid
                 }
                 else
                 {
-                    if (trace_settings & 
+                    if (trace_settings &
                         (TRACE_SYNC_DETAIL | TRACE_REQUEST_DETAIL | TRACE_PROCESS_DETAIL))
                         trace_printf( "%s@%d - original node is not available, nid=%d, downNid=%d\n"
                                     , method_name, __LINE__
@@ -5908,20 +5908,20 @@ bool CProcessContainer::RestartPersistentProcess( CProcess *process, int downNid
         switch (persistConfig->GetZoneZidFormat())
         {
         case Zid_ALL:       // recreate in current up <nid> or next up <nid>
-            // check if we need to do something because the node is down and 
+            // check if we need to do something because the node is down and
             // spare node is not activating
             if ((downNid != -1 && !currentLNode->GetNode()->IsSpareNode()) ||
                  currentLNode->GetState() == State_Down )
             {
                 nid = (newLNode) ? newLNode->GetNid() : -1;
-                if ( newLNode && 
-                    (newLNode->GetState() == State_Up && 
+                if ( newLNode &&
+                    (newLNode->GetState() == State_Up &&
                      newLNode->GetNid() != downNid ) )
                 {
                     if (MyNode->IsMyNode(nid))
                     {
                         // OK we need to move the process to our node
-                        if (trace_settings & 
+                        if (trace_settings &
                             (TRACE_SYNC_DETAIL | TRACE_REQUEST_DETAIL | TRACE_PROCESS_DETAIL))
                             trace_printf( "%s@%d - Moving process from nid=%d to new nid=%d\n"
                                         , method_name, __LINE__
@@ -5940,7 +5940,7 @@ bool CProcessContainer::RestartPersistentProcess( CProcess *process, int downNid
                     }
                     else
                     {
-                        if (trace_settings & 
+                        if (trace_settings &
                             (TRACE_SYNC_DETAIL | TRACE_REQUEST_DETAIL | TRACE_PROCESS_DETAIL))
                             trace_printf( "%s@%d - Not moving process from nid=%d to nid=%d""\n"
                                         , method_name, __LINE__
@@ -5949,7 +5949,7 @@ bool CProcessContainer::RestartPersistentProcess( CProcess *process, int downNid
                 }
                 else
                 {
-                    if (trace_settings & 
+                    if (trace_settings &
                         (TRACE_SYNC_DETAIL | TRACE_REQUEST_DETAIL | TRACE_PROCESS_DETAIL))
                        trace_printf( "%s@%d - Next possible node is not available, nid=%d\n"
                                     , method_name, __LINE__, nid);
@@ -5957,7 +5957,7 @@ bool CProcessContainer::RestartPersistentProcess( CProcess *process, int downNid
             }
             else
             {
-                if (trace_settings & 
+                if (trace_settings &
                     (TRACE_SYNC_DETAIL | TRACE_REQUEST_DETAIL | TRACE_PROCESS_DETAIL))
                     trace_printf( "%s@%d - original node is available, nid=%d\n"
                                 , method_name, __LINE__, process->GetNid());
@@ -5973,7 +5973,7 @@ bool CProcessContainer::RestartPersistentProcess( CProcess *process, int downNid
             // Is this a node down and node going down is process' node?
             if ( downNid != -1 && currentLNode->GetNid() == downNid )
             {
-                if (trace_settings & 
+                if (trace_settings &
                     (TRACE_SYNC_DETAIL | TRACE_REQUEST_DETAIL | TRACE_PROCESS_DETAIL))
                     trace_printf( "%s@%d - original node is not available, nid=%d, downNid=%d\n"
                                 , method_name, __LINE__
@@ -5984,7 +5984,7 @@ bool CProcessContainer::RestartPersistentProcess( CProcess *process, int downNid
             {
                 if ( currentLNode->GetState() == State_Up)
                 {
-                    if (trace_settings & 
+                    if (trace_settings &
                         (TRACE_SYNC_DETAIL | TRACE_REQUEST_DETAIL | TRACE_PROCESS_DETAIL))
                     {
                         trace_printf( "%s@%d - original node is available, nid=%d\n"
@@ -5998,7 +5998,7 @@ bool CProcessContainer::RestartPersistentProcess( CProcess *process, int downNid
                 }
                 else
                 {
-                    if (trace_settings & 
+                    if (trace_settings &
                         (TRACE_SYNC_DETAIL | TRACE_REQUEST_DETAIL | TRACE_PROCESS_DETAIL))
                         trace_printf( "%s@%d - original node is not available, nid=%d, downNid=%d\n"
                                     , method_name, __LINE__
@@ -6009,7 +6009,7 @@ bool CProcessContainer::RestartPersistentProcess( CProcess *process, int downNid
         }
         break;
     }
-    
+
     if ( Nodes->IsShutdownActive() )
     {
         if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
@@ -6020,8 +6020,8 @@ bool CProcessContainer::RestartPersistentProcess( CProcess *process, int downNid
     {
         // Re-initialize process flags
         process->SetState (State_Unknown);
-    
-        if (( restart                    ) && 
+
+        if (( restart                    ) &&
             ( MyNode->IsMyNode(process->GetNid()) ))
         {
             // check if we should retry to create the process
@@ -6043,7 +6043,7 @@ bool CProcessContainer::RestartPersistentProcess( CProcess *process, int downNid
                                      max_retries);
 
                     char buf[MON_STRING_BUF_SIZE];
-    
+
                     snprintf(buf, sizeof(buf), "[%s], Persistent process %s "
                              "not restarted because the maximum retry count "
                              "(%d) has been exceeded.\n",
@@ -6189,7 +6189,7 @@ void CProcessContainer::CheckFdState ( int fd )
     if ((epoll_ctl(epollfd, EPOLL_CTL_ADD, fd, &ev) == -1)
         && (errno != EEXIST))
     {
-        snprintf(buf, sizeof(buf), 
+        snprintf(buf, sizeof(buf),
                  "[%s], epoll_ctl error, adding fd=%d, %s (%d)\n",
                 method_name, fd, strerror(errno), errno);
         mon_log_write(MON_PROCESS_CHECKFDSTATE_2, SQ_LOG_ERR, buf);
@@ -6212,7 +6212,7 @@ void CProcessContainer::CheckFdState ( int fd )
         for (int n=0; n < ready_fds; n++)
         {
             snprintf(buf, sizeof(buf),
-                     "[%s], for fd=%d, events=%d\n", method_name, 
+                     "[%s], for fd=%d, events=%d\n", method_name,
                      event_list[n].data.fd, event_list[n].events);
             mon_log_write(MON_PROCESS_CHECKFDSTATE_4, SQ_LOG_INFO, buf);
         }
@@ -6294,7 +6294,7 @@ void CProcessContainer::PidHangupCheck ( time_t now )
                 // set state process
                 // Queue request for processing by worker thread
                 ReqQueue.enqueueChildDeathReq ( pid );
-        
+
                 // release buffers
                 // todo
             }
@@ -6389,7 +6389,7 @@ void CProcessContainer::SetProcessState( CProcess *process, STATE state, bool ab
                 // Process terminated so handle the exit processing.
                 // Termination detected through a child death signal or
                 // a broken stderr pipe for an attached process.
-                
+
                 // Note: Exit_Process() will delete the process object, so
                 //       save the process information needed before the call
                 PROCESSTYPE processType = process->GetType();
@@ -6412,7 +6412,7 @@ void CProcessContainer::SetProcessState( CProcess *process, STATE state, bool ab
                     switch ( processType )
                     {
                     case ProcessType_DTM:
-                        if ( MyNode->GetState() != State_Shutdown && 
+                        if ( MyNode->GetState() != State_Shutdown &&
                              MyNode->IsDTMAborted() )
                         {
                             char buf[MON_STRING_BUF_SIZE];
@@ -6420,18 +6420,18 @@ void CProcessContainer::SetProcessState( CProcess *process, STATE state, bool ab
                                      "[%s], DTM (%s) aborted, Node %s going down\n",
                                      method_name, processName.c_str(), MyNode->GetName());
                             mon_log_write(MON_PROCESS_SETSTATE_1, SQ_LOG_INFO, buf);
-        
-                            snprintf( buf, sizeof(buf), 
-                                      "DTM (%s) aborted, Node %s going down\n", 
+
+                            snprintf( buf, sizeof(buf),
+                                      "DTM (%s) aborted, Node %s going down\n",
                                       processName.c_str(), MyNode->GetName());
                             genSnmpTrap( buf );
-        
+
                             // DTM just died unexpectedly, so bring the node down
                             Monitor->HardNodeDown(MyPNID, true);
                         }
                         break;
                     case ProcessType_SMS:
-                        if ( MyNode->GetState() != State_Shutdown && 
+                        if ( MyNode->GetState() != State_Shutdown &&
                              MyNode->IsSMSAborted() )
                         {
                             char buf[MON_STRING_BUF_SIZE];
@@ -6439,12 +6439,12 @@ void CProcessContainer::SetProcessState( CProcess *process, STATE state, bool ab
                                      "[%s], SMS (%s) aborted, Node %s going down\n",
                                      method_name, processName.c_str(), MyNode->GetName());
                             mon_log_write(MON_PROCESS_SETSTATE_2, SQ_LOG_INFO, buf);
-        
-                            snprintf( buf, sizeof(buf), 
-                                      "SMS (%s) aborted, Node %s going down\n", 
+
+                            snprintf( buf, sizeof(buf),
+                                      "SMS (%s) aborted, Node %s going down\n",
                                       processName.c_str(), MyNode->GetName());
                             genSnmpTrap( buf );
-        
+
                             // SMS just died unexpectedly, so bring the node down
                             Monitor->HardNodeDown(MyPNID, true);
                         }

http://git-wip-us.apache.org/repos/asf/trafodion/blob/8b025eae/core/sqf/monitor/linux/reqprocinfo.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqprocinfo.cxx b/core/sqf/monitor/linux/reqprocinfo.cxx
index 8ff457c..8834177 100644
--- a/core/sqf/monitor/linux/reqprocinfo.cxx
+++ b/core/sqf/monitor/linux/reqprocinfo.cxx
@@ -342,7 +342,7 @@ void CExtProcInfoReq::performRequest()
 #ifdef NAMESERVER_PROCESS
             requester =
                Nodes->GetProcess( nid_ , pid_ , verifier_
-                                , false, false, false );
+                                , false, false, true );
 #else
             requester = MyNode->GetProcess( pid_
                                           , verifier_ );


[14/50] [abbrv] trafodion git commit: Multiple fixes to problems found by Seabed tests.

Posted by su...@apache.org.
Multiple fixes to problems found by Seabed tests.


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

Branch: refs/heads/master
Commit: 5d97082d6ff9c299f473c6421d9131679c53c04f
Parents: 010e563
Author: Zalo Correa <za...@esgyn.com>
Authored: Tue Apr 3 18:42:09 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Tue Apr 3 18:42:09 2018 -0700

----------------------------------------------------------------------
 core/sqf/monitor/linux/cluster.cxx     | 11 +++++
 core/sqf/monitor/linux/nameserver.cxx  |  8 +++
 core/sqf/monitor/linux/pnode.cxx       | 12 +++++
 core/sqf/monitor/linux/ptpclient.cxx   | 26 +++++++++-
 core/sqf/monitor/linux/ptpclient.h     |  3 ++
 core/sqf/monitor/linux/reqprocinfo.cxx | 75 +++++++++++++++++++++++++++++
 core/sqf/sql/scripts/monitor.env       |  1 +
 7 files changed, 134 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/5d97082d/core/sqf/monitor/linux/cluster.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/cluster.cxx b/core/sqf/monitor/linux/cluster.cxx
index 070230e..aa3062c 100644
--- a/core/sqf/monitor/linux/cluster.cxx
+++ b/core/sqf/monitor/linux/cluster.cxx
@@ -9153,6 +9153,17 @@ int CCluster::MkCltSock( const char *portName )
     host[len] = '\0';
     port = atoi(&colon[1]);
 
+    if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+    {
+        if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+        {
+            trace_printf( "%s@%d - Connecting to %s:%d\n"
+                        , method_name, __LINE__
+                        , host
+                        , port );
+        }
+    }
+
     size = sizeof(sockinfo);
 
     if ( !retries )

http://git-wip-us.apache.org/repos/asf/trafodion/blob/5d97082d/core/sqf/monitor/linux/nameserver.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nameserver.cxx b/core/sqf/monitor/linux/nameserver.cxx
index adddf37..1815409 100644
--- a/core/sqf/monitor/linux/nameserver.cxx
+++ b/core/sqf/monitor/linux/nameserver.cxx
@@ -328,6 +328,14 @@ int CNameServer::SockCreate( void )
     strcpy( host, mon2nsHost_ );
     port = atoi( mon2nsPort_ );
     
+    if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+    {
+        trace_printf( "%s@%d - Connecting to %s:%d\n"
+                    , method_name, __LINE__
+                    , host
+                    , port );
+    }
+
     size = sizeof(sockinfo );
 
     if ( !retries )

http://git-wip-us.apache.org/repos/asf/trafodion/blob/5d97082d/core/sqf/monitor/linux/pnode.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnode.cxx b/core/sqf/monitor/linux/pnode.cxx
index 6affd4f..5c51ada 100644
--- a/core/sqf/monitor/linux/pnode.cxx
+++ b/core/sqf/monitor/linux/pnode.cxx
@@ -2825,6 +2825,18 @@ CProcess *CNodeContainer::GetProcess( const char *name
     const char method_name[] = "CNodeContainer::GetProcess(name,verifier)";
     TRACE_ENTRY;
 
+    if (trace_settings & (TRACE_REQUEST_DETAIL | TRACE_PROCESS_DETAIL))
+    {
+        trace_printf( "%s@%d Getting %s:%d, "
+                      "checknode=%d, checkprocess=%d, backupOk=%d\n"
+                    , method_name, __LINE__
+                    , name
+                    , verifier
+                    , checknode
+                    , checkprocess
+                    , backupOk );
+    }
+
     while ( node )
     {
         if ( checknode )

http://git-wip-us.apache.org/repos/asf/trafodion/blob/5d97082d/core/sqf/monitor/linux/ptpclient.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/ptpclient.cxx b/core/sqf/monitor/linux/ptpclient.cxx
index 4f3f292..98ca3a4 100644
--- a/core/sqf/monitor/linux/ptpclient.cxx
+++ b/core/sqf/monitor/linux/ptpclient.cxx
@@ -62,7 +62,15 @@ CPtpClient::CPtpClient (void)
 {
     const char method_name[] = "CPtpClient::CPtpClient";
     TRACE_ENTRY;
+
+    ptpHost_[0] = '\0';
+    ptpPortBase_[0] = '\0';
+    if ( !IsRealCluster )
+    {
+        SetLocalHost();
+    }
     
+
     char * p = getenv( "MON2MON_COMM_PORT" );
     if ( p ) 
     {
@@ -702,6 +710,11 @@ int CPtpClient::ReceiveSock(char *buf, int size, int sockFd)
     return error;
 }
 
+void CPtpClient::SetLocalHost( void )
+{
+    gethostname( ptpHost_, MAX_PROCESSOR_NAME );
+}
+
 int CPtpClient::SendSock(char *buf, int size, int sockFd)
 {
     const char method_name[] = "CPtpClient::SendSock";
@@ -773,23 +786,32 @@ int CPtpClient::SendToMon(const char *reqType, internal_msg_def *msg, int size,
     TRACE_ENTRY;
     
     char monPortString[MAX_PROCESSOR_NAME];
+    char ptpHost[MAX_PROCESSOR_NAME];
     char ptpPort[MAX_PROCESSOR_NAME];
     int tempPort = basePort_;
     
+    ptpHost[0] = '\0';
+
     // For virtual env
     if (!IsRealCluster)
     {
         tempPort += receiveNode;
+        strcat( ptpHost, ptpHost_ );
+    }
+    else
+    {
+        strcat( ptpHost, hostName );
     }
     
     if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
     {
         trace_printf( "%s@%d - reqType=%s, hostName=%s, receiveNode=%d, "
-                      "tempPort=%d, basePort_=%d\n"
+                      "ptpHost=%s, tempPort=%d, basePort_=%d\n"
                     , method_name, __LINE__
                     , reqType
                     , hostName
                     , receiveNode
+                    , ptpHost
                     , tempPort 
                     , basePort_ );
     }
@@ -797,7 +819,7 @@ int CPtpClient::SendToMon(const char *reqType, internal_msg_def *msg, int size,
     memset( &ptpPort, 0, MAX_PROCESSOR_NAME );
     memset( &ptpPortBase_, 0, MAX_PROCESSOR_NAME+100 );
 
-    strcat( ptpPortBase_, hostName );
+    strcat( ptpPortBase_, ptpHost );
     strcat( ptpPortBase_, ":" );
     sprintf( monPortString,"%d", tempPort );
     strcat( ptpPort, ptpPortBase_ );

http://git-wip-us.apache.org/repos/asf/trafodion/blob/5d97082d/core/sqf/monitor/linux/ptpclient.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/ptpclient.h b/core/sqf/monitor/linux/ptpclient.h
index 554bc71..d46ea5e 100644
--- a/core/sqf/monitor/linux/ptpclient.h
+++ b/core/sqf/monitor/linux/ptpclient.h
@@ -66,7 +66,9 @@ public:
                       , const char *targetNodeName );
 
 private:
+
     int  basePort_;
+    char ptpHost_[MAX_PROCESSOR_NAME];
     char ptpPortBase_[MAX_PROCESSOR_NAME+100];
     int  ptpSock_;
     int  seqNum_;
@@ -74,6 +76,7 @@ private:
     int  ReceiveSock(char *buf, int size, int sockFd);
     int  SendSock(char *buf, int size, int sockFd);
     int  SendToMon(const char *reqType, internal_msg_def *msg, int size, int receiveNode, const char *hostName);
+    void SetLocalHost( void );
 };
 
 #endif

http://git-wip-us.apache.org/repos/asf/trafodion/blob/5d97082d/core/sqf/monitor/linux/reqprocinfo.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqprocinfo.cxx b/core/sqf/monitor/linux/reqprocinfo.cxx
index 0ad8d00..566a92b 100644
--- a/core/sqf/monitor/linux/reqprocinfo.cxx
+++ b/core/sqf/monitor/linux/reqprocinfo.cxx
@@ -44,8 +44,11 @@ extern CNameServer *NameServer;
 // Copy information for a specific process into the reply message buffer.
 void CExtProcInfoBase::ProcessInfo_CopyData(CProcess *process, ProcessInfoState &procState)
 {
+    const char method_name[] = "CNameServer::SendReceive";
     CProcess *parent;
 
+    TRACE_ENTRY;
+
     procState.nid = process->GetNid();
     procState.pid = process->GetPid();
     procState.verifier = process->GetVerifier();
@@ -82,6 +85,58 @@ void CExtProcInfoBase::ProcessInfo_CopyData(CProcess *process, ProcessInfoState
         procState.parent_verifier = -1;
         procState.parent_name[0] = '\0';
     }
+
+    if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+    {
+        char desc[2048];
+        char* descp = desc;
+        sprintf( desc, 
+                 "ProcessInfo reply:\n"
+                 "        procState.process_name=%s\n"
+                 "        procState.nid=%d\n"
+                 "        procState.pid=%d\n"
+                 "        procState.verifier=%d\n"
+                 "        procState.type=%d\n"
+                 "        procState.os_pid=%d\n"
+                 "        procState.parent_name=%s\n"
+                 "        procState.parent_nid=%d\n"
+                 "        procState.parent_pid=%d\n"
+                 "        procState.parent_verifier=%d\n"
+                 "        procState.priority=%d\n"
+                 "        procState.state=%d\n"
+                 "        procState.pending_delete=%d\n"
+                 "        procState.event_messages=%d\n"
+                 "        procState.system_messages=%d\n"
+                 "        procState.paired=%d\n"
+                 "        procState.waiting_startup=%d\n"
+                 "        procState.opened=%d\n"
+                 "        procState.backup=%d\n"
+                 "        procState.program=%s\n"
+                 , procState.process_name
+                 , procState.nid
+                 , procState.pid
+                 , procState.verifier
+                 , procState.type
+                 , procState.os_pid
+                 , procState.parent_name
+                 , procState.parent_nid
+                 , procState.parent_pid
+                 , procState.parent_verifier
+                 , procState.priority
+                 , procState.state
+                 , procState.pending_delete
+                 , procState.event_messages
+                 , procState.system_messages
+                 , procState.paired
+                 , procState.waiting_startup
+                 , procState.opened
+                 , procState.backup
+                 , procState.program );
+        trace_printf( "%s@%d - %s\n"
+                    , method_name, __LINE__, descp );
+    }
+
+    TRACE_EXIT;
 }
 
 
@@ -337,6 +392,7 @@ void CExtProcInfoReq::performRequest()
         if ( processName_.size() )
         { // find by name
 #ifdef NAMESERVER_PROCESS
+            //  (check node state, check process state, not backup)
             requester = Nodes->GetProcess( processName_.c_str()
                                          , verifier_ );
 #else
@@ -347,9 +403,13 @@ void CExtProcInfoReq::performRequest()
         else
         { // find by pid
 #ifdef NAMESERVER_PROCESS
+            //  (don't check node state, don't check process state, backup is Ok)
             requester =
                Nodes->GetProcess( nid_ , pid_ , verifier_
                                 , false, false, true );
+//            CLNode *lnode = Nodes->GetLNode( nid_ );
+//            CNode *node = lnode->GetNode();
+//            requester = node->GetProcess( pid_, verifier_ );
 #else
             requester = MyNode->GetProcess( pid_
                                           , verifier_ );
@@ -394,6 +454,11 @@ void CExtProcInfoReq::performRequest()
                 if ( requester && strcmp( requester->GetName()
                            , msg_->u.request.u.process_info.target_process_name) == 0 )
                 {
+                    if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+                    {
+                        trace_printf("%s@%d request #%ld: ProcessInfo, for "
+                                     "requester\n", method_name, __LINE__, id_);
+                    }
                     ProcessInfo_CopyData(requester,
                                          msg_->u.reply.u.process_info.process[0]);
                     count = 1;
@@ -419,6 +484,11 @@ void CExtProcInfoReq::performRequest()
                     {
                         if ( target_verifier == -1 )
                         { // the name may represent process pair, return primary only
+                            if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+                            {
+                                trace_printf("%s@%d request #%ld: ProcessInfo, for "
+                                             "process pair\n", method_name, __LINE__, id_);
+                            }
                             ProcessInfo_CopyPairData( process
                                                     , msg_->u.reply.u.process_info.process[0] );
                             count = 1;
@@ -426,6 +496,11 @@ void CExtProcInfoReq::performRequest()
                         }
                         else
                         { 
+                            if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+                            {
+                                trace_printf("%s@%d request #%ld: ProcessInfo, for "
+                                             "process\n", method_name, __LINE__, id_);
+                            }
                             ProcessInfo_CopyData( process
                                                 , msg_->u.reply.u.process_info.process[0] );
                             count = 1;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/5d97082d/core/sqf/sql/scripts/monitor.env
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/monitor.env b/core/sqf/sql/scripts/monitor.env
index a9172b8..2bfa4a7 100644
--- a/core/sqf/sql/scripts/monitor.env
+++ b/core/sqf/sql/scripts/monitor.env
@@ -40,6 +40,7 @@
 #MON_TRACE_SYNC_DETAIL=1
 #MON_TRACE_MLIO_DETAIL=1
 
+#MON_TRACE_MEAS
 #MON_TRACE_TMSYNC=1
 #MON_TRACE_STATS=1
 #MON_TRACE_ENTRY_EXIT=1


[10/50] [abbrv] trafodion git commit: Fixed parent clone issue and ptpCommAccept thread shutdown logic Added -nid argument to specify shell attach to a when in virtual cluster.

Posted by su...@apache.org.
Fixed parent clone issue and ptpCommAccept thread shutdown logic
Added -nid <nid> argument to specify shell attach to a <nid> when in virtual cluster.


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

Branch: refs/heads/master
Commit: 6dc990fe25798d46b51fb5c4932d92d58ad6aa0a
Parents: 38eb84e
Author: Zalo Correa <za...@esgyn.com>
Authored: Thu Mar 29 17:17:47 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Thu Mar 29 17:17:47 2018 -0700

----------------------------------------------------------------------
 core/sqf/monitor/linux/cluster.cxx             |  61 +++++++----
 core/sqf/monitor/linux/cluster.h               |   8 +-
 core/sqf/monitor/linux/monitor.cxx             |   2 +-
 core/sqf/monitor/linux/notice.cxx              |  57 ++++++----
 core/sqf/monitor/linux/pnode.cxx               |   2 +
 core/sqf/monitor/linux/pnode.h                 |   9 +-
 core/sqf/monitor/linux/process.cxx             | 112 +++++++++++++-------
 core/sqf/monitor/linux/process.h               |   5 +-
 core/sqf/monitor/linux/ptpclient.cxx           |  82 +++++---------
 core/sqf/monitor/linux/ptpclient.h             |   6 +-
 core/sqf/monitor/linux/ptpcommaccept.cxx       |   6 +-
 core/sqf/monitor/linux/shell.cxx               |  38 ++++++-
 core/sqf/monitor/test/monitor.env              |  18 ++--
 core/sqf/monitor/test/runtest                  |  46 +++-----
 core/sqf/monitor/test/sqconfig.monitor.virtual |   5 +-
 15 files changed, 270 insertions(+), 187 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/6dc990fe/core/sqf/monitor/linux/cluster.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/cluster.cxx b/core/sqf/monitor/linux/cluster.cxx
index 101cec2..070230e 100644
--- a/core/sqf/monitor/linux/cluster.cxx
+++ b/core/sqf/monitor/linux/cluster.cxx
@@ -86,7 +86,7 @@ extern CCommAcceptMon CommAcceptMon;
 extern char MyMon2NsPort[MPI_MAX_PORT_NAME];
 #else
 extern bool NameServerEnabled;
-extern char MyMon2MonPort[MPI_MAX_PORT_NAME];
+extern char MyPtPPort[MPI_MAX_PORT_NAME];
 #endif
 extern bool SMSIntegrating;
 extern int CreatorShellPid;
@@ -8315,7 +8315,7 @@ void CCluster::InitServerSock( void )
 #ifdef NAMESERVER_PROCESS
     int mon2nsPort = 0;
 #else
-    int mon2monPort = 0;
+    int ptpPort = 0;
 #endif
 
     unsigned char addr[4];
@@ -8490,7 +8490,7 @@ void CCluster::InitServerSock( void )
             int val;
             errno = 0;
             val = strtol(env, NULL, 10);
-            if ( errno == 0) mon2monPort = val;
+            if ( errno == 0) ptpPort = val;
         }
         else
         {
@@ -8505,38 +8505,39 @@ void CCluster::InitServerSock( void )
         // For virtual env, add PNid to the port so we can still test without collisions of port numbers
         if (!IsRealCluster)
         {
-            mon2monPort += MyNode->GetPNid();
+            ptpPort += MyNode->GetPNid();
         }
     
-        mon2monSock_ = MkSrvSock( &mon2monPort );
-        if ( mon2monSock_ < 0 )
+        ptpSock_ = MkSrvSock( &ptpPort );
+        if ( ptpSock_ < 0 )
         {
             char ebuff[MON_STRING_BUF_SIZE];
             char buf[MON_STRING_BUF_SIZE];
             snprintf( buf, sizeof(buf)
                     , "[%s@%d] MkSrvSock(MON2MON_COMM_PORT=%d) error: %s\n"
-                    , method_name, __LINE__, mon2monPort
+                    , method_name, __LINE__, ptpPort
                     , strerror_r( errno, ebuff, MON_STRING_BUF_SIZE ) );
             mon_log_write( MON_CLUSTER_INITSERVERSOCK_6, SQ_LOG_CRIT, buf );
             abort();
         }
         else
         {
-            snprintf( MyMon2MonPort, sizeof(MyMon2MonPort)
+            snprintf( MyPtPPort, sizeof(MyPtPPort)
                     , "%d.%d.%d.%d:%d"
                     , (int)((unsigned char *)addr)[0]
                     , (int)((unsigned char *)addr)[1]
                     , (int)((unsigned char *)addr)[2]
                     , (int)((unsigned char *)addr)[3]
-                    , mon2monPort );
-            MyNode->SetMon2MonPort( MyMon2MonPort );
+                    , ptpPort );
+            MyNode->SetPtPPort( MyPtPPort );
+            MyNode->SetPtPSocketPort( ptpPort );
     
             if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
-                trace_printf( "%s@%d Initialized my mon2mon socket port, "
-                              "pnid=%d (%s:%s) (mon2monPort=%s)\n"
+                trace_printf( "%s@%d Initialized my ptp socket port, "
+                              "pnid=%d (%s:%s) (ptpPort=%s)\n"
                             , method_name, __LINE__
-                            , MyPNID, MyNode->GetName(), MyMon2MonPort
-                            , MyNode->GetMon2MonPort() );
+                            , MyPNID, MyNode->GetName(), MyPtPPort
+                            , MyNode->GetPtPPort() );
     
         }
     }
@@ -8579,12 +8580,12 @@ int CCluster::AcceptSyncSock( void )
 }
 
 #ifndef NAMESERVER_PROCESS
-int CCluster::AcceptMon2MonSock( void )
+int CCluster::AcceptPtPSock( void )
 {
-    const char method_name[] = "CCluster::AcceptMon2MonSock";
+    const char method_name[] = "CCluster::AcceptPtPSock";
     TRACE_ENTRY;
 
-    int csock = AcceptSock( mon2monSock_ );
+    int csock = AcceptSock( ptpSock_ );
 
     TRACE_EXIT;
     return( csock  );
@@ -8871,11 +8872,33 @@ int CCluster::Connect( const char *portName )
     return ( sock );
 }
 
+#ifndef NAMESERVER_PROCESS
+void CCluster::ConnectToPtPCommSelf( void )
+{
+    const char method_name[] = "CCluster::ConnectToPtPCommSelf";
+    TRACE_ENTRY;
+
+    Connect( MyNode->GetPtPSocketPort() );
+
+    TRACE_EXIT;
+}
+#endif
+
 void CCluster::ConnectToSelf( void )
 {
     const char method_name[] = "CCluster::ConnectToSelf";
     TRACE_ENTRY;
 
+    Connect( MyNode->GetCommSocketPort() );
+
+    TRACE_EXIT;
+}
+
+void CCluster::Connect( int socketPort )
+{
+    const char method_name[] = "CCluster::Connect";
+    TRACE_ENTRY;
+
     int  sock;     // socket
     int  ret;      // returned value
 #if defined(_XOPEN_SOURCE_EXTENDED)
@@ -8928,7 +8951,7 @@ void CCluster::ConnectToSelf( void )
     memset( (char *) &sockinfo, 0, size );
     memcpy( (char *) &sockinfo.sin_addr, (char *) he->h_addr, 4 );
     sockinfo.sin_family = AF_INET;
-    sockinfo.sin_port = htons( (unsigned short) MyNode->GetCommSocketPort() );
+    sockinfo.sin_port = htons( (unsigned short) socketPort );
 
     connect_failures = 0;
     ret = 1;
@@ -8942,7 +8965,7 @@ void CCluster::ConnectToSelf( void )
                         , (int)((unsigned char *)he->h_addr)[1]
                         , (int)((unsigned char *)he->h_addr)[2]
                         , (int)((unsigned char *)he->h_addr)[3]
-                        , MyNode->GetCommSocketPort()
+                        , socketPort
                         , connect_failures );
         }
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/6dc990fe/core/sqf/monitor/linux/cluster.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/cluster.h b/core/sqf/monitor/linux/cluster.h
index 90c2092..f4f9147 100644
--- a/core/sqf/monitor/linux/cluster.h
+++ b/core/sqf/monitor/linux/cluster.h
@@ -109,9 +109,13 @@ public:
 #ifdef NAMESERVER_PROCESS
     int  AcceptMon2NsSock( void );
 #else
-    int  AcceptMon2MonSock( void );
+    int  AcceptPtPSock( void );
 #endif
     int  Connect( const char *portName );
+    void Connect( int socketPort );
+#ifndef NAMESERVER_PROCESS
+    void ConnectToPtPCommSelf( void );
+#endif
     void ConnectToSelf( void );
     int  SetKeepAliveSockOpt( int sock );
     int  MkCltSock( const char *portName );
@@ -231,7 +235,7 @@ protected:
 #ifdef NAMESERVER_PROCESS
     int            mon2nsSock_;
 #else
-    int            mon2monSock_;
+    int            ptpSock_;
 #endif
     int            epollFD_;
     int           *indexToPnid_;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/6dc990fe/core/sqf/monitor/linux/monitor.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/monitor.cxx b/core/sqf/monitor/linux/monitor.cxx
index 77d7509..e6aa68b 100755
--- a/core/sqf/monitor/linux/monitor.cxx
+++ b/core/sqf/monitor/linux/monitor.cxx
@@ -111,7 +111,7 @@ char MySyncPort[MPI_MAX_PORT_NAME] = {'\0'};
 #ifdef NAMESERVER_PROCESS
 char MyMon2NsPort[MPI_MAX_PORT_NAME] = {'\0'};
 #else
-char MyMon2MonPort[MPI_MAX_PORT_NAME] = {'\0'};
+char MyPtPPort[MPI_MAX_PORT_NAME] = {'\0'};
 #endif
 char Node_name[MPI_MAX_PROCESSOR_NAME] = {'\0'};
 sigset_t SigSet;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/6dc990fe/core/sqf/monitor/linux/notice.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/notice.cxx b/core/sqf/monitor/linux/notice.cxx
index 85a9eab..f478f45 100644
--- a/core/sqf/monitor/linux/notice.cxx
+++ b/core/sqf/monitor/linux/notice.cxx
@@ -269,8 +269,9 @@ void CNotice::Notify( SQ_LocalIOToClient::bcastPids_t *bcastPids )
 
 
                     if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
-                        trace_printf( "%s@%d - Sending %s (%d, %d:%d) Death "
-                                      "message to %s (%d, %d:%d)\n"
+                    {
+                        trace_printf( "%s@%d - Sending Death message of"
+                                      " %s (%d, %d:%d) to %s (%d, %d:%d)\n"
                                     , method_name, __LINE__
                                     , Process->GetName()
                                     , Process->GetNid()
@@ -280,41 +281,55 @@ void CNotice::Notify( SQ_LocalIOToClient::bcastPids_t *bcastPids )
                                     , notify->GetNid()
                                     , notify->GetPid()
                                     , notify->GetVerifier());
-
-
+                    }
                 }
                 else
                 {
                     if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
-                        trace_printf( "%s@%d - Process %s (%d, %d:%d)" 
-                                      " doesn't want Death message" "\n"
+                    {
+                        trace_printf( "%s@%d - Death message of %s (%d, %d:%d)" 
+                                      " not wanted by %s (%d, %d:%d)\n"
                                     , method_name, __LINE__
+                                    , Process->GetName()
+                                    , Process->GetNid()
+                                    , Process->GetPid()
+                                    , Process->GetVerifier()
                                     , notify->GetName()
                                     , notify->GetNid()
                                     , notify->GetPid()
-                                    , notify->GetVerifier() );
+                                    , notify->GetVerifier());
+                    }
                 }
             }
             else
             {
                 if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
-                    trace_printf( "%s@%d - Not processed for clone Process %s (%d, %d:%d)\n"
+                {
+                    trace_printf( "%s@%d - Death message of %s (%d, %d:%d)" 
+                                  " not processed for clone %s (%d, %d:%d)\n"
                                 , method_name, __LINE__
+                                , Process->GetName()
+                                , Process->GetNid()
+                                , Process->GetPid()
+                                , Process->GetVerifier()
                                 , notify->GetName()
                                 , notify->GetNid()
                                 , notify->GetPid()
-                                , notify->GetVerifier() );
+                                , notify->GetVerifier());
+                }
             }
         }
         else
         {
             if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
-               trace_printf( "%s@%d - Can't find process %s (%d, %d:%d)\n"
-                           , method_name, __LINE__
-                           , name_.c_str()
-                           , Nid
-                           , Pid
-                           , verifier_ );
+            {
+                trace_printf( "%s@%d - Can't find process %s (%d, %d:%d)\n"
+                            , method_name, __LINE__
+                            , name_.c_str()
+                            , Nid
+                            , Pid
+                            , verifier_ );
+            }
         }
     }
     TRACE_EXIT;
@@ -456,8 +471,8 @@ void CNotice::NotifyNid( NidQueue_t *nidQueue )
                     if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
                     {
                         CLNode *lnode = Nodes->GetLNode( Nid );
-                        trace_printf( "%s@%d - Sending process %s (%d, %d:%d) "
-                                      "exit message to %s (nid=%d)\n"
+                        trace_printf( "%s@%d - Sending exit message of"
+                                      " %s (%d, %d:%d) to %s (nid=%d)\n"
                                     , method_name, __LINE__
                                     , Process->GetName()
                                     , Process->GetNid()
@@ -471,9 +486,13 @@ void CNotice::NotifyNid( NidQueue_t *nidQueue )
                 {
                     if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
                     {
-                        trace_printf( "%s@%d - Process %s (%d, %d:%d)" 
-                                      " doesn't want Death message\n"
+                        trace_printf( "%s@%d - Death message of %s (%d, %d:%d)" 
+                                      " not wanted by %s (%d, %d:%d)\n"
                                     , method_name, __LINE__
+                                    , Process->GetName()
+                                    , Process->GetNid()
+                                    , Process->GetPid()
+                                    , Process->GetVerifier()
                                     , remoteProcess->GetName()
                                     , remoteProcess->GetNid()
                                     , remoteProcess->GetPid()

http://git-wip-us.apache.org/repos/asf/trafodion/blob/6dc990fe/core/sqf/monitor/linux/pnode.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnode.cxx b/core/sqf/monitor/linux/pnode.cxx
index e3923a0..6affd4f 100644
--- a/core/sqf/monitor/linux/pnode.cxx
+++ b/core/sqf/monitor/linux/pnode.cxx
@@ -169,6 +169,8 @@ CNode::CNode( char *name, int pnid, int rank )
       ,zid_(pnid)
 #ifdef NAMESERVER_PROCESS
       ,monConnCount_(0)
+#else
+      ,ptpSocketPort_(-1)
 #endif
       ,commSocketPort_(-1)
       ,syncSocketPort_(-1)

http://git-wip-us.apache.org/repos/asf/trafodion/blob/6dc990fe/core/sqf/monitor/linux/pnode.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnode.h b/core/sqf/monitor/linux/pnode.h
index 48af3bc..f0b89bb 100644
--- a/core/sqf/monitor/linux/pnode.h
+++ b/core/sqf/monitor/linux/pnode.h
@@ -245,7 +245,8 @@ public:
     inline const char *GetMon2NsPort( void ) { return mon2NsPort_.c_str(); }
     inline int GetMonConnCount( void ) { return monConnCount_; }
 #else
-    inline const char *GetMon2MonPort( void ) { return mon2MonPort_.c_str(); }
+    inline const char *GetPtPPort( void ) { return ptpPort_.c_str(); }
+    inline int   GetPtPSocketPort( void ) { return( ptpSocketPort_ ); }
 #endif
     inline int   GetCommSocketPort( void ) { return( commSocketPort_ ); }
     inline int   GetSyncSocketPort( void ) { return( syncSocketPort_ ); }
@@ -315,7 +316,8 @@ public:
 #ifdef NAMESERVER_PROCESS
     inline void SetMon2NsPort( char *mon2NsPort) { mon2NsPort_ = mon2NsPort; }
 #else
-    inline void SetMon2MonPort( char *mon2MonPort) { mon2MonPort_ = mon2MonPort; }  
+    inline void SetPtPPort( char *ptpPort) { ptpPort_ = ptpPort; }  
+    inline void SetPtPSocketPort( int ptpSocketPort) { ptpSocketPort_ = ptpSocketPort; }
 #endif
     //inline void SetSockPort( int sockPort ) { sockPort_ = sockPort; }
     inline void SetCommSocketPort( int commSocketPort) { commSocketPort_ = commSocketPort; }
@@ -414,7 +416,8 @@ private:
     string        mon2NsPort_;        // monitor to ns port
     int           monConnCount_;      // monitor connections
 #else
-    string        mon2MonPort_;
+    string        ptpPort_;
+    int           ptpSocketPort_;           // point-2-point socket port
 #endif
     int           commSocketPort_;          // re-integration socket port
     int           syncSocketPort_;          // algather socket port

http://git-wip-us.apache.org/repos/asf/trafodion/blob/6dc990fe/core/sqf/monitor/linux/process.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/process.cxx b/core/sqf/monitor/linux/process.cxx
index 02d6276..017ce76 100644
--- a/core/sqf/monitor/linux/process.cxx
+++ b/core/sqf/monitor/linux/process.cxx
@@ -545,11 +545,14 @@ bool CProcess::procExitReg(CProcess *targetProcess,
     {   // This process is not the parent of the target process (parent
         // processes automatically get process death notifications.)
 
-        // Add entry to list of processes that are being monitored
-        // by this process.
         nidPid_t target = { targetProcess->Nid, targetProcess->Pid };
         deathInterestLock_.lock();
-        deathInterest_.push_back ( target );
+        // Add entry to list of processes that are being monitored
+        // by this process.
+        deathInterest_.push_back( target );
+        // Add entry to set of nids of processes that are being monitored
+        // by this process.
+        deathInterestNid_.insert( targetProcess->Nid );
         deathInterestLock_.unlock();
 
         // Register interest with the target process 
@@ -580,12 +583,54 @@ bool CProcess::procExitReg(CProcess *targetProcess,
 #endif
 
 #ifndef NAMESERVER_PROCESS
+void CProcess::procExitNotifierNodes( void )
+{
+    const char method_name[] = "CProcess::procExitNotifierNodes";
+    TRACE_ENTRY;
+
+    CLNode *targetLNode;
+    CNode  *targetNode;
+    nidSet_t::iterator it;
+
+    // Remove death notice registration for all entries on list
+    deathInterestLock_.lock();
+    for ( it = deathInterestNid_.begin(); it != deathInterestNid_.end(); ++it)
+    {
+        targetLNode = Nodes->GetLNode ( *it );
+        if (targetLNode)
+        {
+            targetNode = targetLNode->GetNode();
+        }
+
+        if ( targetNode )
+        {
+            if (NameServerEnabled && targetNode->GetPNid() != MyPNID)
+            {
+                int rc = -1;
+                // Forward the process exit to the target node
+                rc = PtpClient->ProcessExit( this 
+                                           , targetLNode->GetNid()
+                                           , targetNode->GetName() ); 
+                if (rc)
+                {
+                    // TODO: Error handling
+                }
+            }
+        }
+    }
+    deathInterestNid_.clear();
+    deathInterestLock_.unlock();
+
+    TRACE_EXIT;
+}
+#endif
+
+#ifndef NAMESERVER_PROCESS
 void CProcess::procExitUnregAll ( _TM_Txid_External transId )
 {
     const char method_name[] = "CProcess::procExitUnregAll";
     TRACE_ENTRY;
 
-    nidPidList_t::iterator iter;
     CLNode *node;
     CProcess *targetProcess = NULL;
     nidPidList_t::iterator it;
@@ -3222,48 +3267,39 @@ void CProcess::Exit( CProcess *parent )
 #ifndef NAMESERVER_PROCESS
     if (NameServerEnabled)
     {
-        if ( parent && parent->IsClone() && Pid != -1 )
+        if ( parent )
         {
-            int targetNid = parent->GetNid();
-            CLNode *targetLNode = Nodes->GetLNode( targetNid );
-            // Send the process exit to the target node
-            int rc = PtpClient->ProcessExit( this
-                                           , targetNid
-                                           , targetLNode->GetNode()->GetName() );
-            if (rc)
+            if ( parent->IsClone() && Pid != -1 )
             {
-                // TODO: Error handling
+                int targetNid = parent->GetNid();
+                CLNode *targetLNode = Nodes->GetLNode( targetNid );
+                // Send the process exit to the parent node
+                int rc = PtpClient->ProcessExit( this
+                                               , targetNid
+                                               , targetLNode->GetNode()->GetName() );
+                if (rc)
+                {
+                    // TODO: Error handling
+                }
             }
-#if 0
-            // TODO: This is not the correct place. It needs to be found!
-            //       When the parent process is in a remote node and
-            //       the local node contains child processes,
-            //       a clone of the parent is created at child creation time,
-            //       when all child processes are deleted, it leaves the
-            //       parent clone process. Need to determine when all
-            //       child process objects which reference the parent clone
-            //       are deleted so the parent clone object can be deleted.
-            //       The symptom is that shutdown never occurs since there
-            //       are object which have not been deleted and the process
-            //       counts prevent the shutdown from completing.
-            if (parent->childCount() == 0)
+        }
+        else
+        {
+            if (GetParentNid() != -1)
             {
-                if (trace_settings & (TRACE_SYNC_DETAIL | TRACE_REQUEST_DETAIL | TRACE_PROCESS_DETAIL))
+                int targetNid = GetParentNid();
+                CLNode *targetLNode = Nodes->GetLNode( targetNid );
+                // Send the process exit to the parent node
+                int rc = PtpClient->ProcessExit( this
+                                               , targetNid
+                                               , targetLNode->GetNode()->GetName() );
+                if (rc)
                 {
-                    trace_printf( "%s@%d" " - Deleting parent %s (%d,%d:%d) of last child %s (%d,%d:%d) \n"
-                                , method_name, __LINE__
-                                , parent->GetName(), parent->GetNid()
-                                , parent->GetPid(), parent->GetVerifier()
-                                , GetName(), GetNid(), GetPid(), GetVerifier() );
+                    // TODO: Error handling
                 }
-
-                CNode *parentNode = Nodes->GetLNode(parent->GetNid())->GetNode();
-                parentNode->DelFromNameMap( parent );
-                parentNode->DelFromPidMap( parent );
-                parentNode->DeleteFromList( parent );
             }
-#endif
         }
+        procExitNotifierNodes();
     }
 #endif
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/6dc990fe/core/sqf/monitor/linux/process.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/process.h b/core/sqf/monitor/linux/process.h
index 9445f6e..90954f3 100644
--- a/core/sqf/monitor/linux/process.h
+++ b/core/sqf/monitor/linux/process.h
@@ -409,6 +409,7 @@ class CProcess
 
 
     bool procExitReg(CProcess *targetProcess, _TM_Txid_External transId);
+    void procExitNotifierNodes( void );
     void procExitUnregAll( _TM_Txid_External transId );
 
     void validateObj( void );
@@ -549,8 +550,10 @@ private:
     // Container to keep track of the processes for which this process
     // is interested in process death.  deathInterestLock_ is used to
     // protect both the deathInterest_ and CNotice list.
+    typedef set<int> nidSet_t;
     nidPidList_t deathInterest_;
-    CLock       deathInterestLock_;
+    nidSet_t     deathInterestNid_;
+    CLock        deathInterestLock_;
 
     CNotice       *NoticeHead;   // List of processes requesting death notice 
     CNotice       *NoticeTail;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/6dc990fe/core/sqf/monitor/linux/ptpclient.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/ptpclient.cxx b/core/sqf/monitor/linux/ptpclient.cxx
index 5e1380e..4f3f292 100644
--- a/core/sqf/monitor/linux/ptpclient.cxx
+++ b/core/sqf/monitor/linux/ptpclient.cxx
@@ -57,7 +57,7 @@ extern bool IsRealCluster;
 extern CMeas Meas;
 
 CPtpClient::CPtpClient (void)
-          : mon2monSock_(0)
+          : ptpSock_(0)
           , seqNum_(0)
 {
     const char method_name[] = "CPtpClient::CPtpClient";
@@ -89,13 +89,13 @@ CPtpClient::~CPtpClient (void)
     TRACE_EXIT;
 }
 
-int CPtpClient::InitializePtpClient( char * mon2monPort )
+int CPtpClient::InitializePtpClient( char * ptpPort )
 {
     const char method_name[] = "CPtpClient::InitializePtpClient";
     TRACE_ENTRY;
     int err = 0;
       
-    int sock = Monitor->MkCltSock( mon2monPort );                
+    int sock = Monitor->MkCltSock( ptpPort );                
     if (sock < 0)
     {
         err = sock;
@@ -108,50 +108,16 @@ int CPtpClient::InitializePtpClient( char * mon2monPort )
     }
     else
     {
-        mon2monSock_ = sock;
+        ptpSock_ = sock;
         if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
         {
             trace_printf( "%s@%d - connected to monitor node=%s, sock=%d\n"
                         , method_name, __LINE__
-                        , mon2monPort
-                        , mon2monSock_ );
+                        , ptpPort
+                        , ptpSock_ );
         }
     }
-#if 0    
-    // remove
-    if (err == 0)
-    {
-        nodeId_t msg;
-        strcpy(msg.nodeName, MyNode->GetName());
-        strcpy(msg.commPort, MyNode->GetCommPort());
-        strcpy(msg.syncPort, MyNode->GetSyncPort());
-        msg.pnid = MyNode->GetPNid();
-        msg.creatorPNid = -1;
-        msg.creatorShellPid = -1;
-        msg.creatorShellVerifier = -1;
-        msg.creator = false;
-        msg.ping = false;
-        if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
-        {
-            trace_printf( "%s@%d - sending node-info to monitor=%s, sock=%d\n"
-                        , method_name, __LINE__
-                        , mon2monPort
-                        , mon2monSock_);
-        }
-        err = SendSock((char *) &msg, sizeof(msg), mon2monSock_);
-        if (err)
-        {
-            if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
-            {
-                trace_printf( "%s@%d - error sending to monitor=%s, sock=%d, error=%d\n"
-                            , method_name, __LINE__
-                            , mon2monPort
-                            , mon2monSock_
-                            , err );
-            }
-        }
-    }
-#endif
+
     TRACE_EXIT;
     return err;
 }
@@ -807,7 +773,7 @@ int CPtpClient::SendToMon(const char *reqType, internal_msg_def *msg, int size,
     TRACE_ENTRY;
     
     char monPortString[MAX_PROCESSOR_NAME];
-    char mon2monPort[MAX_PROCESSOR_NAME];
+    char ptpPort[MAX_PROCESSOR_NAME];
     int tempPort = basePort_;
     
     // For virtual env
@@ -828,16 +794,16 @@ int CPtpClient::SendToMon(const char *reqType, internal_msg_def *msg, int size,
                     , basePort_ );
     }
 
-    memset( &mon2monPort, 0, MAX_PROCESSOR_NAME );
-    memset( &mon2monPortBase_, 0, MAX_PROCESSOR_NAME+100 );
+    memset( &ptpPort, 0, MAX_PROCESSOR_NAME );
+    memset( &ptpPortBase_, 0, MAX_PROCESSOR_NAME+100 );
 
-    strcat( mon2monPortBase_, hostName );
-    strcat( mon2monPortBase_, ":" );
+    strcat( ptpPortBase_, hostName );
+    strcat( ptpPortBase_, ":" );
     sprintf( monPortString,"%d", tempPort );
-    strcat( mon2monPort, mon2monPortBase_ );
-    strcat( mon2monPort, monPortString ); 
+    strcat( ptpPort, ptpPortBase_ );
+    strcat( ptpPort, monPortString ); 
 
-    int error = InitializePtpClient( mon2monPort );
+    int error = InitializePtpClient( ptpPort );
     if (error < 0)
     {
         TRACE_EXIT;
@@ -849,37 +815,37 @@ int CPtpClient::SendToMon(const char *reqType, internal_msg_def *msg, int size,
         trace_printf( "%s@%d - sending %s REQ to Monitor=%s, sock=%d\n"
                     , method_name, __LINE__
                     , reqType
-                    , mon2monPort
-                    , mon2monSock_);
+                    , ptpPort
+                    , ptpSock_);
     }
 
-    error = SendSock((char *) &size, sizeof(size), mon2monSock_);
+    error = SendSock((char *) &size, sizeof(size), ptpSock_);
     if (error)
     {
         if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
         {
             trace_printf( "%s@%d - error sending to Monitor=%s, sock=%d, error=%d\n"
                         , method_name, __LINE__
-                        , mon2monPort
-                        , mon2monSock_
+                        , ptpPort
+                        , ptpSock_
                         , error );
         }
     }
     
-    error = SendSock((char *) msg, size, mon2monSock_);
+    error = SendSock((char *) msg, size, ptpSock_);
     if (error)
     {
         if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
         {
             trace_printf( "%s@%d - error sending to nameserver=%s, sock=%d, error=%d\n"
                         , method_name, __LINE__
-                        , mon2monPort
-                        , mon2monSock_
+                        , ptpPort
+                        , ptpSock_
                         , error );
         }
     }
     
-    close( mon2monSock_ );
+    close( ptpSock_ );
 
     TRACE_EXIT;
     return error;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/6dc990fe/core/sqf/monitor/linux/ptpclient.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/ptpclient.h b/core/sqf/monitor/linux/ptpclient.h
index 7dd8b86..554bc71 100644
--- a/core/sqf/monitor/linux/ptpclient.h
+++ b/core/sqf/monitor/linux/ptpclient.h
@@ -40,7 +40,7 @@ public:
     CPtpClient( void );
     virtual ~CPtpClient( void );
 
-    int  InitializePtpClient( char * mon2monPort );
+    int  InitializePtpClient( char * ptpPort );
     int  ProcessClone( CProcess *process );
     int  ProcessExit( CProcess* process
                     , int parentNid
@@ -67,8 +67,8 @@ public:
 
 private:
     int  basePort_;
-    char mon2monPortBase_[MAX_PROCESSOR_NAME+100];
-    int  mon2monSock_;
+    char ptpPortBase_[MAX_PROCESSOR_NAME+100];
+    int  ptpSock_;
     int  seqNum_;
 
     int  ReceiveSock(char *buf, int size, int sockFd);

http://git-wip-us.apache.org/repos/asf/trafodion/blob/6dc990fe/core/sqf/monitor/linux/ptpcommaccept.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/ptpcommaccept.cxx b/core/sqf/monitor/linux/ptpcommaccept.cxx
index b070508..c6d5145 100644
--- a/core/sqf/monitor/linux/ptpcommaccept.cxx
+++ b/core/sqf/monitor/linux/ptpcommaccept.cxx
@@ -39,7 +39,7 @@ extern CMonitor *Monitor;
 extern CNode *MyNode;
 extern CNodeContainer *Nodes;
 extern int MyPNID;
-extern char MyMon2MonPort[MPI_MAX_PORT_NAME];
+extern char MyPtPPort[MPI_MAX_PORT_NAME];
 extern char *ErrorMsg (int error_code);
 extern const char *StateString( STATE state);
 extern CommType_t CommType;
@@ -235,7 +235,7 @@ void CPtpCommAccept::commAcceptorSock()
             }
     
             mem_log_write(CMonLog::MON_CONNTONEWMON_1);
-            sockFd = Monitor->AcceptMon2MonSock();
+            sockFd = Monitor->AcceptPtPSock();
         }
         else
         {
@@ -287,7 +287,7 @@ void CPtpCommAccept::shutdownWork(void)
 
     // Set flag that tells the PtpCommAccept thread to exit
     shutdown_ = true;   
-    Monitor->ConnectToSelf();
+    Monitor->ConnectToPtPCommSelf();
     CLock::wakeOne();
 
     if (trace_settings & TRACE_INIT)

http://git-wip-us.apache.org/repos/asf/trafodion/blob/6dc990fe/core/sqf/monitor/linux/shell.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/shell.cxx b/core/sqf/monitor/linux/shell.cxx
index 52afe06..20b41e6 100644
--- a/core/sqf/monitor/linux/shell.cxx
+++ b/core/sqf/monitor/linux/shell.cxx
@@ -82,6 +82,7 @@ char Path[MAX_SEARCH_PATH];
 char Wdir[MAX_SEARCH_PATH];
 char prompt[13];
 int VirtualNodes = 0;
+int VirtualNid = -1;
 int NumNodes = 0;
 int NumLNodes = 0;
 int CurNodes = 0;
@@ -848,7 +849,7 @@ void TraceInit( int & argc, char **&argv )
             // line arguments.
             for (int j=i, k=i+2; k < argc; j++, k++)
             {
-                printf ("setting argv[%d] = argv[%d]\n", j, k);
+                //printf ("setting argv[%d] = argv[%d]\n", j, k);
                 argv[j] = argv[k];
             }
             argc -= 2;
@@ -868,6 +869,32 @@ void TraceInit( int & argc, char **&argv )
     }
 }
 
+void VirtualNidInit( int & argc, char **&argv )
+{
+    // Check for trace flags specified on the command line.
+    for (int i = 0; i < argc; i++)
+    {
+        if ( strcmp ( argv[i], "-nid" ) == 0 && (i != argc-1) )
+        {   // <nid> setting specified on command line.
+            VirtualNid = atoi ( argv[i+1] );
+
+            // Remove the virtual nid arguments from the list of command
+            // line arguments.
+            for (int j=i, k=i+2; k < argc; j++, k++)
+            {
+                //printf ("setting argv[%d] = argv[%d]\n", j, k);
+                argv[j] = argv[k];
+            }
+            argc -= 2;
+        }
+    }
+
+    if (VirtualNid != -1)
+    {
+        printf( "Using VirtualNid=%d\n", VirtualNid );
+    }
+}
+
 void RedirectFd(int orig_fd, char *fifo_name)
 {
     int rdir_fd;
@@ -9302,6 +9329,9 @@ int main (int argc, char *argv[])
     // Initialize trace settings
     TraceInit ( argc, argv );
 
+    // Initialize virtual <nid> from command line args
+    VirtualNidInit( argc, argv );
+    
     MyName = new char [MAX_PROCESS_PATH];
     // setup defaults
     strcpy (MyName, "SHELL");
@@ -9340,6 +9370,12 @@ int main (int argc, char *argv[])
         MyNid = 0;
     }
 
+    if ( VirtualNodes && VirtualNid != -1)
+    {
+        // Override NyNid with the command line nid value
+        MyNid = VirtualNid;
+    }
+
     msg = new struct message_def;
 
     // Load default node information

http://git-wip-us.apache.org/repos/asf/trafodion/blob/6dc990fe/core/sqf/monitor/test/monitor.env
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/test/monitor.env b/core/sqf/monitor/test/monitor.env
index b8cf913..dd2cbb3 100644
--- a/core/sqf/monitor/test/monitor.env
+++ b/core/sqf/monitor/test/monitor.env
@@ -40,21 +40,21 @@ MONITOR_COMM_PORT=23330
 
 # Uncomment MON_TRACE_ENABLE and specific tracing level to enable 
 # Trafodion monitor process tracing
-#MON_TRACE_ENABLE=1
-#MON_TRACE_EVLOG_MSG=1
-#MON_TRACE_INIT=1
-#MON_TRACE_RECOVERY=1
-#MON_TRACE_REQUEST=1
-#MON_TRACE_PROCESS=1
-#MON_TRACE_NOTICE=1
-#MON_TRACE_NS=1
+MON_TRACE_ENABLE=1
+MON_TRACE_EVLOG_MSG=1
+MON_TRACE_INIT=1
+MON_TRACE_RECOVERY=1
+MON_TRACE_REQUEST=1
+MON_TRACE_PROCESS=1
+MON_TRACE_NOTICE=1
+MON_TRACE_NS=1
 #MON_TRACE_SYNC=1
 # Enable TC_TRACE_* along with MON_TRACE_TRAFCONFIG for more detail
 #MON_TRACE_TRAFCONFIG=1
 #MON_TRACE_MLIO=1
 
 #MON_TRACE_REQUEST_DETAIL=1
-#MON_TRACE_PROCESS_DETAIL=1
+MON_TRACE_PROCESS_DETAIL=1
 #MON_TRACE_NOTICE_DETAIL=1
 #MON_TRACE_SYNC_DETAIL=1
 #MON_TRACE_MLIO_DETAIL=1

http://git-wip-us.apache.org/repos/asf/trafodion/blob/6dc990fe/core/sqf/monitor/test/runtest
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/test/runtest b/core/sqf/monitor/test/runtest
index 20c06a9..5580d0a 100755
--- a/core/sqf/monitor/test/runtest
+++ b/core/sqf/monitor/test/runtest
@@ -169,13 +169,14 @@ shell <<eof
  delay 3
  exec {name \$CTRLR, nid 0, out $TRAF_HOME/monitor/test/childExit.lst} childExitCtrl $trace
  delay 3
- ps
  !shutdown
  exit
 eof
-if ( [ $test '==' -1 ] ); then
-shell -c ps 
+shell -nid 0 -c ps
+#shell -nid 0 -c ps;shell -nid 1 -c ps;shell -nid 2 -c ps;shell -nid 3 -c ps;shell -nid 4 -c ps;shell -nid 5 -c ps
+shell -nid 0 -c ps monitor;shell -nid 1 -c ps monitor;shell -nid 2 -c ps monitor;shell -nid 3 -c ps monitor;shell -nid 4 -c ps monitor;shell -nid 5 -c ps monitor
 shell -c ps monitor
+if ( [ $test '==' -1 ] ); then
 shell -a<<eof
  shutdown
  exit
@@ -211,12 +212,11 @@ shell <<eof
  exec {pri 10,name \$CLIENT,nid 0, out $TRAF_HOME/monitor/test/multiNode.lst} client $trace
  delay 3
  !shutdown
- ps
  exit
 eof
-if ( [ $test '==' -1 ] ); then
 shell -c ps 
 shell -c ps monitor
+if ( [ $test '==' -1 ] ); then
 shell -a<<eof
  shutdown
  exit
@@ -243,13 +243,12 @@ shell <<eof
  delay 3
  exec {name \$CTRLR, nid 0, out $TRAF_HOME/monitor/test/regTest.lst} regTestCtrl $trace
  delay 3
- ps
  !shutdown
  exit
 eof
-if ( [ $test '==' -1 ] ); then
 shell -c ps 
 shell -c ps monitor
+if ( [ $test '==' -1 ] ); then
 shell -a<<eof
  shutdown
  exit
@@ -287,13 +286,12 @@ shell <<eof
  !
  exec {name \$DEATH, nid 0, out $TRAF_HOME/monitor/test/deathNotice.lst} deathNotice $trace
  delay 3
- ps
  !shutdown
  exit
 eof
-if ( [ $test '==' -1 ] ); then
 shell -c ps 
 shell -c ps monitor
+if ( [ $test '==' -1 ] ); then
 shell -a<<eof
  shutdown
  exit
@@ -324,13 +322,12 @@ shell <<eof
  delay 15
  exec {name \$PPROC, nid 0, out $TRAF_HOME/monitor/test/persistentProc.lst} persistentProc $trace
  delay 3
- ps
  !shutdown
  exit
 eof
-if ( [ $test '==' -1 ] ); then
 shell -c ps 
 shell -c ps monitor
+if ( [ $test '==' -1 ] ); then
 shell -a<<eof
  shutdown
  exit
@@ -350,13 +347,12 @@ shell <<eof
  delay 3
  exec {name \$PPROC, nid 0, out $TRAF_HOME/monitor/test/persistentProc.lst} persistentProc $trace
  delay 3
- ps
  !shutdown
  exit
 eof
-if ( [ $test '==' -1 ] ); then
 shell -c ps 
 shell -c ps monitor
+if ( [ $test '==' -1 ] ); then
 shell -a<<eof
  shutdown
  exit
@@ -382,13 +378,12 @@ shell <<eof
  delay 3
  exec {name \$DTMCTRL, nid 0, out $TRAF_HOME/monitor/test/dtmTest.lst} dtmCtrl $trace
  delay 3
- ps
  !shutdown
  exit
 eof
-if ( [ $test '==' -1 ] ); then
 shell -c ps 
 shell -c ps monitor
+if ( [ $test '==' -1 ] ); then
 shell -a<<eof
  shutdown
  exit
@@ -420,13 +415,12 @@ shell <<eof
  delay 3
  exec {name \$SPXCTRL, nid 0, out $TRAF_HOME/monitor/test/spxTest.lst} spxCtrl $trace
  delay 3
- ps
  !shutdown
  exit
 eof
-if ( [ $test '==' -1 ] ); then
 shell -c ps 
 shell -c ps monitor
+if ( [ $test '==' -1 ] ); then
 shell -a<<eof
  shutdown
  exit
@@ -453,13 +447,12 @@ shell <<eof
  delay 3
  exec {name \$PCRE8, nid 0, out $TRAF_HOME/monitor/test/procCreate.lst} procCreate $trace -x
  delay 3
- ps
  !shutdown
  exit
 eof
-if ( [ $test '==' -1 ] ); then
 shell -c ps 
 shell -c ps monitor
+if ( [ $test '==' -1 ] ); then
 shell -a<<eof
  shutdown
  exit
@@ -488,13 +481,12 @@ shell <<eof
  delay 3
  down 1 !
  delay 10
- ps
  !shutdown
  exit
 eof
-if ( [ $test '==' -1 ] ); then
 shell -c ps 
 shell -c ps monitor
+if ( [ $test '==' -1 ] ); then
 shell -a<<eof
  shutdown
  exit
@@ -525,13 +517,12 @@ shell <<eof
  exec {nowait, nid 0, name \$CTRLR, out $TRAF_HOME/monitor/test/tmSync.lst} tmSyncCtrl -n 1,3,4,5,6 $trace
  wait $CTRLR
  delay 3
- ps
  !shutdown
  exit
 eof
-if ( [ $test '==' -1 ] ); then
 shell -c ps 
 shell -c ps monitor
+if ( [ $test '==' -1 ] ); then
 shell -a<<eof
  shutdown
  exit
@@ -551,13 +542,12 @@ shell <<eof
  exec {nowait, nid 0, name \$CTRLR, out $TRAF_HOME/monitor/test/tmSync8.lst} tmSyncCtrl -n 8 $trace
  wait $CTRLR
  delay 3
- ps
  !shutdown
  exit
 eof
-if ( [ $test '==' -1 ] ); then
 shell -c ps 
 shell -c ps monitor
+if ( [ $test '==' -1 ] ); then
 shell -a<<eof
  shutdown
  exit
@@ -579,13 +569,12 @@ shell <<eof
  exec {nowait, nid 0, name \$CTRLR, out $TRAF_HOME/monitor/test/tmSync10.lst} tmSyncCtrl -n 10 $trace
  wait $CTRLR
  delay 3
- ps
  !shutdown
  exit
 eof
-if ( [ $test '==' -1 ] ); then
 shell -c ps 
 shell -c ps monitor
+if ( [ $test '==' -1 ] ); then
 shell -a<<eof
  shutdown
  exit
@@ -606,13 +595,12 @@ shell <<eof
  exec {nowait, nid 0, name \$CTRLR, out $TRAF_HOME/monitor/test/tmSync.lst} tmSyncCtrl -n 3,4,5,6,7 $trace
  wait $CTRLR
  delay 3
- ps
  !shutdown
  exit
 eof
-if ( [ $test '==' -1 ] ); then
 shell -c ps 
 shell -c ps monitor
+if ( [ $test '==' -1 ] ); then
 shell -a<<eof
  shutdown
  exit

http://git-wip-us.apache.org/repos/asf/trafodion/blob/6dc990fe/core/sqf/monitor/test/sqconfig.monitor.virtual
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/test/sqconfig.monitor.virtual b/core/sqf/monitor/test/sqconfig.monitor.virtual
index 8f6750c..9ab56e8 100644
--- a/core/sqf/monitor/test/sqconfig.monitor.virtual
+++ b/core/sqf/monitor/test/sqconfig.monitor.virtual
@@ -24,6 +24,9 @@ _virtualnodes 6
 end node
 
 begin name-server
-nodes=0
+#nodes=0
+nodes=0,1
+#nodes=0,1,2
+#nodes=0,1,2,3
 #nodes=0,1,2,3,4,5
 end name-server


[31/50] [abbrv] trafodion git commit: Fix socket leak (close socket).

Posted by su...@apache.org.
Fix socket leak (close socket).


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

Branch: refs/heads/master
Commit: a528474031e76e0ad4b8fc478bb137a879f444ec
Parents: a113135
Author: Dave George <de...@gmail.com>
Authored: Thu Apr 12 21:43:31 2018 +0000
Committer: Dave George <de...@gmail.com>
Committed: Thu Apr 12 21:43:31 2018 +0000

----------------------------------------------------------------------
 core/sqf/monitor/linux/ptpcommaccept.cxx | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/a5284740/core/sqf/monitor/linux/ptpcommaccept.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/ptpcommaccept.cxx b/core/sqf/monitor/linux/ptpcommaccept.cxx
index dc48b41..fa21dc0 100644
--- a/core/sqf/monitor/linux/ptpcommaccept.cxx
+++ b/core/sqf/monitor/linux/ptpcommaccept.cxx
@@ -278,6 +278,7 @@ void CPtpCommAccept::commAcceptorSock()
         else
         {
             processNewSock( sockFd );
+            close( sockFd );
         }
     }
 


[21/50] [abbrv] trafodion git commit: Update.

Posted by su...@apache.org.
Update.


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

Branch: refs/heads/master
Commit: d5742bee2e0747334a7378ca22c52f35662f05ec
Parents: 47b3793
Author: Dave George <de...@gmail.com>
Authored: Fri Apr 6 17:16:35 2018 +0000
Committer: Dave George <de...@gmail.com>
Committed: Fri Apr 6 17:16:35 2018 +0000

----------------------------------------------------------------------
 core/sqf/src/seabed/test/gosetupcl3 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/d5742bee/core/sqf/src/seabed/test/gosetupcl3
----------------------------------------------------------------------
diff --git a/core/sqf/src/seabed/test/gosetupcl3 b/core/sqf/src/seabed/test/gosetupcl3
index 550ce92..90151ce 100755
--- a/core/sqf/src/seabed/test/gosetupcl3
+++ b/core/sqf/src/seabed/test/gosetupcl3
@@ -22,7 +22,10 @@
 # setup
 . ./gosetup
 ./godb 3
-if [ "$cluster" != "-cluster" ]; then
+if [ "$cluster" = "-cluster" ]; then
+	nodes=`SQ_CONFIGDB=$PWD/sqconfig.db trafconf -wname`
+	pdcp $nodes sqconfig.db $PWD/sqconfig.db
+else
 	export SQ_VIRTUAL_NODES=3
 	export SQ_VIRTUAL_NID=0
 fi


[02/50] [abbrv] trafodion git commit: Update.

Posted by su...@apache.org.
Update.


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

Branch: refs/heads/master
Commit: 38935a48342483cdce46fccedfdf562dc4b9ea72
Parents: b0f649b
Author: Dave George <de...@gmail.com>
Authored: Fri Mar 23 19:10:23 2018 +0000
Committer: Dave George <de...@gmail.com>
Committed: Fri Mar 23 19:10:23 2018 +0000

----------------------------------------------------------------------
 core/sqf/monitor/linux/nsreqqueue.cxx | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/38935a48/core/sqf/monitor/linux/nsreqqueue.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nsreqqueue.cxx b/core/sqf/monitor/linux/nsreqqueue.cxx
index aa92ead..aeb1d53 100644
--- a/core/sqf/monitor/linux/nsreqqueue.cxx
+++ b/core/sqf/monitor/linux/nsreqqueue.cxx
@@ -41,7 +41,7 @@ void CRequest::monreply(struct message_def *msg, int sockFd, int *error)
         {
         case ReplyType_Generic:
             size += sizeof(struct Generic_reply_def);
-            if (trace_settings & (TRACE_PROCESS_DETAIL))
+            if (trace_settings & (TRACE_NS | TRACE_PROCESS_DETAIL))
             {
                 trace_printf("%s@%d reply type=%d(Generic), size=%d, sock=%d\n", method_name, __LINE__,
                              msg->u.reply.type, size, sockFd);
@@ -51,7 +51,7 @@ void CRequest::monreply(struct message_def *msg, int sockFd, int *error)
             break;
         case ReplyType_DelProcessNs:
             size += sizeof(struct DelProcessNs_reply_def);
-            if (trace_settings & (TRACE_PROCESS_DETAIL))
+            if (trace_settings & (TRACE_NS | TRACE_PROCESS_DETAIL))
             {
                 trace_printf("%s@%d reply type=%d(DelProcessNs), size=%d, sock=%d\n", method_name, __LINE__,
                              msg->u.reply.type, size, sockFd);
@@ -59,7 +59,7 @@ void CRequest::monreply(struct message_def *msg, int sockFd, int *error)
             break;
         case ReplyType_NewProcessNs:
             size += sizeof(struct NewProcessNs_reply_def);
-            if (trace_settings & (TRACE_PROCESS_DETAIL))
+            if (trace_settings & (TRACE_NS | TRACE_PROCESS_DETAIL))
             {
                 trace_printf("%s@%d reply type=%d(NewProcessNs), size=%d, sock=%d\n", method_name, __LINE__,
                              msg->u.reply.type, size, sockFd);
@@ -67,7 +67,7 @@ void CRequest::monreply(struct message_def *msg, int sockFd, int *error)
             break;
         case ReplyType_ProcessInfo:
             size += sizeof(struct ProcessInfo_reply_def);
-            if (trace_settings & (TRACE_PROCESS_DETAIL))
+            if (trace_settings & (TRACE_NS | TRACE_PROCESS_DETAIL))
             {
                 trace_printf("%s@%d reply type=%d(ProcessInfo), size=%d, sock=%d\n", method_name, __LINE__,
                              msg->u.reply.type, size, sockFd);
@@ -78,7 +78,7 @@ void CRequest::monreply(struct message_def *msg, int sockFd, int *error)
             }
             break;
         default:
-            if (trace_settings & (TRACE_PROCESS_DETAIL))
+            if (trace_settings & (TRACE_NS | TRACE_PROCESS_DETAIL))
             {
                 trace_printf("%s@%d reply type=%d(?), size=%d, sock=%d\n", method_name, __LINE__,
                              msg->u.reply.type, size, sockFd);


[07/50] [abbrv] trafodion git commit: Merge branch 'TRAFODION-2884' of github.com:zcorrea/trafodion into TRAFODION-2884

Posted by su...@apache.org.
Merge branch 'TRAFODION-2884' of github.com:zcorrea/trafodion into TRAFODION-2884


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

Branch: refs/heads/master
Commit: b565fb746e47dfe4b9858e02a81a1b1bf63c1ac6
Parents: abf3c42 38935a4
Author: Zalo Correa <za...@esgyn.com>
Authored: Wed Mar 28 17:04:12 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Wed Mar 28 17:04:12 2018 -0700

----------------------------------------------------------------------
 core/sqf/monitor/linux/nsreqqueue.cxx | 10 +++++-----
 core/sqf/src/seabed/test/go141        |  3 +++
 core/sqf/src/seabed/test/go190        |  3 +++
 core/sqf/src/seabed/test/go22         |  2 +-
 core/sqf/src/seabed/test/go23         |  2 +-
 core/sqf/src/seabed/test/go83         |  2 +-
 core/sqf/src/seabed/test/goall        | 24 ++++++++++++------------
 core/sqf/src/seabed/test/gosetup      |  2 ++
 core/sqf/src/seabed/test/goshell      |  2 +-
 core/sqf/src/seabed/test/goshell124   |  4 ++++
 core/sqf/src/seabed/test/goshell49    |  6 +++---
 core/sqf/src/seabed/test/t209ms.cpp   |  4 ++++
 core/sqf/src/seabed/test/t226fs.cpp   |  4 ++++
 core/sqf/src/seabed/test/t279ms.cpp   | 12 +++++++++---
 14 files changed, 53 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/b565fb74/core/sqf/monitor/linux/nsreqqueue.cxx
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/nsreqqueue.cxx
index e189929,aeb1d53..f174cf2
--- a/core/sqf/monitor/linux/nsreqqueue.cxx
+++ b/core/sqf/monitor/linux/nsreqqueue.cxx
@@@ -77,18 -77,8 +77,18 @@@ void CRequest::monreply(struct message_
                               msg->u.reply.u.process_info.return_code);
              }
              break;
 +        case ReplyType_ProcessInfoNs:
 +            size += sizeof(struct ProcessInfoNs_reply_def);
 +            if (trace_settings & (TRACE_PROCESS_DETAIL))
 +            {
 +                trace_printf("%s@%d reply type=%d(ProcessInfoNs), size=%d, sock=%d\n", method_name, __LINE__,
 +                             msg->u.reply.type, size, sockFd);
 +                trace_printf("%s@%d process-info reply. rc=%d\n", method_name, __LINE__,
 +                             msg->u.reply.u.process_info.return_code);
 +            }
 +            break;
          default:
-             if (trace_settings & (TRACE_PROCESS_DETAIL))
+             if (trace_settings & (TRACE_NS | TRACE_PROCESS_DETAIL))
              {
                  trace_printf("%s@%d reply type=%d(?), size=%d, sock=%d\n", method_name, __LINE__,
                               msg->u.reply.type, size, sockFd);


[05/50] [abbrv] trafodion git commit: Preliminary monitor p-2-p communication changes.

Posted by su...@apache.org.
http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/process.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/process.cxx b/core/sqf/monitor/linux/process.cxx
index fffd750..02d6276 100644
--- a/core/sqf/monitor/linux/process.cxx
+++ b/core/sqf/monitor/linux/process.cxx
@@ -203,6 +203,7 @@ CProcess::CProcess (CProcess * parent, int nid, int pid,
     , NoticeTail(NULL)
 #endif
 #ifdef NAMESERVER_PROCESS
+    , monSockFd_(-1)
     , origPNidNs_(-1)
 #endif
 {
@@ -477,6 +478,8 @@ bool CProcess::CancelDeathNotification( int nid
 
     while( notice )
     {
+        // This process no longer wants to be notified of death of process
+        // identified by nid, pid, verifier
         if ((( notice->Nid == nid    ) && 
              ( notice->Pid == pid    ) && 
              ( notice->verifier_ == verifier ) && 
@@ -593,13 +596,33 @@ void CProcess::procExitUnregAll ( _TM_Txid_External transId )
     {
         node = Nodes->GetLNode ( it->nid );
         targetProcess = NULL;
-        if  (node)
+        if (node)
         {
             targetProcess = node->GetProcessL( it->pid );
         }
 
         if ( targetProcess )
         {
+            if (NameServerEnabled && targetProcess->IsClone())
+            {
+                CLNode *targetLNode = Nodes->GetLNode( targetProcess->GetNid() );
+            
+                int rc = -1;
+                // Forward the process cancel death notification to the target node
+                rc = PtpClient->ProcessNotify( targetProcess->GetNid()
+                                             , targetProcess->GetPid()
+                                             , targetProcess->GetVerifier()
+                                             , transId
+                                             , true // cancel target's death notification
+                                             , this // of this process
+                                             , targetLNode->GetNid()
+                                             , targetLNode->GetNode()->GetName() ); 
+                if (rc)
+                {
+                    // TODO: Error handling
+                }
+            }
+            
             targetProcess->CancelDeathNotification( Nid
                                                   , Pid
                                                   , Verifier
@@ -626,6 +649,18 @@ void CProcess::childAdd ( int nid, int pid )
     TRACE_EXIT;
 }
 
+int CProcess::childCount ( void )
+{
+    const char method_name[] = "CProcess::childCount";
+    TRACE_ENTRY;
+
+    childrenListLock_.lock();
+    int count = children_.size();
+    childrenListLock_.unlock();
+
+    TRACE_EXIT;
+    return(count);
+}
 
 void CProcess::childRemove ( int nid, int pid )
 {
@@ -732,9 +767,6 @@ void CProcess::CompleteProcessStartup (char *port, int os_pid, bool event_messag
     Pid = os_pid;
     Event_messages = event_messages;
     System_messages = system_messages;
-#ifdef NAMESERVER_PROCESS
-    origPNidNs_ = origPNidNs;
-#endif
 
     if (preclone)
     {
@@ -754,12 +786,39 @@ void CProcess::CompleteProcessStartup (char *port, int os_pid, bool event_messag
             if ( MyNode->IsMyNode(Nid) )
             {
                 if ( NameServerEnabled )
-                    NameServer->ProcessNew(this); // in reqQueue thread (CExtStartupReq)
+                {
+                    int rc = -1;
+                    // Register process in Name Server
+                    rc = NameServer->ProcessNew(this); // in reqQueue thread (CExtStartupReq)
+                    if (rc)
+                    {
+                        // TODO: Error handling
+                    }
 
-//TRK-TODO - ??
-                // Replicate the clone to other nodes
-                CReplClone *repl = new CReplClone(this);
-                Replicator.addItem(repl);
+                    if (Parent_Nid != -1)
+                    {
+                        if (Parent_Nid != Nid)
+                        {
+                            // Tell the parent node the current state of the process
+                            rc = PtpClient->ProcessClone(this);
+                            if (rc)
+                            {
+                                // TODO: Error handling
+                            }
+                        }
+                        else
+                        {
+                            // TODO: Generate internal clone request?
+                            //       to update local parent?  
+                        }
+                    }
+                }
+                else
+                {
+                    // Replicate the clone to other nodes
+                    CReplClone *repl = new CReplClone(this);
+                    Replicator.addItem(repl);
+                }
             }
             else
             {
@@ -768,9 +827,34 @@ void CProcess::CompleteProcessStartup (char *port, int os_pid, bool event_messag
         }
         else
         {
-            // Replicate the clone to other nodes
-            CReplClone *repl = new CReplClone(this);
-            Replicator.addItem(repl);
+            // TODO: What does an os_pid == -1 mean?
+            if ( NameServerEnabled )
+            {
+                if (Parent_Nid != -1)
+                {
+                    if (Parent_Nid != Nid)
+                    {
+                        int rc = -1;
+                        // Tell the parent node the current state of the process
+                        rc = PtpClient->ProcessClone(this);
+                        if (rc)
+                        {
+                            // TODO: Error handling
+                        }
+                    }
+                    else
+                    {
+                        // TODO: Generate internal clone request?
+                        //       to update local parent?  
+                    }
+                }
+            }
+            else
+            {
+                // Replicate the clone to other nodes
+                CReplClone *repl = new CReplClone(this);
+                Replicator.addItem(repl);
+            }
         }
     }
 
@@ -2797,6 +2881,15 @@ void CProcess::Exit( CProcess *parent )
     }
 #endif
 
+    if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
+       trace_printf( "%s@%d" " - Process %s (%d,%d:%d) is exiting, parent process %s (%d,%d:%d)\n"
+                   , method_name, __LINE__
+                   , GetName(), GetNid(), GetPid(), GetVerifier()
+                   , parent?parent->GetName():""
+                   , parent?parent->GetNid():-1
+                   , parent?parent->GetPid():-1
+                   , parent?parent->GetVerifier():-1 );
+
     SetState(State_Stopped);
 
     // if the env is set to not deliver death messages upon node down,
@@ -2817,7 +2910,12 @@ void CProcess::Exit( CProcess *parent )
         !(Type == ProcessType_DTM && IsAbended()) &&
         supplyProcessDeathNotices )
     {
-        // Notify all registered processes of this process' death
+        if ( !Clone && NameServerEnabled )
+        {
+            // Notify all remote registered nodes of this process' death
+            NoticeHead->NotifyRemote();
+        }
+        // Notify all local registered processes of this process' death
         NoticeHead->NotifyAll();
     }
 #endif
@@ -3120,6 +3218,55 @@ void CProcess::Exit( CProcess *parent )
                trace_printf("%s@%d" " - Parent doesn't want Death message" "\n", method_name, __LINE__);
         }
     }
+
+#ifndef NAMESERVER_PROCESS
+    if (NameServerEnabled)
+    {
+        if ( parent && parent->IsClone() && Pid != -1 )
+        {
+            int targetNid = parent->GetNid();
+            CLNode *targetLNode = Nodes->GetLNode( targetNid );
+            // Send the process exit to the target node
+            int rc = PtpClient->ProcessExit( this
+                                           , targetNid
+                                           , targetLNode->GetNode()->GetName() );
+            if (rc)
+            {
+                // TODO: Error handling
+            }
+#if 0
+            // TODO: This is not the correct place. It needs to be found!
+            //       When the parent process is in a remote node and
+            //       the local node contains child processes,
+            //       a clone of the parent is created at child creation time,
+            //       when all child processes are deleted, it leaves the
+            //       parent clone process. Need to determine when all
+            //       child process objects which reference the parent clone
+            //       are deleted so the parent clone object can be deleted.
+            //       The symptom is that shutdown never occurs since there
+            //       are object which have not been deleted and the process
+            //       counts prevent the shutdown from completing.
+            if (parent->childCount() == 0)
+            {
+                if (trace_settings & (TRACE_SYNC_DETAIL | TRACE_REQUEST_DETAIL | TRACE_PROCESS_DETAIL))
+                {
+                    trace_printf( "%s@%d" " - Deleting parent %s (%d,%d:%d) of last child %s (%d,%d:%d) \n"
+                                , method_name, __LINE__
+                                , parent->GetName(), parent->GetNid()
+                                , parent->GetPid(), parent->GetVerifier()
+                                , GetName(), GetNid(), GetPid(), GetVerifier() );
+                }
+
+                CNode *parentNode = Nodes->GetLNode(parent->GetNid())->GetNode();
+                parentNode->DelFromNameMap( parent );
+                parentNode->DelFromPidMap( parent );
+                parentNode->DeleteFromList( parent );
+            }
+#endif
+        }
+    }
+#endif
+
     TRACE_EXIT;
 }
 
@@ -3482,6 +3629,7 @@ CNotice *CProcess::RegisterDeathNotification( int nid
 }
 #endif
 
+#ifndef NAMESERVER_PROCESS
 void CProcess::ReplyNewProcess (struct message_def * reply_msg,
                                 CProcess * process, int result)
 {
@@ -3505,14 +3653,13 @@ void CProcess::ReplyNewProcess (struct message_def * reply_msg,
                      process->Name, process->Nid, process->Pid, process->Verifier,
                      Name, Nid, Pid, result);
 
-#ifndef NAMESERVER_PROCESS
     // send reply to the parent
     SQ_theLocalIOToClient->sendCtlMsg
         ( Pid, MC_SReady, ((SharedMsgDef*)reply_msg)-> trailer.index );
-#endif
 
     TRACE_EXIT;
 }
+#endif
 
 
 #ifndef NAMESERVER_PROCESS
@@ -4099,7 +4246,7 @@ void CProcessContainer::AttachProcessCheck ( struct message_def *msg )
             msg->u.reply.u.generic.return_code = MPI_ERR_NAME;
         }
     }
-    // check if its a attach request, if so setup the process
+    // check if its an attach request, if so setup the process
     else if ((msg->u.request.u.startup.nid == -1) &&
              (msg->u.request.u.startup.pid == -1)   )
     {
@@ -4383,14 +4530,18 @@ bool CProcessContainer::CancelDeathNotification( int nid
 #endif
 
 #ifndef NAMESERVER_PROCESS
+// Child_Exit terminates all child processes created by the parent process
+// unless the child process is Unhooked from the parent process
 void CProcessContainer::Child_Exit ( CProcess * parent )
 {
     CProcess *process;
 
     const char method_name[] = "CProcessContainer::Child_Exit";
     TRACE_ENTRY;
-    if (trace_settings & TRACE_ENTRY_EXIT)
-        trace_printf("%s@%d with parent (%d, %d)\n", method_name, __LINE__, parent->GetNid(), parent->GetPid() );
+    if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
+        trace_printf( "%s@%d for parent (%d, %d:%d)\n"
+                    , method_name, __LINE__
+                    , parent->GetNid(), parent->GetPid(), parent->GetVerifier() );
     
     if ( parent &&
            ((MyNode->GetState() != State_Shutdown && 
@@ -4398,26 +4549,26 @@ void CProcessContainer::Child_Exit ( CProcess * parent )
            || (parent->GetType() == ProcessType_SPX) ) )
     {
         CProcess::nidPid_t child;
-        CLNode * childNode;
+        CLNode * childLNode;
 
         while ( parent->childRemoveFirst ( child ))
         {
 
-            childNode = Nodes->GetLNode( child.nid );
-            process = (childNode != NULL )
-                         ? childNode->GetNode()->GetProcess( child.pid ) : NULL;
+            childLNode = Nodes->GetLNode( child.nid );
+            process = (childLNode != NULL )
+                         ? childLNode->GetNode()->GetProcess( child.pid ) : NULL;
 
             if ( process && (!process->IsUnhooked()) )
             {
 
                 if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
-                    trace_printf("%s@%d - Child process %s (%d, %d) exits due "
-                                 "to parent death (%d, %d)\n",
+                    trace_printf("%s@%d - Child process %s (%d, %d:%d) exits due "
+                                 "to parent death (%d, %d:%d)\n",
                                  method_name, __LINE__, process->GetName(),
-                                 process->GetNid(), process->GetPid(),
-                                 parent->GetNid(), parent->GetPid());
+                                 process->GetNid(), process->GetPid(), process->GetVerifier(),
+                                 parent->GetNid(), parent->GetPid(), parent->GetVerifier());
                 
-                childNode->SetProcessState( process, State_Down, true );
+                childLNode->SetProcessState( process, State_Down, true );
                 if ( !process->IsClone() )
                 {
                     if ( parent->GetType() == ProcessType_SPX )
@@ -4429,6 +4580,19 @@ void CProcessContainer::Child_Exit ( CProcess * parent )
                         kill (process->GetPid(), Monitor->GetProcTermSig()); 
                     }
                 }
+                else
+                {
+                    if (NameServerEnabled)
+                    {
+                        CNode  *childNode = childLNode->GetNode();
+                        // Forward the process create to the target node
+                        PtpClient->ProcessKill( process
+                                              , process->GetAbort()
+                                              , childLNode->GetNid()
+                                              , childNode->GetName());
+                    }
+                }
+                
                 if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
                     trace_printf("%s@%d - Completed kill for child process %s (%d, %d)\n", method_name, __LINE__, process->GetName(), process->GetNid(), process->GetPid());
             }
@@ -4948,6 +5112,7 @@ void CProcessContainer::DumpCallback( int nid, pid_t pid, int status )
 #endif
 
 
+#ifndef NAMESERVER_PROCESS
 CProcess * CProcessContainer::ParentNewProcReply ( CProcess *process, int result )
 {
     const char method_name[] = "CProcessContainer::ParentNewProcReply";
@@ -4964,10 +5129,8 @@ CProcess * CProcessContainer::ParentNewProcReply ( CProcess *process, int result
     // If we have a parent process then it is expecting a reply
     if (parent && !parent->IsClone() && !parent->IsPaired())
     {
-#ifndef NAMESERVER_PROCESS
         if (!process->IsNowait())
         {   // The new process request was "waited" so send reply now
-#endif
             struct message_def *reply_msg;
             reply_msg = process->parentContext();
  
@@ -4979,19 +5142,18 @@ CProcess * CProcessContainer::ParentNewProcReply ( CProcess *process, int result
                 // buffer) is no longer valid.
                 process->parentContext( NULL );
             }
-#ifndef NAMESERVER_PROCESS
         }
         else
         {   // The new process request was "no-wait" so send notice now
             process->SendProcessCreatedNotice(parent, result);
         }
-#endif
     }  
 
     TRACE_EXIT;
 
     return parent;
 }
+#endif
 
 #ifndef NAMESERVER_PROCESS
 void CProcessContainer::Exit_Process (CProcess *process, bool abend, int downNode)
@@ -5030,6 +5192,7 @@ void CProcessContainer::Exit_Process (CProcess *process, bool abend, int downNod
             mon_log_write(MON_PROCESSCONT_EXITPROCESS_1, SQ_LOG_ERR, la_buf);
             abort();
         }
+
         if ( process->GetState() == State_Stopped )
         {
             if (trace_settings & (TRACE_SYNC_DETAIL | TRACE_REQUEST_DETAIL | TRACE_PROCESS_DETAIL))
@@ -5072,9 +5235,7 @@ void CProcessContainer::Exit_Process (CProcess *process, bool abend, int downNod
         // Unregister any interest in other process' death
         _TM_Txid_External transid;
         transid = invalid_trans();
-#ifndef NAMESERVER_PROCESS
         process->procExitUnregAll( transid );
-#endif
 
         // Handle the process termination
         process->Exit( parent );
@@ -5096,14 +5257,9 @@ void CProcessContainer::Exit_Process (CProcess *process, bool abend, int downNod
             {
                 if (!process->IsClone() && !MyNode->isInQuiesceState())
                 {
-                    // Replicate the exit to other nodes
-//TRK-TODO 
-            //        if (NameServerEnabled)
-                    {
-                        //message to monitor  
-                    }
-            //        else
+                    if (!NameServerEnabled)
                     {
+                        // Replicate the exit to other nodes
                         CReplExit *repl = new CReplExit(process->GetNid(),
                                                     process->GetPid(),
                                                     process->GetVerifier(),
@@ -5137,12 +5293,7 @@ void CProcessContainer::Exit_Process (CProcess *process, bool abend, int downNod
                    process->IsAbended() &&
                    MyNode->GetShutdownLevel() == ShutdownLevel_Undefined) )
             {
-//TRK-TODO 
-      //        if (NameServerEnabled)
-                {
-                    //message to monitor  
-                }
-        //        else
+                if (!NameServerEnabled)
                 {
                     // Replicate the exit to other nodes
                     CReplExit *repl = new CReplExit(process->GetNid(),

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/process.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/process.h b/core/sqf/monitor/linux/process.h
index 074c13d..9445f6e 100644
--- a/core/sqf/monitor/linux/process.h
+++ b/core/sqf/monitor/linux/process.h
@@ -127,9 +127,11 @@ class CProcessContainer
                              );
     bool Dump_Process( CProcess *dumper, CProcess *process, char *core_path );
     void DumpCallback( int nid, pid_t pid, int status );
-    static CProcess *ParentNewProcReply ( CProcess *process, int result );
 #ifndef NAMESERVER_PROCESS
+    static CProcess *ParentNewProcReply ( CProcess *process, int result );
     void Exit_Process( CProcess *process, bool abend, int downNode );
+#else
+    static CProcess *MonReply ( CProcess *process, int result );
 #endif
     CProcess *GetFirstProcess( void ) { return(head_); };
     CProcess *GetLastProcess( void ) { return(tail_); };
@@ -299,6 +301,7 @@ class CProcess
     inline void SetPairParentVerifier( int verifier ) { PairParentVerifier = verifier; }
     inline int GetPriority ( ) { return Priority; }
     inline void SetTag ( long long tag ) { Tag = tag; }
+    inline int GetReplyTag ( ) { return ReplyTag; }
     inline void SetReplyTag ( int tag ) { ReplyTag = tag; }
     inline const char * GetPort ( ) { return Port; }
     inline PROCESSTYPE GetType ( ) { return Type; }
@@ -317,6 +320,8 @@ class CProcess
     inline int GetDumperVerifier ( ) { return DumperVerifier; }
     inline const char * GetDumpFile () { return dumpFile_.c_str(); }
 #ifdef NAMESERVER_PROCESS
+    inline int GetMonSockFd( ) { return monSockFd_; }
+    inline void SetMonSockFd( int sockFd ) { monSockFd_ = sockFd; }
     inline int GetOrigPNidNs( ) { return origPNidNs_; }
     inline void SetOrigPNidNs( int pnid ) { origPNidNs_ = pnid; }
 #endif
@@ -342,9 +347,9 @@ class CProcess
                                       , Verifier_t verifier
                                       , const char *name
                                       , _TM_Txid_External trans_id );
-#endif
     void ReplyNewProcess (struct message_def * reply_msg, CProcess * process,
                           int result);
+#endif
     void SendProcessCreatedNotice(CProcess *parent, int result);
     struct timespec GetCreationTime () { return CreationTime; }
     void SetCreationTime(int os_pid);
@@ -383,13 +388,19 @@ class CProcess
     inline int  decrReplRef() { --replRefCount_; return replRefCount_; }
     inline int replRefCount() { return replRefCount_; }
 
+#ifndef NAMESERVER_PROCESS
     void parentContext (struct message_def * msg) { requestBuf_ = msg; }
     struct message_def * parentContext ( void ) { return requestBuf_; }
+#else
+    void SetMonContext (struct message_def * msg) { requestBuf_ = msg; }
+    struct message_def * GetMonContext ( void ) { return requestBuf_; }
+#endif
 
     void SetHangupTime () { clock_gettime(CLOCK_REALTIME, &hangupTime_); }
     time_t GetHangupTime () { return hangupTime_.tv_sec; }
 
     void childAdd ( int nid, int pid );
+    int childCount ( void );
     void childRemove ( int nid, int pid );
     bool childRemoveFirst ( nidPid_t & child );
 
@@ -545,6 +556,7 @@ private:
     CNotice       *NoticeTail;
 #endif
 #ifdef NAMESERVER_PROCESS
+    int            monSockFd_;
     int            origPNidNs_;
 #endif
 };

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/ptpclient.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/ptpclient.cxx b/core/sqf/monitor/linux/ptpclient.cxx
index 1d75cc6..5e1380e 100644
--- a/core/sqf/monitor/linux/ptpclient.cxx
+++ b/core/sqf/monitor/linux/ptpclient.cxx
@@ -45,31 +45,40 @@ using namespace std;
 #include "lnode.h"
 #include "pnode.h"
 #include "ptpclient.h"
+#include "monitor.h"
 #include "monlogging.h"
 #include "montrace.h"
 #include "meas.h"
 
+extern CMonitor *Monitor;
 extern CNode *MyNode;
+extern CNodeContainer *Nodes;
 extern bool IsRealCluster;
 extern CMeas Meas;
 
 CPtpClient::CPtpClient (void)
-: mon2monSock_(0)
-, seqNum_(0)
+          : mon2monSock_(0)
+          , seqNum_(0)
 {
     const char method_name[] = "CPtpClient::CPtpClient";
     TRACE_ENTRY;
     
-    // revisit - probably can use the one we already read in
-    char * p = getenv( "MONITOR_COMM_PORT" );
+    char * p = getenv( "MON2MON_COMM_PORT" );
     if ( p ) 
     {
         basePort_ = atoi( p );
     }
     else
     {
-        basePort_ = 23399; // constant somewhere
+        char buf[MON_STRING_BUF_SIZE];
+        snprintf( buf, sizeof(buf)
+                , "[%s@%d] MON2MON_COMM_PORT environment variable is not set!\n"
+                , method_name, __LINE__ );
+        mon_log_write( PTPCLIENT_PTPCLIENT_1, SQ_LOG_CRIT, buf );
+        abort();
     }
+
+    TRACE_EXIT;
 }
 
 CPtpClient::~CPtpClient (void)
@@ -80,166 +89,18 @@ CPtpClient::~CPtpClient (void)
     TRACE_EXIT;
 }
 
-int CPtpClient::MkCltSock( const char *portName )
-{
-    const char method_name[] = "CPtpClient::MkCltSock";
-    TRACE_ENTRY;
-
-    int    sock;        // socket
-    int    ret;         // returned value
-    int    reuse = 1;   // sockopt reuse option
-    socklen_t  size;    // size of socket address
-    static int retries = 0;      // # times to retry connect
-    int    outer_failures = 0;   // # failed connect loops
-    int    connect_failures = 0; // # failed connects
-    char   *p;     // getenv results 
-    struct sockaddr_in  sockinfo;    // socket address info 
-    struct hostent *he;
-    char   host[1000];
-    const char *colon;
-    unsigned int port;
-    
-    colon = strstr(portName, ":");
-    strcpy(host, portName);
-    int len = colon - portName;
-    host[len] = '\0';
-    port = atoi(&colon[1]);
-    
-    size = sizeof(sockinfo);
-
-    if ( !retries )
-    {
-        p = getenv( "HPMP_CONNECT_RETRIES" );
-        if ( p ) retries = atoi( p );
-        else retries = 5;
-    }
-
-    for ( ;; )
-    {
-        sock = socket( AF_INET, SOCK_STREAM, 0 );
-        if ( sock < 0 )
-        {
-            char la_buf[MON_STRING_BUF_SIZE];
-            int err = errno;
-            snprintf( la_buf, sizeof(la_buf) 
-                    , "[%s], socket() failed! errno=%d (%s)\n"
-                    , method_name, err, strerror( err ));
-            mon_log_write(MON_CLUSTER_MKCLTSOCK_1, SQ_LOG_ERR, la_buf); 
-            return ( -1 );
-        }
-
-        he = gethostbyname( host );
-        if ( !he )
-        {
-            char la_buf[MON_STRING_BUF_SIZE];
-            int err = h_errno;
-            snprintf( la_buf, sizeof(la_buf), 
-                      "[%s] gethostbyname(%s) failed! errno=%d (%s)\n"
-                    , method_name, host, err, strerror( err ));
-            mon_log_write(MON_CLUSTER_MKCLTSOCK_2, SQ_LOG_ERR, la_buf); 
-            close( sock );
-            return ( -1 );
-        }
-
-        // Connect socket.
-        memset( (char *) &sockinfo, 0, size );
-        memcpy( (char *) &sockinfo.sin_addr, (char *) he->h_addr, 4 );
-        sockinfo.sin_family = AF_INET;
-        sockinfo.sin_port = htons( (unsigned short) port );
-
-        // Note the outer loop uses "retries" from HPMP_CONNECT_RETRIES,
-        // and has a yield between each retry, since it's more oriented
-        // toward failures from network overload and putting a pause
-        // between retries.  This inner loop should only iterate when
-        // a signal interrupts the local process, so it doesn't pause
-        // or use the same HPMP_CONNECT_RETRIES count.
-        connect_failures = 0;
-        ret = 1;
-        while ( ret != 0 && connect_failures <= 10 )
-        {
-            if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
-            {
-                trace_printf( "%s@%d - Connecting to %s addr=%d.%d.%d.%d, port=%d, connect_failures=%d\n"
-                            , method_name, __LINE__
-                            , host
-                            , (int)((unsigned char *)he->h_addr)[0]
-                            , (int)((unsigned char *)he->h_addr)[1]
-                            , (int)((unsigned char *)he->h_addr)[2]
-                            , (int)((unsigned char *)he->h_addr)[3]
-                            , port
-                            , connect_failures );
-            }
-    
-            ret = connect( sock, (struct sockaddr *) &sockinfo, size );
-            if ( ret == 0 ) break;
-            if ( errno == EINTR )
-            {
-                ++connect_failures;
-            }
-            else
-            {
-                char la_buf[MON_STRING_BUF_SIZE];
-                int err = errno;
-                sprintf( la_buf, "[%s], connect() failed! errno=%d (%s)\n"
-                       , method_name, err, strerror( err ));
-                mon_log_write(MON_CLUSTER_MKCLTSOCK_3, SQ_LOG_ERR, la_buf); 
-                close(sock);
-                return ( -1 );
-            }
-        }
-
-        if ( ret == 0 ) break;
-
-        // For large clusters, the connect/accept calls seem to fail occasionally,
-        // no doubt do to the large number (1000's) of simultaneous connect packets
-        // flooding the network at once.  So, we retry up to HPMP_CONNECT_RETRIES
-        // number of times.
-        if ( errno != EINTR )
-        {
-            if ( ++outer_failures > retries )
-            {
-                char la_buf[MON_STRING_BUF_SIZE];
-                sprintf( la_buf, "[%s], connect() exceeded retries! count=%d\n"
-                       , method_name, retries);
-                mon_log_write(MON_CLUSTER_MKCLTSOCK_4, SQ_LOG_ERR, la_buf); 
-                close( sock );
-                return ( -1 );
-            }
-            struct timespec req, rem;
-            req.tv_sec = 0;
-            req.tv_nsec = 500000;
-            nanosleep( &req, &rem );
-        }
-        close( sock );
-    }
-
-    if ( setsockopt( sock, SOL_SOCKET, SO_REUSEADDR, (char *) &reuse, sizeof(int) ) )
-    {
-        char la_buf[MON_STRING_BUF_SIZE];
-        int err = errno;
-        sprintf( la_buf, "[%s], setsockopt() failed! errno=%d (%s)\n"
-               , method_name, err, strerror( err ));
-        mon_log_write(MON_CLUSTER_MKCLTSOCK_5, SQ_LOG_ERR, la_buf); 
-        close( (int)sock );
-        return ( -2 );
-    }
-
-    TRACE_EXIT;
-    return ( sock );
-}
-
 int CPtpClient::InitializePtpClient( char * mon2monPort )
 {
     const char method_name[] = "CPtpClient::InitializePtpClient";
     TRACE_ENTRY;
     int err = 0;
       
-    int sock = MkCltSock(mon2monPort);                
+    int sock = Monitor->MkCltSock( mon2monPort );                
     if (sock < 0)
     {
         err = sock;
         
-        if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+        if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
         {
             trace_printf( "%s@%d - MkCltSock failed with error %d\n"
                         , method_name, __LINE__, err );
@@ -248,15 +109,15 @@ int CPtpClient::InitializePtpClient( char * mon2monPort )
     else
     {
         mon2monSock_ = sock;
-        if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+        if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
         {
-            trace_printf( "%s@%d - connected to nameserver=%s, sock=%d\n"
+            trace_printf( "%s@%d - connected to monitor node=%s, sock=%d\n"
                         , method_name, __LINE__
                         , mon2monPort
                         , mon2monSock_ );
         }
     }
-    
+#if 0    
     // remove
     if (err == 0)
     {
@@ -290,16 +151,347 @@ int CPtpClient::InitializePtpClient( char * mon2monPort )
             }
         }
     }
-
+#endif
     TRACE_EXIT;
     return err;
 }
 
-int CPtpClient::NewProcess(CProcess* process, int receiveNode, const char *hostName)
+int CPtpClient::ProcessClone( CProcess *process )
+{
+    const char method_name[] = "CPtpClient::ProcessClone";
+    TRACE_ENTRY;
+
+    CLNode *parentLNode = NULL;
+    if (process->GetParentNid() != -1)
+    {
+        parentLNode = Nodes->GetLNode( process->GetParentNid() );
+    }
+
+    if (parentLNode == NULL)
+    {
+        if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+        {
+            trace_printf( "%s@%d - Not Sending InternalType_Clone request to parentNid=%d\n"
+                          ", process=%s (%d:%d:%d)\n"
+                        , method_name, __LINE__
+                        , process->GetParentNid()
+                        , process->GetName()
+                        , process->GetNid()
+                        , process->GetPid()
+                        , process->GetVerifier() );
+        }
+        return(0);
+    }
+
+    if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+    {
+        trace_printf( "%s@%d - Sending InternalType_Clone request to %s, parentNid=%d\n"
+                      ", process=%s (%d:%d:%d)\n"
+                    , method_name, __LINE__
+                    , parentLNode->GetNode()->GetName()
+                    , process->GetParentNid()
+                    , process->GetName()
+                    , process->GetNid()
+                    , process->GetPid()
+                    , process->GetVerifier() );
+    }
+
+    struct internal_msg_def msg;
+    memset(&msg, 0, sizeof(msg)); 
+    msg.type = InternalType_Clone;
+    msg.u.clone.backup = process->IsBackup();
+    msg.u.clone.unhooked = process->IsUnhooked();
+    msg.u.clone.event_messages = process->IsEventMessages();
+    msg.u.clone.system_messages = process->IsSystemMessages();
+    msg.u.clone.nid = process->GetNid();
+    msg.u.clone.verifier = process->GetVerifier();
+    msg.u.clone.type = process->GetType();
+    msg.u.clone.priority = process->GetPriority();
+    msg.u.clone.parent_nid = process->GetParentNid();
+    msg.u.clone.parent_pid = process->GetParentPid();
+    msg.u.clone.parent_verifier = process->GetParentVerifier();
+    msg.u.clone.os_pid = process->GetPid();
+    msg.u.clone.persistent = process->IsPersistent();
+    msg.u.clone.persistent_retries = process->GetPersistentRetries();
+    msg.u.clone.origPNidNs= -1;
+    msg.u.clone.argc = process->argc();
+    msg.u.clone.creation_time = process->GetCreationTime();
+    msg.u.clone.pathStrId = process->pathStrId();
+    msg.u.clone.ldpathStrId = process->ldPathStrId();
+    msg.u.clone.programStrId = process->programStrId();
+
+    msg.u.clone.prior_pid = process->GetPriorPid ();
+    process->SetPriorPid ( 0 );
+    msg.u.clone.creation_time = process->GetCreationTime();
+
+    char *stringData = & msg.u.clone.stringData;
+    int  nameLen = strlen(process->GetName()) + 1;
+    int  portLen = strlen(process->GetPort()) + 1;
+    int  infileLen = strlen(process->infile()) + 1;
+    int  outfileLen = strlen(process->outfile()) + 1;
+    int  argvLen = process->userArgvLen();
+
+    // Copy the process name
+    msg.u.clone.nameLen = nameLen;
+    memcpy( stringData, process->GetName(), nameLen );
+    stringData += nameLen;
+
+    // Copy the port
+    msg.u.clone.portLen = portLen;
+    memcpy(stringData, process->GetPort(),  portLen );
+    stringData += portLen;
+
+    // Copy the standard in file name
+    msg.u.clone.infileLen = infileLen;
+    memcpy( stringData, process->infile(), infileLen );
+    stringData += infileLen ;
+
+    // Copy the standard out file name
+    msg.u.clone.outfileLen = outfileLen;
+    memcpy( stringData, process->outfile(), outfileLen  );
+    stringData += outfileLen ;
+
+    // Copy the program argument strings
+    msg.u.clone.argvLen =  argvLen;
+    memcpy( stringData, process->userArgv(), argvLen );
+
+    int size = offsetof(struct internal_msg_def, u);
+    size += sizeof(msg.u.clone);
+    size += nameLen ;
+    size += portLen ;
+    size += infileLen ;
+    size += outfileLen ;
+    size += argvLen ;
+    
+    if (trace_settings & TRACE_PROCESS_DETAIL)
+    {
+        trace_printf( "%s@%d - size_=%d, programStrId=(%d,%d), "
+                      "pathStrId=(%d,%d), ldPathStrId=(%d,%d), "
+                      "name=%s, strlen(name)=%d, "
+                      "port=%s, strlen(port)=%d, "
+                      "infile=%s, strlen(infile)=%d, "
+                      "outfile=%s, strlen(outfile)=%d, "
+                      "argc=%d, strlen(total argv)=%d, args=[%.*s]\n"
+                    , method_name, __LINE__
+                    , size
+                    , msg.u.clone.programStrId.nid
+                    , msg.u.clone.programStrId.id
+                    , msg.u.clone.pathStrId.nid
+                    , msg.u.clone.pathStrId.id
+                    , msg.u.clone.ldpathStrId.nid
+                    , msg.u.clone.ldpathStrId.id
+                    , &msg.u.clone.stringData
+                    , nameLen
+                    , &msg.u.clone.stringData+nameLen
+                    , portLen
+                    , &msg.u.clone.stringData+nameLen
+                    , infileLen
+                    , &msg.u.clone.stringData+nameLen+infileLen
+                    , outfileLen 
+                    , msg.u.clone.argc
+                    , argvLen
+                    , argvLen
+                    , &msg.u.clone.stringData+nameLen+infileLen+outfileLen);
+    }
+
+    int error = SendToMon( "process-clone"
+                         , &msg
+                         , size
+                         , process->GetParentNid()
+                         , parentLNode->GetNode()->GetName());
+    
+    TRACE_EXIT;
+    return error;
+}
+
+int CPtpClient::ProcessExit( CProcess *process
+                           , int targetNid
+                           , const char *targetNodeName )
 {
-    const char method_name[] = "CPtpClient::NewProcess";
+    const char method_name[] = "CPtpClient::ProcessExit";
     TRACE_ENTRY;
- //   printf("\nTRK NewProcess, receiveNode %d, hostname %s\n", receiveNode, hostName);
+
+    if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+    {
+        trace_printf( "%s@%d - Sending InternalType_Exit request to %s, targetNid=%d"
+                      ", process=%s (%d,%d:%d) is exiting\n"
+                    , method_name, __LINE__
+                    , targetNodeName
+                    , targetNid
+                    , process->GetName()
+                    , process->GetNid()
+                    , process->GetPid()
+                    , process->GetVerifier() );
+    }
+
+    struct internal_msg_def msg;
+    memset(&msg, 0, sizeof(msg)); 
+    msg.type = InternalType_Exit;
+    msg.u.exit.nid = process->GetNid();
+    msg.u.exit.pid = process->GetPid();
+    msg.u.exit.verifier = process->GetVerifier();
+    strcpy(msg.u.exit.name, process->GetName());
+    msg.u.exit.abended = process->IsAbended();
+
+    int size = offsetof(struct internal_msg_def, u);
+    size += sizeof(msg.u.exit);
+    
+    if (trace_settings & TRACE_PROCESS_DETAIL)
+    {
+        trace_printf( "%s@%d - size_=%d, process %s (%d,%d:%d) "
+                      "abended=%d\n"
+                    , method_name, __LINE__
+                    , size
+                    , msg.u.exit.name
+                    , msg.u.exit.nid
+                    , msg.u.exit.pid
+                    , msg.u.exit.verifier
+                    , msg.u.exit.abended );
+    }
+
+    int error = SendToMon("process-exit", &msg, size, targetNid, targetNodeName);
+    
+    TRACE_EXIT;
+    return error;
+}
+
+int CPtpClient::ProcessInit( CProcess *process
+                           , void *tag
+                           , int result
+                           , int parentNid )
+{
+    const char method_name[] = "CPtpClient::ProcessInit";
+    TRACE_ENTRY;  
+    
+    CLNode *parentLNode = NULL;
+    if (process->GetParentNid() != -1)
+    {
+        parentLNode = Nodes->GetLNode( process->GetParentNid() );
+    }
+
+    if (parentLNode == NULL)
+    {
+        if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+        {
+            trace_printf( "%s@%d - Not Sending InternalType_Clone request to parentNid=%d\n"
+                          ", process=%s (%d,%d:%d)\n"
+                        , method_name, __LINE__
+                        , process->GetParentNid()
+                        , process->GetName()
+                        , process->GetNid()
+                        , process->GetPid()
+                        , process->GetVerifier() );
+        }
+        return(0);
+    }
+
+    if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+    {
+        trace_printf( "%s@%d" " - Sending InternalType_ProcessInit to parent node %s, parentNid=%d\n"
+                    ", for process %s (%d,%d:%d)\n"
+                    , method_name, __LINE__
+                    , parentLNode->GetNode()->GetName()
+                    , parentNid
+                    , process->GetName()
+                    , process->GetNid()
+                    , process->GetPid()
+                    , process->GetVerifier() );
+    }
+
+    struct internal_msg_def msg;
+    memset(&msg, 0, sizeof(msg)); 
+    msg.type = InternalType_ProcessInit;
+    msg.u.processInit.nid = process->GetNid();
+    msg.u.processInit.pid = process->GetPid();
+    msg.u.processInit.verifier = process->GetVerifier();
+    strcpy (msg.u.processInit.name, process->GetName());
+    msg.u.processInit.state = process->GetState();
+    msg.u.processInit.result = result;
+    msg.u.processInit.tag = tag;
+    msg.u.processInit.origNid = process->GetParentNid();
+    
+    int size = offsetof(struct internal_msg_def, u);
+    size += sizeof(msg.u.processInit);
+    
+    int error = SendToMon( "process-init"
+                         , &msg
+                         , size
+                         , parentNid
+                         , parentLNode->GetNode()->GetName() );
+    
+    TRACE_EXIT;
+    return error;
+    
+}
+
+int CPtpClient::ProcessKill( CProcess *process
+                           , bool abort
+                           , int targetNid
+                           , const char *targetNodeName )
+{
+    const char method_name[] = "CPtpClient::ProcessKill";
+    TRACE_ENTRY;
+
+    if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+    {
+        trace_printf( "%s@%d - Sending InternalType_Kill request to %s, targetNid=%d"
+                      ", killing process (%d,%d:%d)\n"
+                    , method_name, __LINE__
+                    , targetNodeName
+                    , targetNid
+                    , process->GetNid()
+                    , process->GetPid()
+                    , process->GetVerifier() );
+    }
+
+    struct internal_msg_def msg;
+    memset(&msg, 0, sizeof(msg)); 
+    msg.type = InternalType_Kill;
+    msg.u.kill.nid = process->GetNid();
+    msg.u.kill.pid = process->GetPid();
+    msg.u.kill.verifier = process->GetVerifier();
+    msg.u.kill.persistent_abort = abort;
+
+    int size = offsetof(struct internal_msg_def, u);
+    size += sizeof(msg.u.exit);
+    
+    if (trace_settings & TRACE_PROCESS_DETAIL)
+    {
+        trace_printf( "%s@%d - size_=%d, process (%d,%d:%d) "
+                      "persistent_abort=%d\n"
+                    , method_name, __LINE__
+                    , size
+                    , msg.u.kill.nid
+                    , msg.u.kill.pid
+                    , msg.u.kill.verifier
+                    , msg.u.kill.persistent_abort );
+    }
+
+    int error = SendToMon("process-kill", &msg, size, targetNid, targetNodeName);
+    
+    TRACE_EXIT;
+    return error;
+}
+
+int CPtpClient::ProcessNew( CProcess *process
+                          , int targetNid
+                          , const char *targetNodeName )
+{
+    const char method_name[] = "CPtpClient::ProcessNew";
+    TRACE_ENTRY;
+
+    if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+    {
+        trace_printf( "%s@%d - Sending InternalType_Process request to %s, targetNid=%d"
+                      ", program=%s, parent=(%d,%d:%d)\n"
+                    , method_name, __LINE__
+                    , targetNodeName
+                    , targetNid
+                    , process->program()
+                    , process->GetParentNid()
+                    , process->GetParentPid()
+                    , process->GetParentVerifier() );
+    }
 
     struct internal_msg_def msg;
     memset(&msg, 0, sizeof(msg)); 
@@ -322,42 +514,155 @@ int CPtpClient::NewProcess(CProcess* process, int receiveNode, const char *hostN
     msg.u.process.programStrId = process->programStrId();
     msg.u.process.argc = process->argc();
 
+    char *stringData = & msg.u.process.stringData;
+    int  nameLen = strlen(process->GetName()) + 1;
+    int  infileLen = strlen(process->infile()) + 1;
+    int  outfileLen = strlen(process->outfile()) + 1;
+    int  argvLen = process->userArgvLen();
+
+    // Copy the process name
+    msg.u.process.nameLen = nameLen;
+    memcpy( stringData, process->GetName(), nameLen );
+    stringData += nameLen;
+
+    // Copy the standard in file name
+    msg.u.process.infileLen = infileLen;
+    memcpy( stringData, process->infile(), infileLen );
+    stringData += infileLen;
+
+    // Copy the standard out file name
+    msg.u.process.outfileLen = outfileLen;
+    memcpy( stringData, process->outfile(), outfileLen  );
+    stringData += outfileLen;
+
+    // Copy the program argument strings
+    msg.u.process.argvLen =  argvLen;
+    memcpy( stringData, process->userArgv(), argvLen );
+
     int size = offsetof(struct internal_msg_def, u);
     size += sizeof(msg.u.process);
+    size += nameLen ;
+    size += infileLen ;
+    size += outfileLen ;
+    size += argvLen ;
     
-    int error = SendToMon("new-process", &msg, size, receiveNode, hostName);
+    if (trace_settings & TRACE_PROCESS_DETAIL)
+    {
+        trace_printf( "%s@%d - size_=%d, programStrId=(%d,%d), "
+                      "pathStrId=(%d,%d), ldPathStrId=(%d,%d), "
+                      "name=%s, strlen(name)=%d, "
+                      "infile=%s, strlen(infile)=%d, "
+                      "outfile=%s, strlen(outfile)=%d, "
+                      "argc=%d, strlen(total argv)=%d, args=[%.*s]\n"
+                    , method_name, __LINE__
+                    , size
+                    , msg.u.process.programStrId.nid
+                    , msg.u.process.programStrId.id
+                    , msg.u.process.pathStrId.nid
+                    , msg.u.process.pathStrId.id
+                    , msg.u.process.ldpathStrId.nid
+                    , msg.u.process.ldpathStrId.id
+                    , &msg.u.process.stringData
+                    , nameLen
+                    , &msg.u.process.stringData+nameLen
+                    , infileLen
+                    , &msg.u.process.stringData+nameLen+infileLen
+                    , outfileLen 
+                    , msg.u.process.argc
+                    , argvLen
+                    , argvLen
+                    , &msg.u.process.stringData+nameLen+infileLen+outfileLen);
+    }
+
+    int error = SendToMon("process-new", &msg, size, targetNid, targetNodeName);
     
     TRACE_EXIT;
     return error;
 }
 
-int CPtpClient::ProcessInit(CProcess *process, void *tag, int result, int receiveNode, const char *hostName)
+int CPtpClient::ProcessNotify( int nid
+                             , int pid
+                             , Verifier_t verifier
+                             , _TM_Txid_External transId
+                             , bool canceled
+                             , CProcess *targetProcess
+                             , int targetNid
+                             , const char *targetNodeName )
 {
-    const char method_name[] = "CPtpClient::ProcessInit";
-    TRACE_ENTRY;  
-    
- //   printf("\nTRK ProcessInit, receiveNOde %d, hostname %s\n", receiveNode, hostName);
+    const char method_name[] = "CPtpClient::ProcessNotify";
+    TRACE_ENTRY;
+
+    if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+    {
+        trace_printf( "%s@%d - Sending InternalType_Notify request to %s"
+                      ", nid=%d, canceled=%d\n"
+                    , method_name, __LINE__
+                    , targetNodeName
+                    , targetNid
+                    , canceled );
+    }
+
     struct internal_msg_def msg;
     memset(&msg, 0, sizeof(msg)); 
-    msg.type = InternalType_ProcessInit;
-    msg.u.processInit.nid = process->GetNid();
-    msg.u.processInit.pid = process->GetPid();
-    msg.u.processInit.verifier = process->GetVerifier();
-    strcpy (msg.u.processInit.name, process->GetName());
-    msg.u.processInit.state = process->GetState();
-    msg.u.processInit.result = result;
-    msg.u.processInit.tag = tag;
-    msg.u.processInit.origNid = receiveNode;
-    
+    msg.type = InternalType_Notify;
+    msg.u.notify.nid = nid;
+    msg.u.notify.pid = pid;
+    msg.u.notify.verifier = verifier;
+    msg.u.notify.canceled = canceled;
+    msg.u.notify.target_nid = targetProcess->GetNid();
+    msg.u.notify.target_pid = targetProcess->GetPid();
+    msg.u.notify.target_verifier = targetProcess->GetVerifier();
+    msg.u.notify.trans_id = transId;
+
+    if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+    {
+        if (canceled)
+        {
+            trace_printf( "%s@%d - Process (%d, %d:%d) deleting death "
+                          "notice interest for %s (%d, %d:%d), "
+                          "trans_id=%lld.%lld.%lld.%lld\n"
+                        , method_name, __LINE__
+                        , msg.u.notify.nid
+                        , msg.u.notify.pid
+                        , msg.u.notify.verifier
+                        , targetProcess->GetName()
+                        , msg.u.notify.target_nid
+                        , msg.u.notify.target_pid
+                        , msg.u.notify.target_verifier
+                        , msg.u.notify.trans_id.txid[0]
+                        , msg.u.notify.trans_id.txid[1]
+                        , msg.u.notify.trans_id.txid[2]
+                        , msg.u.notify.trans_id.txid[3] );
+        }
+        else
+        {
+            trace_printf("%s@%d - Process (%d, %d:%d) registering interest "
+                         "in death of process %s (%d, %d:%d), "
+                         "trans_id=%lld.%lld.%lld.%lld\n"
+                        , method_name, __LINE__
+                        , msg.u.notify.nid
+                        , msg.u.notify.pid
+                        , msg.u.notify.verifier
+                        , targetProcess->GetName()
+                        , msg.u.notify.target_nid
+                        , msg.u.notify.target_pid
+                        , msg.u.notify.target_verifier
+                        , msg.u.notify.trans_id.txid[0]
+                        , msg.u.notify.trans_id.txid[1]
+                        , msg.u.notify.trans_id.txid[2]
+                        , msg.u.notify.trans_id.txid[3] );
+        }
+    }
+
     int size = offsetof(struct internal_msg_def, u);
-    size += sizeof(msg.u.processInit);
-    
-    int error = SendToMon("process-init", &msg, size, receiveNode, hostName);
+    size += sizeof(msg.u.notify);
+
+    int error = SendToMon("process-notify", &msg, size, targetNid, targetNodeName);
     
     TRACE_EXIT;
     return error;
-    
 }
+
 int CPtpClient::ReceiveSock(char *buf, int size, int sockFd)
 {
     const char method_name[] = "CPtpClient::ReceiveSock";
@@ -376,7 +681,7 @@ int CPtpClient::ReceiveSock(char *buf, int size, int sockFd)
                               , sizeCount
                               , 0 );
         if ( readCount > 0 ) Meas.addSockPtpRcvdBytes( readCount );
-    
+
         if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
         {
             trace_printf( "%s@%d - Count read %d = recv(%d)\n"
@@ -448,7 +753,7 @@ int CPtpClient::SendSock(char *buf, int size, int sockFd)
                               , size
                               , 0 );
         if ( sendCount > 0 ) Meas.addSockPtpSentBytes( sendCount );
-    
+
         if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
         {
             trace_printf( "%s@%d - send(), sendCount=%d\n"
@@ -511,18 +816,35 @@ int CPtpClient::SendToMon(const char *reqType, internal_msg_def *msg, int size,
         tempPort += receiveNode;
     }
     
-    memset(&mon2monPort, 0, MAX_PROCESSOR_NAME);
-    memset(&mon2monPortBase_, 0, MAX_PROCESSOR_NAME+100);
+    if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+    {
+        trace_printf( "%s@%d - reqType=%s, hostName=%s, receiveNode=%d, "
+                      "tempPort=%d, basePort_=%d\n"
+                    , method_name, __LINE__
+                    , reqType
+                    , hostName
+                    , receiveNode
+                    , tempPort 
+                    , basePort_ );
+    }
 
-    strcat (mon2monPortBase_, hostName);
-    strcat(mon2monPortBase_, ":");
-    sprintf(monPortString,"%d", tempPort);
-    strcat (mon2monPort, mon2monPortBase_);
-    strcat (mon2monPort, monPortString); 
+    memset( &mon2monPort, 0, MAX_PROCESSOR_NAME );
+    memset( &mon2monPortBase_, 0, MAX_PROCESSOR_NAME+100 );
 
-    InitializePtpClient(mon2monPort);
-    
-    if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+    strcat( mon2monPortBase_, hostName );
+    strcat( mon2monPortBase_, ":" );
+    sprintf( monPortString,"%d", tempPort );
+    strcat( mon2monPort, mon2monPortBase_ );
+    strcat( mon2monPort, monPortString ); 
+
+    int error = InitializePtpClient( mon2monPort );
+    if (error < 0)
+    {
+        TRACE_EXIT;
+        return error;
+    }
+
+    if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
     {
         trace_printf( "%s@%d - sending %s REQ to Monitor=%s, sock=%d\n"
                     , method_name, __LINE__
@@ -531,10 +853,10 @@ int CPtpClient::SendToMon(const char *reqType, internal_msg_def *msg, int size,
                     , mon2monSock_);
     }
 
-    int error = SendSock((char *) &size, sizeof(size), mon2monSock_);
+    error = SendSock((char *) &size, sizeof(size), mon2monSock_);
     if (error)
     {
-        if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+        if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
         {
             trace_printf( "%s@%d - error sending to Monitor=%s, sock=%d, error=%d\n"
                         , method_name, __LINE__
@@ -547,7 +869,7 @@ int CPtpClient::SendToMon(const char *reqType, internal_msg_def *msg, int size,
     error = SendSock((char *) msg, size, mon2monSock_);
     if (error)
     {
-        if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+        if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
         {
             trace_printf( "%s@%d - error sending to nameserver=%s, sock=%d, error=%d\n"
                         , method_name, __LINE__
@@ -558,6 +880,7 @@ int CPtpClient::SendToMon(const char *reqType, internal_msg_def *msg, int size,
     }
     
     close( mon2monSock_ );
+
     TRACE_EXIT;
     return error;
 }

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/ptpclient.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/ptpclient.h b/core/sqf/monitor/linux/ptpclient.h
index 73dafd1..7dd8b86 100644
--- a/core/sqf/monitor/linux/ptpclient.h
+++ b/core/sqf/monitor/linux/ptpclient.h
@@ -23,8 +23,8 @@
 //
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifndef PTPSERVER_H_
-#define PTPSERVER_H_
+#ifndef PTPCLIENT_H_
+#define PTPCLIENT_H_
 #ifndef NAMESERVER_PROCESS
 
 #include "process.h"
@@ -41,26 +41,40 @@ public:
     virtual ~CPtpClient( void );
 
     int  InitializePtpClient( char * mon2monPort );
-    int  NewProcess(CProcess* proces, int receiveNode, const char *hostName);
-    int  ProcessInit(CProcess *process, void *tag, int result, int receiveNode, const char *hostName);
-/* //TRK-TODO 
- Need methods for these message types:
-            InternalType_Clone
-            InternalType_Open
-            InternalType_Notify
-            InternalType_Exit
-*/
+    int  ProcessClone( CProcess *process );
+    int  ProcessExit( CProcess* process
+                    , int parentNid
+                    , const char *targetNodeName );
+    int  ProcessInit( CProcess *process
+                    , void *tag
+                    , int result
+                    , int parentNid );
+    int  ProcessKill( CProcess* process
+                    , bool abort
+                    , int targetNid
+                    , const char *targetNodeName );
+    int  ProcessNew( CProcess* process
+                   , int targetNid
+                   , const char *targetNodeName );
+    int  ProcessNotify( int nid
+                      , int pid
+                      , Verifier_t verifier
+                      , _TM_Txid_External transId
+                      , bool canceled
+                      , CProcess *targetProcess
+                      , int targetNid
+                      , const char *targetNodeName );
+
 private:
     int  basePort_;
     char mon2monPortBase_[MAX_PROCESSOR_NAME+100];
     int  mon2monSock_;
     int  seqNum_;
 
-    int  MkCltSock( const char *portName );
     int  ReceiveSock(char *buf, int size, int sockFd);
     int  SendSock(char *buf, int size, int sockFd);
     int  SendToMon(const char *reqType, internal_msg_def *msg, int size, int receiveNode, const char *hostName);
 };
 
 #endif
-#endif /*PTPSERVER_H_*/
+#endif /*PTPCLIENT_H_*/

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/ptpcommaccept.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/ptpcommaccept.cxx b/core/sqf/monitor/linux/ptpcommaccept.cxx
index 8829f28..b070508 100644
--- a/core/sqf/monitor/linux/ptpcommaccept.cxx
+++ b/core/sqf/monitor/linux/ptpcommaccept.cxx
@@ -64,159 +64,21 @@ CPtpCommAccept::~CPtpCommAccept()
     TRACE_EXIT;
 }
 
-// REMOVE
-bool CPtpCommAccept::sendNodeInfoSock( int sockFd )
-{
-    const char method_name[] = "CPtpCommAccept::sendNodeInfoSock";
-    TRACE_ENTRY;
-    bool sentData = true;
-    
-    int pnodeCount = Nodes->GetPNodesCount();
-
-    nodeId_t *nodeInfo;
-    size_t nodeInfoSize = (sizeof(nodeId_t) * pnodeCount);
-    nodeInfo = (nodeId_t *) new char[nodeInfoSize];
-    int rc;
-
-    CNode *node;
-
-    for (int i=0; i<pnodeCount; ++i)
-    {
-        node = Nodes->GetNodeByMap( i );
-        if ( node->GetState() == State_Up)
-        {
-            strncpy(nodeInfo[i].nodeName, node->GetName(),
-                    sizeof(nodeInfo[i].nodeName));
-            strncpy(nodeInfo[i].commPort, node->GetCommPort(),
-                    sizeof(nodeInfo[i].commPort));
-            strncpy(nodeInfo[i].syncPort, node->GetSyncPort(),
-                    sizeof(nodeInfo[i].syncPort));
-            nodeInfo[i].pnid = node->GetPNid();
-            nodeInfo[i].creatorPNid = (nodeInfo[i].pnid == MyPNID) ? MyPNID : -1;
-
-            if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
-            {
-                trace_printf( "%s@%d - Node info for pnid=%d (%s)\n"
-                              "        CommPort=%s\n"
-                              "        SyncPort=%s\n"
-                              "        creatorPNid=%d\n"
-                            , method_name, __LINE__
-                            , nodeInfo[i].pnid
-                            , nodeInfo[i].nodeName
-                            , nodeInfo[i].commPort
-                            , nodeInfo[i].syncPort
-                            , nodeInfo[i].creatorPNid );
-            }
-        }
-        else
-        {
-            if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
-            {
-                trace_printf( "%s@%d - No nodeInfo[%d] for pnid=%d (%s) node not up!\n"
-                            , method_name, __LINE__
-                            , i, node->GetPNid(), node->GetName());
-            }
-
-            nodeInfo[i].pnid = -1;
-            nodeInfo[i].nodeName[0] = '\0';
-            nodeInfo[i].commPort[0] = '\0';
-            nodeInfo[i].syncPort[0] = '\0';
-            nodeInfo[i].creatorPNid = -1;
-        }
-    }
-
-    if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
-    {
-        trace_printf( "%s@%d - Sending port info to new monitor\n"
-                    , method_name, __LINE__);
-        for (int i=0; i<pnodeCount; i++)
-        {
-            trace_printf( "Port info for pnid=%d\n"
-                          "        nodeInfo[%d].nodeName=%s\n"
-                          "        nodeInfo[%d].commPort=%s\n"
-                          "        nodeInfo[%d].syncPort=%s\n"
-                          "        nodeInfo[%d].creatorPNid=%d\n"
-                        , nodeInfo[i].pnid
-                        , i, nodeInfo[i].nodeName
-                        , i, nodeInfo[i].commPort
-                        , i, nodeInfo[i].syncPort
-                        , i, nodeInfo[i].creatorPNid );
-        }
-    }
-
-    rc = Monitor->SendSock( (char *) nodeInfo
-                          , nodeInfoSize
-                          , sockFd
-                          , method_name );
-    if ( rc )
-    {
-        char buf[MON_STRING_BUF_SIZE];
-        snprintf(buf, sizeof(buf), "[%s], cannot send node/port info to "
-                 " new monitor process: %s.\n"
-                 , method_name, ErrorMsg(rc));
-        mon_log_write(MON_COMMACCEPT_2, SQ_LOG_ERR, buf); 
-
-        sentData = false;
-    }
-
-    delete [] nodeInfo;
-
-    TRACE_EXIT;
-    return sentData;
-}
-
-void CPtpCommAccept::processNewSock( int joinFd )
+void CPtpCommAccept::processNewSock( int sockFd )
 {
     const char method_name[] = "CPtpCommAccept::processNewSock";
     TRACE_ENTRY;
     
     struct internal_msg_def msg;
-    nodeId_t nodeId;          
     int rc;
     
-    // Get info about connecting monitor
-    rc = Monitor->ReceiveSock( (char *) &nodeId
-                             , sizeof(nodeId_t)
-                             , joinFd
-                             , method_name );
-    if ( rc )
-    {   // Handle error
-        close( joinFd );
-        char buf[MON_STRING_BUF_SIZE];
-        snprintf(buf, sizeof(buf), "[%s], unable to obtain node id from new "
-                 "monitor: %s.\n", method_name, ErrorMsg(rc));
-        mon_log_write(MON_COMMACCEPT_8, SQ_LOG_ERR, buf);   
-        return;
-    }
-
-/*
-     printf( "TRK %s@%d - Accepted connection from pnid=%d\n"
-                      "        nodeId.nodeName=%s\n"
-                      "        nodeId.commPort=%s\n"
-                      "        nodeId.syncPort=%s\n"
-                      "        nodeId.creatorPNid=%d\n"
-                      "        nodeId.creator=%d\n"
-                      "        nodeId.creatorShellPid=%d\n"
-                      "        nodeId.creatorShellVerifier=%d\n"
-                      "        nodeId.ping=%d\n"
-                    , method_name, __LINE__
-                    , nodeId.pnid
-                    , nodeId.nodeName
-                    , nodeId.commPort
-                    , nodeId.syncPort
-                    , nodeId.creatorPNid
-                    , nodeId.creator
-                    , nodeId.creatorShellPid
-                    , nodeId.creatorShellVerifier
-                    , nodeId.ping );
-  */                  
     mem_log_write(CMonLog::MON_CONNTONEWMON_2);
     int size;
-    rc = Monitor->ReceiveSock( (char *) &size, sizeof(size), joinFd, method_name );
+    rc = Monitor->ReceiveSock( (char *) &size, sizeof(size), sockFd, method_name );
 
     if ( rc )
     {   // Handle error
-        close( joinFd );
+        close( sockFd );
         char buf[MON_STRING_BUF_SIZE];
         snprintf(buf, sizeof(buf), "[%s], unable to obtain node id from new "
                      "monitor: %s.\n", method_name, ErrorMsg(rc));
@@ -224,15 +86,14 @@ void CPtpCommAccept::processNewSock( int joinFd )
         return;
     }
     // Get info about connecting monitor
-    rc = Monitor->ReceiveSock( /*(char *) &nodeId*/
-                              (char *) &msg
+    rc = Monitor->ReceiveSock( (char *) &msg
                              , size
-                             , joinFd
+                             , sockFd
                              , method_name );
                         
     if ( rc )
     {   // Handle error
-        close( joinFd );
+        close( sockFd );
         char buf[MON_STRING_BUF_SIZE];
         snprintf(buf, sizeof(buf), "[%s], unable to obtain node id from new "
                  "monitor: %s.\n", method_name, ErrorMsg(rc));
@@ -245,41 +106,84 @@ void CPtpCommAccept::processNewSock( int joinFd )
         {
             case InternalType_Process:
             {
-               /*  printf("\nTRK Received ReqType_NewProcess \n");
-                   ReqQueue.enqueueNewProcReq( &msg.u.process);
-                   */
-                 break;
+                if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+                {
+                    trace_printf( "%s@%d" " - Received InternalType_Process\n"
+                                , method_name, __LINE__ );
+                }
+                ReqQueue.enqueueNewProcReq( &msg.u.process);
+                break;
             }
             case InternalType_ProcessInit:
             {
-               /*  printf("\nTRK Received InternalType_ProcessInit \n");
-                 ReqQueue.enqueueProcInitReq( &msg.u.processInit);
-                */
-                 break;
+                if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+                {
+                    trace_printf( "%s@%d" " - Received InternalType_ProcessInit\n"
+                                , method_name, __LINE__ );
+                }
+                if ( MyNode->IsMyNode(msg.u.processInit.origNid) )
+                {  // New process request originated on this node
+                    ReqQueue.enqueueProcInitReq( &msg.u.processInit);
+                }
+                else
+                {
+                    abort();
+                }
+                break;
             }
-            //TRK-TODO
             case InternalType_Clone:
             {
+                if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+                {
+                    trace_printf( "%s@%d" " - Received InternalType_Clone\n"
+                                , method_name, __LINE__ );
+                }
+                ReqQueue.enqueueCloneReq( &msg.u.clone );
                 break;
             }
-            //TRK-TODO
             case InternalType_Open:
             {
+                if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+                {
+                    trace_printf( "%s@%d" " - Received InternalType_Open\n"
+                                , method_name, __LINE__ );
+                }
+                ReqQueue.enqueueOpenReq( &msg.u.open );
                 break;
             }
-            //TRK-TODO
             case InternalType_Notify:
             {
+                if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+                {
+                    trace_printf( "%s@%d" " - Received InternalType_Notify\n"
+                                , method_name, __LINE__ );
+                }
+                ReqQueue.enqueueNotifyReq( &msg.u.notify );
                 break;
             }
-            //TRK-TODO
             case InternalType_Exit:
             {
+                if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+                {
+                    trace_printf( "%s@%d" " - Received InternalType_Exit\n"
+                                , method_name, __LINE__ );
+                }
+                ReqQueue.enqueueExitReq( &msg.u.exit );
+                break;
+            }
+            case InternalType_Kill:
+            {
+                if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+                {
+                    trace_printf( "%s@%d" " - Received InternalType_Kill\n"
+                                , method_name, __LINE__ );
+                }
+                ReqQueue.enqueueKillReq( &msg.u.kill );
                 break;
             }
             default:
             {
-
+                abort();
             }
         }
     }
@@ -313,7 +217,7 @@ void CPtpCommAccept::commAcceptorSock()
     const char method_name[] = "CPtpCommAccept::commAcceptorSock";
     TRACE_ENTRY;
     
-    int joinFd = -1;
+    int sockFd = -1;
 
     if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
     {
@@ -331,7 +235,7 @@ void CPtpCommAccept::commAcceptorSock()
             }
     
             mem_log_write(CMonLog::MON_CONNTONEWMON_1);
-            joinFd = Monitor->AcceptMon2MonSock();
+            sockFd = Monitor->AcceptMon2MonSock();
         }
         else
         {
@@ -354,7 +258,7 @@ void CPtpCommAccept::commAcceptorSock()
             break;
         }
 
-        if ( joinFd < 0 )
+        if ( sockFd < 0 )
         {
             char buf[MON_STRING_BUF_SIZE];
             snprintf(buf, sizeof(buf), "[%s], cannot accept new monitor: %s.\n",
@@ -363,11 +267,11 @@ void CPtpCommAccept::commAcceptorSock()
         }
         else
         {
-            processNewSock( joinFd );
+            processNewSock( sockFd );
         }
     }
 
-    if ( !(joinFd < 0) ) close( joinFd );
+    if ( !(sockFd < 0) ) close( sockFd );
 
     if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
         trace_printf("%s@%d thread %lx exiting\n", method_name,
@@ -504,38 +408,3 @@ void CPtpCommAccept::monReqExec( void *req )
 
     TRACE_EXIT;
 }
-
-//TRK-TODO 
-void CPtpCommAccept::monReqNewProcess( struct message_def* msg, int sockFd )
-{
-    const char method_name[] = "CCommAcceptMon::monReqNewProcess";
-    TRACE_ENTRY;
-    sockFd = sockFd; // appease compiler for the time being
-    
-    if (trace_settings & (TRACE_REQUEST))
-    {
-        trace_printf( "%s@%d - Received monitor request new-process data.\n"
-                      "        msg.new_process_ns.parent_nid=%d\n"
-                      "        msg.new_process_ns.parent_pid=%d\n"
-                      "        msg.new_process_ns.parent_verifier=%d\n"
-                      "        msg.new_process_ns.nid=%d\n"
-                      "        msg._nsnew_process.pid=%d\n"
-                      "        msg._nsnew_process.verifier=%d\n"
-                      "        msg.new_process_ns.type=%d\n"
-                      "        msg.new_process_ns.priority=%d\n"
-                      "        msg.new_process_ns.process_name=%s\n"
-                    , method_name, __LINE__
-                    , msg->u.request.u.new_process_ns.parent_nid
-                    , msg->u.request.u.new_process_ns.parent_pid
-                    , msg->u.request.u.new_process_ns.parent_verifier
-                    , msg->u.request.u.new_process_ns.nid
-                    , msg->u.request.u.new_process_ns.pid
-                    , msg->u.request.u.new_process_ns.verifier
-                    , msg->u.request.u.new_process_ns.type
-                    , msg->u.request.u.new_process_ns.priority
-                    , msg->u.request.u.new_process_ns.process_name
-                    );
-    }
-
-    TRACE_EXIT;
-}

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/ptpcommaccept.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/ptpcommaccept.h b/core/sqf/monitor/linux/ptpcommaccept.h
index 617d6d7..ca58139 100644
--- a/core/sqf/monitor/linux/ptpcommaccept.h
+++ b/core/sqf/monitor/linux/ptpcommaccept.h
@@ -47,11 +47,9 @@ public:
     void start( void );
     void shutdownWork( void );
 
-    void monReqNewProcess( struct message_def* msg, int sockFd );
 private:
 
     void commAcceptorSock( void );
-    bool sendNodeInfoSock( int sockFd );
 
     bool accepting_;
     bool shutdown_;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/replicate.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/replicate.cxx b/core/sqf/monitor/linux/replicate.cxx
index 3cd23ec..c22c799 100644
--- a/core/sqf/monitor/linux/replicate.cxx
+++ b/core/sqf/monitor/linux/replicate.cxx
@@ -701,7 +701,7 @@ bool CReplProcInit::replicate(struct internal_msg_def *&msg)
         trace_printf("%s@%d - Replicating proc init new process %s, result=%d\n",
                      method_name, __LINE__, name_, result_);
 
-    // Build message to replicate process initializationdata other nodes
+    // Build message to replicate process initialization data other nodes
     msg->type = InternalType_ProcessInit;
     msg->u.processInit.nid = nid_;
     msg->u.processInit.pid = pid_;
@@ -739,9 +739,9 @@ CReplClone::CReplClone(CProcess *process) : process_(process)
     if (trace_settings & (TRACE_SYNC_DETAIL | TRACE_PROCESS_DETAIL))
     {
         const char method_name[] = "CReplClone::CReplClone";
-        trace_printf("%s@%d  - Queuing replicate process %s (%d, %d:%d)\n",
+        trace_printf("%s@%d  - Queuing replicate process %s (%d, %d:%d), port=%s\n",
                      method_name, __LINE__, process_->GetName(), process_->GetNid(),
-                     process_->GetPid(), process_->GetVerifier());
+                     process_->GetPid(), process_->GetVerifier(), process_->GetPort());
     }
 
     // Increment reference count for process object
@@ -834,8 +834,28 @@ bool CReplClone::replicate(struct internal_msg_def *&msg)
     // temp trace
     if (trace_settings & TRACE_PROCESS)
     {
-        trace_printf("%s@%d - replSize_=%d, programStrId=(%d,%d), pathStrId=(%d,%d), ldPathStrId=(%d,%d), name=%s, strlen(name)=%d, port=%s, strlen(port)=%d, infile=%s, strlen(infile)=%d, outfile=%s, strlen(outfile)=%d, argc=%d, strlen(total argv)=%d, args=[%.*s]\n",
-                     method_name, __LINE__, replSize_, msg->u.clone.programStrId.nid, msg->u.clone.programStrId.id, msg->u.clone.pathStrId.nid, msg->u.clone.pathStrId.id, msg->u.clone.ldpathStrId.nid, msg->u.clone.ldpathStrId.id, &msg->u.clone.stringData, nameLen_, &msg->u.clone.stringData+nameLen_, portLen_,  &msg->u.clone.stringData+nameLen_+portLen_, infileLen_, &msg->u.clone.stringData+nameLen_+portLen_+infileLen_, outfileLen_, msg->u.clone.argc, argvLen_, argvLen_, &msg->u.clone.stringData+nameLen_+portLen_+infileLen_+outfileLen_);
+        trace_printf( "%s@%d - replSize_=%d\n"
+                      "        msg->u.clone.programStrId=(%d,%d)\n"
+                      "        msg->u.clone.pathStrId=(%d,%d)\n"
+                      "        msg->u.clone.ldPathStrId=(%d,%d)\n"
+                      "        msg->u.clone.name=%s, strlen(name)=%d\n"
+                      "        msg->u.clone.port=%s, strlen(port)=%d\n"
+                      "        msg->u.clone.infile=%s, strlen(infile)=%d\n"
+                      "        msg->u.clone.outfile=%s, strlen(outfile)=%d\n"
+                      "        msg->u.clone.argc=%d, strlen(total argv)=%d, args=[%.*s]\n"
+                    , method_name, __LINE__, replSize_
+                    , msg->u.clone.programStrId.nid
+                    , msg->u.clone.programStrId.id
+                    , msg->u.clone.pathStrId.nid
+                    , msg->u.clone.pathStrId.id
+                    , msg->u.clone.ldpathStrId.nid
+                    , msg->u.clone.ldpathStrId.id
+                    , &msg->u.clone.stringData, nameLen_
+                    , &msg->u.clone.stringData+nameLen_, portLen_
+                    , &msg->u.clone.stringData+nameLen_+portLen_, infileLen_
+                    , &msg->u.clone.stringData+nameLen_+portLen_+infileLen_, outfileLen_
+                    , msg->u.clone.argc
+                    , argvLen_, argvLen_, &msg->u.clone.stringData+nameLen_+portLen_+infileLen_+outfileLen_);
     }
 
     // Advance sync buffer pointer

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/reqkill.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqkill.cxx b/core/sqf/monitor/linux/reqkill.cxx
index 40580c4..ee88a19 100644
--- a/core/sqf/monitor/linux/reqkill.cxx
+++ b/core/sqf/monitor/linux/reqkill.cxx
@@ -30,6 +30,7 @@
 #include "monlogging.h"
 #include "replicate.h"
 #include "mlio.h"
+#include "ptpclient.h"
 
 extern CMonitor *Monitor;
 extern CMonStats *MonStats;
@@ -37,6 +38,8 @@ extern CNodeContainer *Nodes;
 extern CReplicate Replicator;
 extern CNode *MyNode;
 extern int MyPNID;
+extern CPtpClient *PtpClient;
+extern bool NameServerEnabled;
 
 CExtKillReq::CExtKillReq (reqQueueMsg_t msgType, int pid,
                           struct message_def *msg )
@@ -88,12 +91,23 @@ void CExtKillReq::Kill( CProcess *process )
     if ( (node->GetState() == State_Up || 
           node->GetState() == State_Shutdown) && node->GetPNid() != MyPNID )
     {
-        // Replicate the kill to other nodes
-        CReplKill *repl = new CReplKill( process->GetNid()
-                                       , process->GetPid()
-                                       , process->GetVerifier()
-                                       , process->GetAbort());
-        Replicator.addItem(repl);
+        if (NameServerEnabled)
+        {
+            // Forward the process create to the target node
+            PtpClient->ProcessKill( process
+                                  , process->GetAbort()
+                                  , lnode->GetNid()
+                                  , node->GetName());
+        }
+        else
+        {
+            // Replicate the kill to other nodes
+            CReplKill *repl = new CReplKill( process->GetNid()
+                                           , process->GetPid()
+                                           , process->GetVerifier()
+                                           , process->GetAbort());
+            Replicator.addItem(repl);
+        }
     }
     else
     {

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/monitor/linux/reqnewproc.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqnewproc.cxx b/core/sqf/monitor/linux/reqnewproc.cxx
index 04f1f26..5ebfec5 100644
--- a/core/sqf/monitor/linux/reqnewproc.cxx
+++ b/core/sqf/monitor/linux/reqnewproc.cxx
@@ -527,15 +527,18 @@ void CExtNewProcReq::performRequest()
                 {
                     process->userArgs (  msg_->u.request.u.new_process.argc,
                                          msg_->u.request.u.new_process.argv );
-                    // Replicate the process to other nodes
-                    
-//TRK-TODO 
-         /*           if (NameServerEnabled)
+#ifndef NAMESERVER_PROCESS
+                    if (NameServerEnabled)
                     {
-                        PtpClient->NewProcess(process, lnode->GetNid(), lnode->GetNode()->GetName());
+                        // Forward the process create to the target node
+                        PtpClient->ProcessNew( process
+                                             , lnode->GetNid()
+                                             , lnode->GetNode()->GetName());
                     }
                     else
-         */         {
+#endif
+                    {
+                        // Replicate the process to other nodes
                         CReplProcess *repl = new CReplProcess(process);
                         Replicator.addItem(repl);
                     }
@@ -558,19 +561,6 @@ void CExtNewProcReq::performRequest()
                     strcpy(msg_->u.reply.u.new_process.process_name,process->GetName());
                     msg_->u.reply.u.new_process.return_code = MPI_SUCCESS;
                 }
-#ifdef QUICK_WAITED_NEWPROCESS_REPLY
-                else if (process->GetPid() != -1)
-                {   // Process was created locally, reply now.  The process
-                    // was created but the process startup message has not yet
-                    // arrived.
-                    msg_->u.reply.type = ReplyType_NewProcess;
-                    msg_->u.reply.u.new_process.nid = process->GetNid();
-                    msg_->u.reply.u.new_process.pid = process->GetPid();
-                    msg_->u.reply.u.new_process.verifier = process->GetVerifier();
-                    strcpy(msg_->u.reply.u.new_process.process_name,process->GetName());
-                    msg_->u.reply.u.new_process.return_code = MPI_SUCCESS;
-                }
-#endif
                 else
                 {
                     // we will not reply at this time ... but wait for the child process to 


[50/50] [abbrv] trafodion git commit: Merge [TRAFODION-2884] PR-1604 Scale enhancements - Name Server architecture

Posted by su...@apache.org.
Merge [TRAFODION-2884] PR-1604 Scale enhancements - Name Server architecture


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

Branch: refs/heads/master
Commit: 07e94f3ba2fcfa5e0223563a5997921b14a02796
Parents: 5b5ab32 87210a5
Author: Suresh Subbiah <su...@apache.org>
Authored: Sat Jun 16 17:08:44 2018 +0000
Committer: Suresh Subbiah <su...@apache.org>
Committed: Sat Jun 16 17:08:44 2018 +0000

----------------------------------------------------------------------
 core/sqf/commonLogger/CommonLogger.cpp          |    3 +
 core/sqf/conf/log4cxx.monitor.trafns.config     |   45 +
 .../export/include/common/evl_sqlog_eventnum.h  |  129 +-
 core/sqf/export/include/seabed/ms.h             |    9 +
 core/sqf/export/include/trafconf/trafconfig.h   |   25 +-
 core/sqf/monitor/linux/cluster.cxx              | 1973 +++++++++++----
 core/sqf/monitor/linux/cluster.h                |   74 +-
 core/sqf/monitor/linux/commaccept.cxx           |   60 +-
 core/sqf/monitor/linux/config.cxx               |  416 +++-
 core/sqf/monitor/linux/config.h                 |   25 +-
 core/sqf/monitor/linux/device.h                 |    2 +
 core/sqf/monitor/linux/healthcheck.cxx          |  119 +-
 core/sqf/monitor/linux/healthcheck.h            |    5 +
 core/sqf/monitor/linux/internal.h               |   99 +-
 core/sqf/monitor/linux/lnode.cxx                |   47 +-
 core/sqf/monitor/linux/lnode.h                  |    3 +-
 core/sqf/monitor/linux/localio.h                |    7 +-
 core/sqf/monitor/linux/makefile                 |   79 +-
 core/sqf/monitor/linux/meas.cxx                 |  240 ++
 core/sqf/monitor/linux/meas.h                   |   75 +
 core/sqf/monitor/linux/mlio.cxx                 |   28 +-
 core/sqf/monitor/linux/mlio.h                   |    2 +
 core/sqf/monitor/linux/monitor.cxx              |  849 +++++--
 core/sqf/monitor/linux/monitor.h                |   16 +
 core/sqf/monitor/linux/monlogging.h             |    2 +
 core/sqf/monitor/linux/monmemlog.cxx            |   11 +
 core/sqf/monitor/linux/monsonar.h               |   18 +
 core/sqf/monitor/linux/montrace.cxx             |   24 +-
 core/sqf/monitor/linux/montrace.h               |   44 +-
 core/sqf/monitor/linux/msgdef.h                 |  159 ++
 core/sqf/monitor/linux/nameserver.cxx           | 1120 +++++++++
 core/sqf/monitor/linux/nameserver.h             |   74 +
 core/sqf/monitor/linux/notice.cxx               |  199 +-
 core/sqf/monitor/linux/notice.h                 |    7 +
 core/sqf/monitor/linux/nscluster.cxx            |   40 +
 core/sqf/monitor/linux/nscommaccept.cxx         |   28 +
 core/sqf/monitor/linux/nscommacceptmon.cxx      |  907 +++++++
 core/sqf/monitor/linux/nscommacceptmon.h        |   79 +
 core/sqf/monitor/linux/nsconfig.cxx             |   28 +
 core/sqf/monitor/linux/nshealthcheck.cxx        |   28 +
 core/sqf/monitor/linux/nslnode.cxx              |   28 +
 core/sqf/monitor/linux/nsmonitor.cxx            |   28 +
 core/sqf/monitor/linux/nsmontrace.cxx           |   28 +
 core/sqf/monitor/linux/nspnode.cxx              |   28 +
 core/sqf/monitor/linux/nsprocess.cxx            |  132 +
 core/sqf/monitor/linux/nsredirector.cxx         |   28 +
 core/sqf/monitor/linux/nsreplicate.cxx          |   28 +
 core/sqf/monitor/linux/nsreqdelproc.cxx         |  191 ++
 core/sqf/monitor/linux/nsreqnewproc.cxx         |  180 ++
 core/sqf/monitor/linux/nsreqprocinfo.cxx        |   28 +
 core/sqf/monitor/linux/nsreqprocinfons.cxx      |  288 +++
 core/sqf/monitor/linux/nsreqqueue.cxx           |  129 +
 core/sqf/monitor/linux/nsreqshutdown.cxx        |  110 +
 core/sqf/monitor/linux/nsreqstart.cxx           |  130 +
 core/sqf/monitor/linux/nsreqstop.cxx            |  124 +
 core/sqf/monitor/linux/nsreqworker.cxx          |   28 +
 core/sqf/monitor/linux/nstype.h                 |   28 +
 core/sqf/monitor/linux/pnode.cxx                |  735 +++++-
 core/sqf/monitor/linux/pnode.h                  |   61 +-
 core/sqf/monitor/linux/process.cxx              | 1495 ++++++++++--
 core/sqf/monitor/linux/process.h                |  109 +-
 core/sqf/monitor/linux/pstartd.cxx              |    1 +
 core/sqf/monitor/linux/ptpclient.cxx            | 1102 +++++++++
 core/sqf/monitor/linux/ptpclient.h              |   98 +
 core/sqf/monitor/linux/ptpcommaccept.cxx        |  444 ++++
 core/sqf/monitor/linux/ptpcommaccept.h          |   62 +
 core/sqf/monitor/linux/redirector.cxx           |  100 +-
 core/sqf/monitor/linux/redirector.h             |    2 +
 core/sqf/monitor/linux/replicate.cxx            |  442 +++-
 core/sqf/monitor/linux/replicate.h              |   75 +
 core/sqf/monitor/linux/reqdump.cxx              |   96 +-
 core/sqf/monitor/linux/reqevent.cxx             |  121 +-
 core/sqf/monitor/linux/reqget.cxx               |    2 +-
 core/sqf/monitor/linux/reqkill.cxx              |  152 +-
 core/sqf/monitor/linux/reqnewproc.cxx           |   71 +-
 core/sqf/monitor/linux/reqnodeadd.cxx           |    3 +-
 core/sqf/monitor/linux/reqnodedelete.cxx        |    2 +-
 core/sqf/monitor/linux/reqnodename.cxx          |    2 +-
 core/sqf/monitor/linux/reqnotify.cxx            |  155 +-
 core/sqf/monitor/linux/reqnsadd.cxx             |  197 ++
 core/sqf/monitor/linux/reqnsdelete.cxx          |  174 ++
 core/sqf/monitor/linux/reqnsstart.cxx           |   71 +
 core/sqf/monitor/linux/reqnsstop.cxx            |   71 +
 core/sqf/monitor/linux/reqopen.cxx              |   64 +-
 core/sqf/monitor/linux/reqprocinfo.cxx          |  633 +++--
 core/sqf/monitor/linux/reqqueue.cxx             | 2306 +++++++++++++++---
 core/sqf/monitor/linux/reqqueue.h               |  590 ++++-
 core/sqf/monitor/linux/reqtmleader.cxx          |   36 +
 core/sqf/monitor/linux/reqworker.cxx            |    6 +-
 core/sqf/monitor/linux/shell.cxx                | 1524 ++++++++++--
 core/sqf/monitor/linux/system.cxx               |    2 +-
 core/sqf/monitor/linux/tmsync.cxx               |   29 +
 core/sqf/monitor/linux/versns.cxx               |   30 +
 core/sqf/monitor/linux/zclient.cxx              |  125 +-
 core/sqf/monitor/linux/zclient.h                |    6 +
 core/sqf/monitor/linux/zootest.cxx              |   10 +-
 core/sqf/monitor/test/Makefile                  |    6 +-
 core/sqf/monitor/test/childExitChild.cxx        |    1 +
 core/sqf/monitor/test/childExitParent.cxx       |    1 +
 core/sqf/monitor/test/monitor.env               |   61 +
 core/sqf/monitor/test/montestutil.cxx           |    4 +-
 core/sqf/monitor/test/nameserver.env            |   61 +
 core/sqf/monitor/test/runtest                   |  258 +-
 core/sqf/monitor/test/sqconfig.monitor.cluster  |   39 -
 core/sqf/monitor/test/sqconfig.monitor.virtual  |    3 +
 core/sqf/sqenvcom.sh                            |   30 +-
 core/sqf/sql/scripts/createConfigDb             |    7 +
 core/sqf/sql/scripts/gensq.pl                   |   53 +
 core/sqf/sql/scripts/gomon.cold                 |  106 +-
 core/sqf/sql/scripts/monitor.env                |    2 +
 core/sqf/sql/scripts/nameserver.env             |   61 +
 core/sqf/sql/scripts/pstat                      |    2 +-
 core/sqf/sql/scripts/sqconfig                   |    4 +
 core/sqf/sql/scripts/sqconfig.persist           |   12 +-
 core/sqf/sql/scripts/sqconfig.sample            |   17 +-
 core/sqf/sql/scripts/sqconfigdb.pm              |   47 +
 core/sqf/sql/scripts/sqgen                      |  211 +-
 core/sqf/sql/scripts/sqnameserver.pm            |  151 ++
 core/sqf/sql/scripts/sqnodes.pm                 |    4 +-
 core/sqf/sql/scripts/sqpersist.pm               |    4 +-
 core/sqf/sql/scripts/sqstart                    |  213 +-
 core/sqf/sql/scripts/sqstop                     |   36 +-
 core/sqf/src/seabed/src/labelmaps.cpp           |   29 +
 core/sqf/src/seabed/test/Makefile               |   18 +-
 core/sqf/src/seabed/test/TEST-README.txt        |    1 +
 core/sqf/src/seabed/test/go141                  |    3 +
 core/sqf/src/seabed/test/go17                   |    2 +-
 core/sqf/src/seabed/test/go190                  |    3 +
 core/sqf/src/seabed/test/go20                   |    2 +-
 core/sqf/src/seabed/test/go22                   |    4 +-
 core/sqf/src/seabed/test/go23                   |    2 +-
 core/sqf/src/seabed/test/go286                  |   38 +
 core/sqf/src/seabed/test/go69mon                |    2 +
 core/sqf/src/seabed/test/go83                   |    2 +-
 core/sqf/src/seabed/test/goall                  |   26 +-
 core/sqf/src/seabed/test/gocleanport            |    2 +-
 core/sqf/src/seabed/test/godb.pl                |   15 +
 core/sqf/src/seabed/test/gohost                 |    2 +-
 core/sqf/src/seabed/test/gosetup                |    8 +-
 core/sqf/src/seabed/test/gosetupcl3             |    5 +-
 core/sqf/src/seabed/test/goshell                |    4 +-
 core/sqf/src/seabed/test/goshell124             |    4 +
 core/sqf/src/seabed/test/goshell176             |    4 +
 core/sqf/src/seabed/test/goshell31              |    6 +-
 core/sqf/src/seabed/test/goshell31d             |    6 +-
 core/sqf/src/seabed/test/goshell31vc            |    6 +-
 core/sqf/src/seabed/test/goshell49              |    6 +-
 core/sqf/src/seabed/test/goshell76              |    2 +-
 core/sqf/src/seabed/test/goshell93              |    2 +-
 core/sqf/src/seabed/test/goshell96              |    2 +-
 core/sqf/src/seabed/test/goshelln               |    4 +
 core/sqf/src/seabed/test/t169srv.cpp            |   11 +-
 core/sqf/src/seabed/test/t209ms.cpp             |    4 +
 core/sqf/src/seabed/test/t213fs.cpp             |   11 +-
 core/sqf/src/seabed/test/t226fs.cpp             |    4 +
 core/sqf/src/seabed/test/t228ms.cpp             |   23 +-
 core/sqf/src/seabed/test/t279ms.cpp             |   12 +-
 core/sqf/src/seabed/test/t280fs.cpp             |    2 +
 core/sqf/src/seabed/test/t286ms.cpp             |  396 +++
 core/sqf/src/seabed/test/tdelta.cpp             |  269 ++
 core/sqf/src/seabed/test/tmerge.cpp             |  322 +++
 core/sqf/src/trafconf/Makefile                  |    7 +-
 core/sqf/src/trafconf/clusterconf.cpp           |   47 +
 core/sqf/src/trafconf/nameserverconfig.cpp      |  350 +++
 core/sqf/src/trafconf/nameserverconfig.h        |   79 +
 core/sqf/src/trafconf/persistconfig.cpp         |    3 +
 core/sqf/src/trafconf/tcdb.cpp                  |   44 +
 core/sqf/src/trafconf/tcdb.h                    |    4 +
 core/sqf/src/trafconf/tcdbsqlite.cpp            |  340 +++
 core/sqf/src/trafconf/tcdbsqlite.h              |    4 +
 core/sqf/src/trafconf/tcdbstore.h               |    4 +
 core/sqf/src/trafconf/tctrace.cpp               |    3 +-
 core/sqf/src/trafconf/tctrace.h                 |    2 +
 core/sqf/src/trafconf/trafconf.cpp              |  221 +-
 core/sqf/src/trafconf/trafconfig.cpp            |   56 +
 175 files changed, 21101 insertions(+), 2559 deletions(-)
----------------------------------------------------------------------



[08/50] [abbrv] trafodion git commit: Fixes after merge to latest in shared fork.

Posted by su...@apache.org.
Fixes after merge to latest in shared fork.


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

Branch: refs/heads/master
Commit: f3daa45e4bad66ebff326d34610c73a04c0cda0b
Parents: b565fb7
Author: Zalo Correa <za...@esgyn.com>
Authored: Wed Mar 28 18:51:44 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Wed Mar 28 18:51:44 2018 -0700

----------------------------------------------------------------------
 core/sqf/export/include/seabed/ms.h            |  1 +
 core/sqf/monitor/test/monitor.env              | 79 +++++++++++++++++++++
 core/sqf/monitor/test/runtest                  | 28 ++++----
 core/sqf/monitor/test/sqconfig.monitor.cluster | 39 ----------
 core/sqf/sql/scripts/monitor.env               | 20 +++---
 core/sqf/src/seabed/src/labelmaps.cpp          |  4 ++
 6 files changed, 108 insertions(+), 63 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/f3daa45e/core/sqf/export/include/seabed/ms.h
----------------------------------------------------------------------
diff --git a/core/sqf/export/include/seabed/ms.h b/core/sqf/export/include/seabed/ms.h
index b82bace..d1c095b 100644
--- a/core/sqf/export/include/seabed/ms.h
+++ b/core/sqf/export/include/seabed/ms.h
@@ -427,6 +427,7 @@ typedef enum {
     MS_ReqType_PNodeInfo,
     MS_ReqType_ProcessInfo,
     MS_ReqType_ProcessInfoCont,
+    MS_ReqType_ProcessInfoNs,
     MS_ReqType_Set,
     MS_ReqType_Shutdown,
     MS_ReqType_ShutdownNs,

http://git-wip-us.apache.org/repos/asf/trafodion/blob/f3daa45e/core/sqf/monitor/test/monitor.env
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/test/monitor.env b/core/sqf/monitor/test/monitor.env
new file mode 100644
index 0000000..bc50bfc
--- /dev/null
+++ b/core/sqf/monitor/test/monitor.env
@@ -0,0 +1,79 @@
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+
+# Monitor process run mode:
+#
+#   AGENT - monitor process runs in agent mode versus MPI collective
+#
+# Uncomment the next three environment variables
+#export SQ_MON_RUN_MODE=AGENT
+#export MONITOR_COMM_PORT=23390
+#export MONITOR_SYNC_PORT=23380
+#
+#   NAME-SERVER - to disable process replication and enable name-server
+#
+# Uncomment the next six environment variables
+#export SQ_NAMESERVER_ENABLE=1
+#export NS_COMM_PORT=23370
+#export NS_SYNC_PORT=23360
+#export NS_M2N_COMM_PORT=23350
+#export MON2MON_COMM_PORT=23340
+#export MONITOR_COMM_PORT=23330
+
+# Uncomment MON_TRACE_ENABLE and specific tracing level to enable 
+# Trafodion monitor process tracing
+#MON_TRACE_ENABLE=1
+#MON_TRACE_EVLOG_MSG=1
+#MON_TRACE_INIT=1
+#MON_TRACE_RECOVERY=1
+#MON_TRACE_REQUEST=1
+#MON_TRACE_PROCESS=1
+#MON_TRACE_NOTICE=1
+#MON_TRACE_NS=1
+#MON_TRACE_SYNC=1
+# Enable TC_TRACE_* along with MON_TRACE_TRAFCONFIG for more detail
+#MON_TRACE_TRAFCONFIG=1
+#MON_TRACE_MLIO=1
+
+#MON_TRACE_REQUEST_DETAIL=1
+#MON_TRACE_PROCESS_DETAIL=1
+#MON_TRACE_NOTICE_DETAIL=1
+#MON_TRACE_SYNC_DETAIL=1
+#MON_TRACE_MLIO_DETAIL=1
+
+#MON_TRACE_TMSYNC=1
+#MON_TRACE_STATS=1
+#MON_TRACE_ENTRY_EXIT=1
+#MON_TRACE_REDIRECTION=1
+#MON_TRACE_HEALTH=1
+#MON_TRACE_SIG_HANDLER=1
+
+# Uncomment TC_TRACE_ENABLE and specific tracing level to enable 
+# Trafodion Configuration library tracing
+# TC_TRACE_ENABLE requires MON_TRACE_TRAFCONFIG above
+#TC_TRACE_ENABLE=1
+#TC_TRACE_REQUEST=1
+#TC_TRACE_NODE=1
+#TC_TRACE_PERSIST=1
+#TC_TRACE_REGISTRY=1
+#TC_TRACE_INIT=1
+#TC_TRACE_LOG_MSG=1
+#TC_TRACE_ENTRY_EXIT=1

http://git-wip-us.apache.org/repos/asf/trafodion/blob/f3daa45e/core/sqf/monitor/test/runtest
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/test/runtest b/core/sqf/monitor/test/runtest
index 1d7929e..a31e7a0 100755
--- a/core/sqf/monitor/test/runtest
+++ b/core/sqf/monitor/test/runtest
@@ -174,7 +174,7 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
-shell <<eof
+shell -a<<eof
  shutdown
  exit
 eof
@@ -213,7 +213,7 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
-shell <<eof
+shell -a<<eof
  shutdown
  exit
 eof
@@ -244,7 +244,7 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
-shell <<eof
+shell -a<<eof
  shutdown
  exit
 eof
@@ -286,7 +286,7 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
-shell <<eof
+shell -a<<eof
  shutdown
  exit
 eof
@@ -321,7 +321,7 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
-shell <<eof
+shell -a<<eof
  shutdown
  exit
 eof
@@ -345,7 +345,7 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
-shell <<eof
+shell -a<<eof
  shutdown
  exit
 eof
@@ -375,7 +375,7 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
-shell <<eof
+shell -a<<eof
  shutdown
  exit
 eof
@@ -411,7 +411,7 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
-shell <<eof
+shell -a<<eof
  shutdown
  exit
 eof
@@ -442,7 +442,7 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
-shell <<eof
+shell -a<<eof
  shutdown
  exit
 eof
@@ -475,7 +475,7 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
-shell <<eof
+shell -a<<eof
  shutdown
  exit
 eof
@@ -510,7 +510,7 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
-shell <<eof
+shell -a<<eof
  shutdown
  exit
 eof
@@ -534,7 +534,7 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
-shell <<eof
+shell -a<<eof
  shutdown
  exit
 eof
@@ -560,7 +560,7 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
-shell <<eof
+shell -a<<eof
  shutdown
  exit
 eof
@@ -585,7 +585,7 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
-shell <<eof
+shell -a<<eof
  shutdown
  exit
 eof

http://git-wip-us.apache.org/repos/asf/trafodion/blob/f3daa45e/core/sqf/monitor/test/sqconfig.monitor.cluster
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/test/sqconfig.monitor.cluster b/core/sqf/monitor/test/sqconfig.monitor.cluster
index 00a361e..8cd3b75 100644
--- a/core/sqf/monitor/test/sqconfig.monitor.cluster
+++ b/core/sqf/monitor/test/sqconfig.monitor.cluster
@@ -44,42 +44,3 @@ begin overflow
 hdd $TRAF_VAR
 #sdd /sdd/directory
 end overflow
-
-#============================
-# Audit configuration
-#============================
-
-# Extents are for data audit volumes only, not $TLOG
-# Minimum is 1550
-begin at_extent_size
-15500
-end at_extent_size
-
-# Files per volume are for data audit volumes only, not $TLOG
-# Minimum is 10
-begin at_files_per_volume
-10
-end at_files_per_volume
-
-# Percentage of audit allowed before TX is DOOMED
-# Maximum is 40
-begin tx_capacity_threshold
-10
-end tx_capacity_threshold
-
-#============================
-# Volume Configuration
-#============================
-
-begin tmase
-$TLOG    0  /database/sqft2 /databasem/sqft2
-end tmase
-
-begin ase
-$AUD000  1  /database/sqft2   /databasem/sqft2
-end ase
-
-begin tse
-$SYSTEM  2  /database/sqft2   /databasem/sqft2
-$DB0000  3  /database/sqft2   /databasem/sqft2
-end tse

http://git-wip-us.apache.org/repos/asf/trafodion/blob/f3daa45e/core/sqf/sql/scripts/monitor.env
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/monitor.env b/core/sqf/sql/scripts/monitor.env
index fc10c1f..a9172b8 100644
--- a/core/sqf/sql/scripts/monitor.env
+++ b/core/sqf/sql/scripts/monitor.env
@@ -21,21 +21,21 @@
 
 # Uncomment MON_TRACE_ENABLE and specific tracing level to enable 
 # Trafodion monitor process tracing
-MON_TRACE_ENABLE=1
-MON_TRACE_EVLOG_MSG=1
-MON_TRACE_INIT=1
-MON_TRACE_RECOVERY=1
-MON_TRACE_REQUEST=1
-MON_TRACE_PROCESS=1
-MON_TRACE_NOTICE=1
-MON_TRACE_NS=1
+#MON_TRACE_ENABLE=1
+#MON_TRACE_EVLOG_MSG=1
+#MON_TRACE_INIT=1
+#MON_TRACE_RECOVERY=1
+#MON_TRACE_REQUEST=1
+#MON_TRACE_PROCESS=1
+#MON_TRACE_NOTICE=1
+#MON_TRACE_NS=1
 #MON_TRACE_SYNC=1
 # Enable TC_TRACE_* along with MON_TRACE_TRAFCONFIG for more detail
 #MON_TRACE_TRAFCONFIG=1
 #MON_TRACE_MLIO=1
 
-MON_TRACE_REQUEST_DETAIL=1
-MON_TRACE_PROCESS_DETAIL=1
+#MON_TRACE_REQUEST_DETAIL=1
+#MON_TRACE_PROCESS_DETAIL=1
 #MON_TRACE_NOTICE_DETAIL=1
 #MON_TRACE_SYNC_DETAIL=1
 #MON_TRACE_MLIO_DETAIL=1

http://git-wip-us.apache.org/repos/asf/trafodion/blob/f3daa45e/core/sqf/src/seabed/src/labelmaps.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/seabed/src/labelmaps.cpp b/core/sqf/src/seabed/src/labelmaps.cpp
index 6d044e4..4e1dfdd 100644
--- a/core/sqf/src/seabed/src/labelmaps.cpp
+++ b/core/sqf/src/seabed/src/labelmaps.cpp
@@ -373,6 +373,7 @@ static const char *ga_ms_mon_req_type_labels[] = {
     "MS_ReqType_PNodeInfo",
     "MS_ReqType_ProcessInfo",
     "MS_ReqType_ProcessInfoCont",
+    "MS_ReqType_ProcessInfoNs",
     "MS_ReqType_Set",
     "MS_ReqType_Shutdown",
     "MS_ReqType_ShutdownNs",
@@ -417,6 +418,7 @@ static const char *ga_ms_mon_req_type_short_labels[] = {
     "PNodeInfo",
     "ProcessInfo",
     "ProcessInfoCont",
+    "ProcessInfoNs",
     "Set",
     "Shutdown",
     "ShutdownNs",
@@ -486,6 +488,7 @@ static const char *ga_sb_msmon_reply_type_labels[] = {
     "OpenInfo",
     "PNodeInfo",
     "ProcessInfo",
+    "ProcessInfoNs",
     "Stfsd",
     "Startup",
     "TmSync",
@@ -610,6 +613,7 @@ static const char *ga_sb_utrace_api_mon_reqtype_labels[] = {
     "ReqType_PNodeInfo",
     "ReqType_ProcessInfo",
     "ReqType_ProcessInfoCont",
+    "ReqType_ProcessInfoNs",
     "ReqType_Set",
     "ReqType_Shutdown",
     "ReqType_ShutdownNs",


[35/50] [abbrv] trafodion git commit: Fixes to Name Server replication logic.

Posted by su...@apache.org.
http://git-wip-us.apache.org/repos/asf/trafodion/blob/1f7eabb0/core/sqf/monitor/linux/reqqueue.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqqueue.cxx b/core/sqf/monitor/linux/reqqueue.cxx
index e97c0a7..b10716c 100644
--- a/core/sqf/monitor/linux/reqqueue.cxx
+++ b/core/sqf/monitor/linux/reqqueue.cxx
@@ -821,9 +821,12 @@ CIntCloneProcNsReq::CIntCloneProcNsReq( bool backup
                                       , int persistentRetries
                                       , int  argc
                                       , struct timespec creationTime
-                                      , strId_t pathStrId
-                                      , strId_t ldpathStrId
-                                      , strId_t programStrId
+                                      , int pathLen
+                                      , int ldpathLen
+                                      , int programLen
+//                                      , strId_t pathStrId
+//                                      , strId_t ldpathStrId
+//                                      , strId_t programStrId
                                       , int nameLen
                                       , int portLen
                                       , int infileLen
@@ -847,9 +850,12 @@ CIntCloneProcNsReq::CIntCloneProcNsReq( bool backup
                    , priorPid_( priorPid )
                    , persistentRetries_( persistentRetries )
                    , argc_( argc )
-                   , pathStrId_( pathStrId )
-                   , ldpathStrId_( ldpathStrId )
-                   , programStrId_( programStrId )
+                   , pathLen_( pathLen )
+                   , ldpathLen_( ldpathLen )
+                   , programLen_( programLen )
+//                   , pathStrId_( pathStrId )
+//                   , ldpathStrId_( ldpathStrId )
+//                   , programStrId_( programStrId )
                    , nameLen_( nameLen )
                    , portLen_( portLen )
                    , infileLen_( infileLen )
@@ -864,6 +870,7 @@ CIntCloneProcNsReq::CIntCloneProcNsReq( bool backup
     creationTime_.tv_nsec = creationTime.tv_nsec;
 
     int stringDataLen = nameLen_ + portLen_+ infileLen_ + outfileLen_
+                      + pathLen_ + ldpathLen_ + programLen_
                       + argvLen_;
     stringData_ = new char [stringDataLen];
     memcpy ( stringData_, stringData, stringDataLen );
@@ -948,9 +955,9 @@ void CIntCloneProcNsReq::performRequest()
     {
         // This is a new clone process that needs to be created 
         // mirroring another node
-        CNode * node = Nodes->GetLNode (nid_)->GetNode();
+        CNode * node = Nodes->GetLNode(nid_)->GetNode();
         CProcess * process;
-        process = node->CloneProcess (nid_,
+        process = node->CloneProcess( nid_,
                             type_,
                             priority_,
                             backup_,
@@ -964,18 +971,27 @@ void CIntCloneProcNsReq::performRequest()
                             parentVerifier_,
                             eventMessages_,
                             systemMessages_,
-                            pathStrId_,
-                            ldpathStrId_,
-                            programStrId_,
+//                            pathStrId_,
+//                            ldpathStrId_,
+//                            programStrId_,
+                            &stringData_[nameLen_ + portLen_ + infileLen_ + outfileLen_],  // path
+                            &stringData_[nameLen_ + portLen_ + infileLen_ + outfileLen_ + pathLen_],  // ldpath
+                            &stringData_[nameLen_ + portLen_ + infileLen_ + outfileLen_ + pathLen_ + ldpathLen_],  // program
                             &stringData_[nameLen_ + portLen_],  // infile
                             &stringData_[nameLen_ + portLen_ + infileLen_], // outfile
                             &creationTime_,
                             origPNidNs_);
         if ( process )
         {
-            process->userArgs ( argc_, argvLen_,
-                                &stringData_[nameLen_ + portLen_
-                                             +infileLen_ + outfileLen_] );
+            process->userArgs( argc_
+                             , argvLen_
+                             , &stringData_[ nameLen_ 
+                                          + portLen_
+                                          + infileLen_ 
+                                          + outfileLen_
+                                          + pathLen_ 
+                                          + ldpathLen_
+                                          + programLen_] );
         }
     }
 
@@ -1449,11 +1465,8 @@ void CIntKillReq::performRequest()
 }
 #endif
 
+#ifndef NAMESERVER_PROCESS
 CIntNewProcReq::CIntNewProcReq( int nid
-#ifdef NAMESERVER_PROCESS
-                              , int pid
-                              , Verifier_t verifier
-#endif
                               , PROCESSTYPE type
                               , int priority
                               , int backup
@@ -1476,10 +1489,6 @@ CIntNewProcReq::CIntNewProcReq( int nid
                               , const char * stringData )
     : CInternalReq(),
       nid_ ( nid ),
-#ifdef NAMESERVER_PROCESS
-      pid_ ( pid ),
-      verifier_ ( verifier ),
-#endif
       type_( type ),
       priority_( priority ),
       backup_( backup ),
@@ -1565,7 +1574,6 @@ void CIntNewProcReq::performRequest()
                 }
             }
         }
-#ifndef NAMESERVER_PROCESS
         else
         {
             if (NameServerEnabled)
@@ -1581,7 +1589,6 @@ void CIntNewProcReq::performRequest()
                                                    , parentVerifier_ );
             }
         }
-#endif
     }
 
     if (parentProcess || unhooked_ )
@@ -1593,23 +1600,17 @@ void CIntNewProcReq::performRequest()
              lnode->GetState() == State_Shutdown ) )
         {   // Create the CProcess object and store the various
             // process parameters.
-#ifndef NAMESERVER_PROCESS
             // cause strings to be forwarded
             string path;
+            string ldpath;
+            string program;
             Config->strIdToString( pathStrId_, path );
-            Config->strIdToString( ldpathStrId_, path );
-            Config->strIdToString( programStrId_, path );
-#endif
+            Config->strIdToString( ldpathStrId_, ldpath );
+            Config->strIdToString( programStrId_, program );
             CProcess *newProcess ;
             newProcess = lnode->GetNode()->
                 CreateProcess ( parentProcess,
                                 nid_,
-#ifdef NAMESERVER_PROCESS
-                                pid_,
-                                verifier_,
-                                false,
-                                false,
-#endif
                                 type_,
                                 0,
                                 priority_,
@@ -1623,15 +1624,6 @@ void CIntNewProcReq::performRequest()
                                 &stringData_[nameLen_ + infileLen_], // outfile
                                 reqTag_,
                                 result);
-#ifdef NAMESERVER_PROCESS
-            if (  newProcess == NULL )
-            {
-                char buf[MON_STRING_BUF_SIZE];
-                sprintf( buf, "[%s], Can't create process %s (%d,%d:%d)\n"
-                       , method_name, &stringData_[0],nid_, pid_, verifier_ );
-                mon_log_write(MON_INTREQ_NEWPROC_1, SQ_LOG_ERR, buf);
-            }
-#else
             if ( newProcess != NULL )
             {
                 newProcess->userArgs ( argc_, argvLen_,
@@ -1678,7 +1670,6 @@ void CIntNewProcReq::performRequest()
                     Replicator.addItem(repl);
                 }
             }
-#endif
         }
     }
     else if ( parentProcess == NULL )
@@ -1692,6 +1683,180 @@ void CIntNewProcReq::performRequest()
 
     TRACE_EXIT;
 }
+#endif
+
+#ifdef NAMESERVER_PROCESS
+CIntNewProcNsReq::CIntNewProcNsReq( int nid
+                                  , int pid
+                                  , Verifier_t verifier
+                                  , PROCESSTYPE type
+                                  , int priority
+                                  , int backup
+                                  , int parentNid
+                                  , int parentPid
+                                  , Verifier_t parentVerifier
+                                  , int pairParentNid
+                                  , int pairParentPid
+                                  , Verifier_t pairParentVerifier
+                                  , int argc
+                                  , bool unhooked
+                                  , void* reqTag
+                                  , int pathLen
+                                  , int ldpathLen
+                                  , int programLen
+                                  , int nameLen
+                                  , int infileLen
+                                  , int outfileLen
+                                  , int argvLen
+                                  , const char* stringData )
+                : CInternalReq()
+                , nid_( nid )
+                , pid_( pid )
+                , verifier_( verifier )
+                , type_( type )
+                , priority_( priority )
+                , backup_( backup )
+                , parentNid_( parentNid )
+                , parentPid_( parentPid )
+                , parentVerifier_( parentVerifier )
+                , pairParentNid_( pairParentNid )
+                , pairParentPid_( pairParentPid )
+                , pairParentVerifier_( pairParentVerifier )
+                , argc_( argc )
+                , unhooked_( unhooked )
+                , reqTag_( reqTag )
+                , pathLen_( pathLen )
+                , ldpathLen_( ldpathLen )
+                , programLen_( programLen )
+                , nameLen_( nameLen )
+                , infileLen_( infileLen )
+                , outfileLen_( outfileLen )
+                , argvLen_( argvLen )
+{
+    // Add eyecatcher sequence as a debugging aid
+    memcpy(&eyecatcher_, "RqIN", 4);
+
+    int stringDataLen = pathLen_ 
+                      + ldpathLen_
+                      + programLen_
+                      + nameLen_
+                      + infileLen_
+                      + outfileLen_
+                      + argvLen_;
+    stringData_ = new char [stringDataLen];
+    memcpy ( stringData_, stringData, stringDataLen );
+}
+
+CIntNewProcNsReq::~CIntNewProcNsReq( )
+{
+    // Alter eyecatcher sequence as a debugging aid to identify deleted object
+    memcpy(&eyecatcher_, "rQin", 4);
+
+    delete [] stringData_;
+}
+
+void CIntNewProcNsReq::populateRequestString( void )
+{
+    char strBuf[MON_STRING_BUF_SIZE/2];
+    sprintf( strBuf, "IntReq(%s) req #=%ld (name=%s/nid=%d) parent(nid=%d/pid=%d)"
+                   , CReqQueue::intReqType[InternalType_Process]
+                   , getId(),
+                   stringData_,
+                   nid_, parentNid_, parentPid_ );
+    requestString_.assign( strBuf );
+}
+
+void CIntNewProcNsReq::performRequest()
+{
+    const char method_name[] = "CIntNewProcNsReq::performRequest";
+    TRACE_ENTRY;
+
+    CProcess *parentProcess = NULL;
+    int result = 0;
+
+    if (trace_settings & TRACE_SYNC)
+    {
+        trace_printf("%s@%d - processing new process %s (%d, tbd) %s "
+                     "(tag %p)\n", method_name, __LINE__,
+                     stringData_,
+                     nid_, (backup_?" Backup":""), reqTag_);
+    }
+
+    if (parentNid_ == -1)
+    {
+        parentProcess = NULL;
+    }
+    else
+    {
+        parentProcess = Nodes->GetProcess( parentNid_, parentPid_ );
+        if ( parentProcess )
+        {
+            if ( (parentVerifier_ == -1) ||
+                 (parentVerifier_ == parentProcess->GetVerifier()) )
+            {
+                if ( backup_ &&
+                    (parentProcess->GetPairParentNid() == -1 &&
+                     parentProcess->GetPairParentPid() == -1))
+                {
+                    parentProcess->SetPairParentNid( pairParentNid_ );
+                    parentProcess->SetPairParentPid( pairParentPid_ );
+                    parentProcess->SetPairParentVerifier( pairParentVerifier_ );
+                }
+            }
+        }
+    }
+
+    if (parentProcess || unhooked_ )
+    {
+        CProcess *newProcess = NULL;
+        CLNode *lnode = Nodes->GetLNode(nid_);
+
+        if ( lnode &&
+            (lnode->GetState() == State_Up ||
+             lnode->GetState() == State_Shutdown ) )
+        {   // Create the CProcess object and store the various
+            // process parameters.
+            newProcess = lnode->GetNode()->
+                CreateProcess ( parentProcess,
+                                nid_,
+                                pid_,
+                                verifier_,
+                                false,
+                                false,
+                                type_,
+                                0,
+                                priority_,
+                                backup_,
+                                unhooked_,
+                                &stringData_[0], // process name
+                                &stringData_[nameLen_ + infileLen_ + outfileLen_],  // path
+                                &stringData_[nameLen_ + infileLen_ + outfileLen_ + pathLen_],  // ldpath
+                                &stringData_[nameLen_ + infileLen_ + outfileLen_ + pathLen_ + ldpathLen_],  // program
+                                &stringData_[nameLen_],  // infile
+                                &stringData_[nameLen_ + infileLen_], // outfile
+                                reqTag_,
+                                result);
+        }
+        if (  newProcess == NULL )
+        {
+            char buf[MON_STRING_BUF_SIZE];
+            sprintf( buf, "[%s], Can't create process %s (%d,%d:%d)\n"
+                   , method_name, &stringData_[0],nid_, pid_, verifier_ );
+            mon_log_write(MON_INTREQ_NEWPROC_1, SQ_LOG_ERR, buf);
+        }
+    }
+    else if ( parentProcess == NULL )
+    {
+        char buf[MON_STRING_BUF_SIZE];
+        sprintf(buf, "[%s], Can't find parent process nid=%d, pid=%d "
+                "for process create.\n", method_name,
+                parentNid_, parentPid_ );
+        mon_log_write(MON_INTREQ_NEWPROC_3, SQ_LOG_ERR, buf);
+    }
+
+    TRACE_EXIT;
+}
+#endif
 
 #ifndef NAMESERVER_PROCESS
 CIntNotifyReq::CIntNotifyReq( struct notify_def *notifyDef ) 
@@ -4378,17 +4543,75 @@ void CReqQueue::enqueueReq(CExternalReq::reqQueueMsg_t msgType,
     TRACE_EXIT;
 }
 
+#ifndef NAMESERVER_PROCESS
 void CReqQueue::enqueueCloneReq ( struct clone_def *cloneDef )
 {
     CInternalReq * request;
 
-#ifndef NAMESERVER_PROCESS
-    request = new CIntCloneProcReq ( cloneDef->backup, cloneDef->unhooked, cloneDef->event_messages, cloneDef->system_messages, cloneDef->nid, cloneDef->type, cloneDef->priority, cloneDef->parent_nid, cloneDef->parent_pid, cloneDef->parent_verifier, cloneDef->os_pid, cloneDef->verifier, cloneDef->prior_pid, cloneDef->persistent_retries, cloneDef->argc, cloneDef->creation_time, cloneDef->pathStrId, cloneDef->ldpathStrId, cloneDef->programStrId, cloneDef->nameLen, cloneDef->portLen, cloneDef->infileLen, cloneDef->outfileLen, cloneDef->argvLen, &cloneDef->stringData, cloneDef->origPNidNs);
-#else
-    request = new CIntCloneProcNsReq ( cloneDef->backup, cloneDef->unhooked, cloneDef->event_messages, cloneDef->system_messages, cloneDef->nid, cloneDef->type, cloneDef->priority, cloneDef->parent_nid, cloneDef->parent_pid, cloneDef->parent_verifier, cloneDef->os_pid, cloneDef->verifier, cloneDef->prior_pid, cloneDef->persistent_retries, cloneDef->argc, cloneDef->creation_time, cloneDef->pathStrId, cloneDef->ldpathStrId, cloneDef->programStrId, cloneDef->nameLen, cloneDef->portLen, cloneDef->infileLen, cloneDef->outfileLen, cloneDef->argvLen, &cloneDef->stringData, cloneDef->origPNidNs);
+    request = new CIntCloneProcReq( cloneDef->backup
+                                  , cloneDef->unhooked
+                                  , cloneDef->event_messages
+                                  , cloneDef->system_messages
+                                  , cloneDef->nid
+                                  , cloneDef->type
+                                  , cloneDef->priority
+                                  , cloneDef->parent_nid
+                                  , cloneDef->parent_pid
+                                  , cloneDef->parent_verifier
+                                  , cloneDef->os_pid
+                                  , cloneDef->verifier
+                                  , cloneDef->prior_pid
+                                  , cloneDef->persistent_retries
+                                  , cloneDef->argc
+                                  , cloneDef->creation_time
+                                  , cloneDef->pathStrId
+                                  , cloneDef->ldpathStrId
+                                  , cloneDef->programStrId
+                                  , cloneDef->nameLen
+                                  , cloneDef->portLen
+                                  , cloneDef->infileLen
+                                  , cloneDef->outfileLen
+                                  , cloneDef->argvLen
+                                  , &cloneDef->stringData
+                                  , cloneDef->origPNidNs);
+    enqueueReq ( request );
+}
 #endif
+
+#ifdef NAMESERVER_PROCESS
+void CReqQueue::enqueueCloneReq ( struct clone_def *cloneDef )
+{
+    CInternalReq * request;
+
+    request = new CIntCloneProcNsReq( cloneDef->backup
+                                    , cloneDef->unhooked
+                                    , cloneDef->event_messages
+                                    , cloneDef->system_messages
+                                    , cloneDef->nid
+                                    , cloneDef->type
+                                    , cloneDef->priority
+                                    , cloneDef->parent_nid
+                                    , cloneDef->parent_pid
+                                    , cloneDef->parent_verifier
+                                    , cloneDef->os_pid
+                                    , cloneDef->verifier
+                                    , cloneDef->prior_pid
+                                    , cloneDef->persistent_retries
+                                    , cloneDef->argc
+                                    , cloneDef->creation_time
+                                    , cloneDef->pathLen
+                                    , cloneDef->ldpathLen
+                                    , cloneDef->programLen
+                                    , cloneDef->nameLen
+                                    , cloneDef->portLen
+                                    , cloneDef->infileLen
+                                    , cloneDef->outfileLen
+                                    , cloneDef->argvLen
+                                    , &cloneDef->stringData
+                                    , cloneDef->origPNidNs);
     enqueueReq ( request );
 }
+#endif
 
 void CReqQueue::enqueueActivateSpareReq (CNode *spareNode, CNode *downNode, bool checkHealth )
 {
@@ -4645,15 +4868,12 @@ void CReqQueue::enqueueKillReq( struct kill_def *killDef )
 }
 #endif
 
+#ifndef NAMESERVER_PROCESS
 void CReqQueue::enqueueNewProcReq( struct process_def *procDef )
 {
     CIntNewProcReq * request;
 
     request = new CIntNewProcReq( procDef->nid
-#ifdef NAMESERVER_PROCESS
-                                , procDef->pid
-                                , procDef->verifier
-#endif
                                 , procDef->type
                                 , procDef->priority
                                 , procDef->backup
@@ -4677,7 +4897,40 @@ void CReqQueue::enqueueNewProcReq( struct process_def *procDef )
 
     enqueueReq ( request );
 }
+#endif
 
+#ifdef NAMESERVER_PROCESS
+void CReqQueue::enqueueNewProcNsReq( struct process_def *procDef )
+{
+    CIntNewProcNsReq* request;
+
+    request = new CIntNewProcNsReq( procDef->nid
+                                , procDef->pid
+                                , procDef->verifier
+                                , procDef->type
+                                , procDef->priority
+                                , procDef->backup
+                                , procDef->parent_nid
+                                , procDef->parent_pid
+                                , procDef->parent_verifier
+                                , procDef->pair_parent_nid
+                                , procDef->pair_parent_pid
+                                , procDef->pair_parent_verifier
+                                , procDef->argc
+                                , procDef->unhooked
+                                , procDef->tag
+                                , procDef->pathLen
+                                , procDef->ldpathLen
+                                , procDef->programLen
+                                , procDef->nameLen
+                                , procDef->infileLen
+                                , procDef->outfileLen
+                                , procDef->argvLen
+                                , &procDef->stringData );
+
+    enqueueReq ( request );
+}
+#endif
 
 #ifndef NAMESERVER_PROCESS
 void CReqQueue::enqueueNotifyReq( struct notify_def *notifyDef )

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1f7eabb0/core/sqf/monitor/linux/reqqueue.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqqueue.h b/core/sqf/monitor/linux/reqqueue.h
index 34cde08..2f6f030 100644
--- a/core/sqf/monitor/linux/reqqueue.h
+++ b/core/sqf/monitor/linux/reqqueue.h
@@ -873,7 +873,33 @@ private:
 class CIntCloneProcNsReq: public CInternalReq
 {
 public:
-    CIntCloneProcNsReq( bool backup, bool unhooked, bool eventMessages, bool systemMessages, int nid, PROCESSTYPE type, int priority, int parentNid, int parentPid, int parentVerifier, int osPid, int verifier, pid_t priorPid, int persistentRetries, int  argc, struct timespec creationTime, strId_t pathStrId, strId_t ldpathStrId, strId_t programStrId, int nameLen, int portLen, int infileLen, int outfileLen, int argvLen, const char * stringData, int origPNidNs);
+    CIntCloneProcNsReq( bool backup
+                      , bool unhooked
+                      , bool eventMessages
+                      , bool systemMessages
+                      , int nid
+                      , PROCESSTYPE type
+                      , int priority
+                      , int parentNid
+                      , int parentPid
+                      , int parentVerifier
+                      , int osPid
+                      , int verifier
+                      , pid_t priorPid
+                      , int persistentRetries
+                      , int argc
+                      , struct timespec creationTime
+                      , int pathLen
+                      , int ldpathLen
+                      , int programLen
+                      , int nameLen
+                      , int portLen
+                      , int infileLen
+                      , int outfileLen
+                      , int argvLen
+                      , const char * stringData
+                      , int origPNidNs);
+//    CIntCloneProcNsReq( bool backup, bool unhooked, bool eventMessages, bool systemMessages, int nid, PROCESSTYPE type, int priority, int parentNid, int parentPid, int parentVerifier, int osPid, int verifier, pid_t priorPid, int persistentRetries, int  argc, struct timespec creationTime, strId_t pathStrId, strId_t ldpathStrId, strId_t programStrId, int nameLen, int portLen, int infileLen, int outfileLen, int argvLen, const char * stringData, int origPNidNs);
     virtual ~CIntCloneProcNsReq();
 
     void performRequest();
@@ -897,9 +923,12 @@ private:
     int persistentRetries_;
     int  argc_;
     struct timespec creationTime_;
-    strId_t pathStrId_;
-    strId_t ldpathStrId_;
-    strId_t programStrId_;
+    int  pathLen_;
+    int  ldpathLen_;
+    int  programLen_;
+//    strId_t pathStrId_;
+//    strId_t ldpathStrId_;
+//    strId_t programStrId_;
     int  nameLen_;
     int  portLen_;
     int  infileLen_;
@@ -1027,15 +1056,11 @@ private:
 };
 #endif
 
+#ifndef NAMESERVER_PROCESS
 class CIntNewProcReq: public CInternalReq
 {
 public:
     CIntNewProcReq( int nid
-#ifndef NAMESERVER_PROCESS
-#else
-                  , int pid
-                  , Verifier_t verifier
-#endif
                   , PROCESSTYPE type
                   , int priority
                   , int backup
@@ -1055,8 +1080,7 @@ public:
                   , int infileLen
                   , int outfileLen
                   , int argvLen
-                  , const char * stringData );
-
+                  , const char* stringData );
     virtual ~CIntNewProcReq ( );
 
     void performRequest();
@@ -1065,10 +1089,6 @@ private:
     void populateRequestString( void );
 
     int nid_;
-#ifdef NAMESERVER_PROCESS
-    int pid_;
-    Verifier_t verifier_;
-#endif
     PROCESSTYPE type_;
     int priority_;
     int backup_;
@@ -1078,18 +1098,79 @@ private:
     int pairParentNid_;
     int pairParentPid_;
     Verifier_t pairParentVerifier_;
-    int  argc_;
+    int argc_;
     bool unhooked_;
     void *reqTag_;
     strId_t pathStrId_;
     strId_t ldpathStrId_;
     strId_t programStrId_;
-    int  nameLen_;
-    int  infileLen_;
-    int  outfileLen_;
-    int  argvLen_;
-    char * stringData_;
+    int nameLen_;
+    int infileLen_;
+    int outfileLen_;
+    int argvLen_;
+    char* stringData_;
 };
+#endif
+
+#ifdef NAMESERVER_PROCESS
+class CIntNewProcNsReq: public CInternalReq
+{
+public:
+    CIntNewProcNsReq( int nid
+                    , int pid
+                    , Verifier_t verifier
+                    , PROCESSTYPE type
+                    , int priority
+                    , int backup
+                    , int parentNid
+                    , int parentPid
+                    , Verifier_t parentVerifier
+                    , int pairParentNid
+                    , int pairParentPid
+                    , Verifier_t pairParentVerifier
+                    , int argc
+                    , bool unhooked
+                    , void* reqTag
+                    , int pathLen
+                    , int ldpathLen
+                    , int programLen
+                    , int nameLen
+                    , int infileLen
+                    , int outfileLen
+                    , int argvLen
+                    , const char* stringData );
+    virtual ~CIntNewProcNsReq ( );
+
+    void performRequest();
+
+private:
+    void populateRequestString( void );
+
+    int nid_;
+    int pid_;
+    Verifier_t verifier_;
+    PROCESSTYPE type_;
+    int priority_;
+    int backup_;
+    int parentNid_;
+    int parentPid_;
+    Verifier_t parentVerifier_;
+    int pairParentNid_;
+    int pairParentPid_;
+    Verifier_t pairParentVerifier_;
+    int argc_;
+    bool unhooked_;
+    void *reqTag_;
+    int pathLen_;
+    int ldpathLen_;
+    int programLen_;
+    int nameLen_;
+    int infileLen_;
+    int outfileLen_;
+    int argvLen_;
+    char* stringData_;
+};
+#endif
 
 class CIntNotifyReq: public CInternalReq
 {
@@ -1550,8 +1631,11 @@ class CReqQueue
 #ifndef NAMESERVER_PROCESS
     void enqueueIoDataReq( ioData_t *ioData );
     void enqueueKillReq( struct kill_def *killDef );
-#endif
     void enqueueNewProcReq( struct process_def *procDef );
+#endif
+#ifdef NAMESERVER_PROCESS
+    void enqueueNewProcNsReq( struct process_def *procDef );
+#endif
 #ifndef NAMESERVER_PROCESS
     void enqueueNotifyReq( struct notify_def *notifyDef );
     void enqueueOpenReq( struct open_def *openDef );

http://git-wip-us.apache.org/repos/asf/trafodion/blob/1f7eabb0/core/sqf/monitor/linux/zclient.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/zclient.cxx b/core/sqf/monitor/linux/zclient.cxx
index d2cd0be..f9bd698 100644
--- a/core/sqf/monitor/linux/zclient.cxx
+++ b/core/sqf/monitor/linux/zclient.cxx
@@ -70,7 +70,6 @@ extern CNodeContainer *Nodes;
 extern CReqQueue ReqQueue;
 extern CZClient    *ZClient;
 extern CMonLog     *MonLog;
-
 extern bool debugFlag;
 
 static zhandle_t *ZHandle;
@@ -1648,6 +1647,7 @@ void CZClient::TriggerCheck( int type, const char *znodePath )
 {
     const char method_name[] = "CZClient::TriggerCheck";
     TRACE_ENTRY;
+
     if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
     {
         trace_printf( "%s@%d" " - state = %s\n"
@@ -1702,6 +1702,7 @@ void CZClient::TriggerCheck( int type, const char *znodePath )
     {
         SetState( ZC_CLUSTER );
     }
+
     CLock::wakeOne();
     TRACE_EXIT;
 }
@@ -1884,7 +1885,7 @@ int CZClient::WatchNodeMasterDelete( const char *nodeName )
             << nodeName;
            
     string monZnode = newpath.str( );
-    
+
     if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
     {
         trace_printf( "%s@%d zoo_delete(%s)\n"


[03/50] [abbrv] trafodion git commit: Preliminary monitor p-2-p communication changes.

Posted by su...@apache.org.
http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/src/trafconf/trafconf.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/trafconf/trafconf.cpp b/core/sqf/src/trafconf/trafconf.cpp
index 9c9e52e..35994cd 100644
--- a/core/sqf/src/trafconf/trafconf.cpp
+++ b/core/sqf/src/trafconf/trafconf.cpp
@@ -47,15 +47,21 @@ using namespace std;
 
 typedef enum {
     TrafConfType_Undefined=0,         // Invalid
-    TrafConfType_NodeName,            // Display node names
-    TrafConfType_NodeName_w,          // Display node names
+    TrafConfType_NodeName,            // Display node names: -name -short
+    TrafConfType_NodeName_w,          // Display node names: -wname -wshort
     TrafConfType_NodeId,              // Display node ids
     TrafConfType_PhysicalNodeId,      // Display physical node ids
     TrafConfType_ZoneId,              // Display zone ids
     // the above displays values as: "<value-1>  <value-2> ..."
+
     TrafConfType_NodeConfig,          // Display all nodes configuration attributes
     // node-id=0;node-name=n7;cores=0-1;processors=2;roles=connection,aggregation,storage
 
+    TrafConfType_NodeMax,             // # maximim number of nodes names allowed: -node-max   --node-max
+    TrafConfType_NodeIdCount,         // # configured <nid>s:        -nid-count   --nid-count
+    TrafConfType_PhysicalNodeIdCount, // # configured <pnid>s:       -pnid-count  --pnid-count
+    TrafConfType_SparesCount,         // # configured <spare-pnid>s: -spare-count --spare-count
+
     TrafConfType_PersistConfig,       // Display all persist configuration keys and attributes
 
     TrafConfType_PersistConfigKeys,   // Display persist configuration keys
@@ -77,6 +83,10 @@ bool DisplayBeginEnd = false;   // Valid only with:
                                 //   TrafConfType_NodeConfig
                                 //   TrafConfType_PersistConfig
                                 //   TrafConfType_NameServerConfig
+bool DisplayLabel = false;      // Valid only with:
+                                //   TrafConfType_NodeIdCount
+                                //   TrafConfType_PhysicalNodeIdCount
+                                //   TrafConfType_SparesCount
 bool DisplayShortHost = false;  // Valid only with:
                                 //   TrafConfType_NodeName
                                 //   TrafConfType_NodeName_w
@@ -130,22 +140,39 @@ int TcLogWrite(int pv_event_type, posix_sqlog_severity_t pv_severity, char *pp_s
 void DisplayUsage( void )
 {
     fprintf( stderr, 
-"\nUsage: trafconf { -? | -h | -name | -nameshort | -wname | -wnameshort | -node |  -persist }\n"
+"\nUsage: trafconf { -? | -h | -name | -short | -wname | -wshort | \\\n"
+"                  -nameserver | -ns | -node | -persist | \\\n"
+"                  -node-max | -nid-count | -pnid-count | -spares-count | \\\n"
+"                  --nameserver | --ns | --node | --persist | \\\n"
+"                  --node-max | --nid-count | --pnid-count | --spares-count  }\n"
 "\n   Where:\n"
-"          -?           Displays usage.\n"
-"          -h           Displays usage.\n"
-"          -name        Displays all node names in configuration.\n"
+"     -?                Displays usage.\n"
+"     -h                Displays usage.\n\n"
+
+"     -name             Displays all node names in configuration.\n"
 "                        - Name is as stored in configuration, which could be in short host name or FQDN form.\n"
-"          -short       Displays all node names in configuration in short host name form.\n"
-"          -wname       Displays all node names in configuration prefixed with '-w'\n"
+"     -short            Displays all node names in configuration in short host name form.\n"
+"     -wname            Displays all node names in configuration prefixed with '-w'\n"
 "                        - Name is as stored in configuration, which could be in short host name or FQDN form.\n"
-"          -wshort      Displays all node names in configuration short host name form prefixed with '-w'.\n"
-"          -node        Displays node configuration (without begin/end brackets).\n"
-"          -persist     Displays persist configuration (without begin/end brackets).\n\n"
-"          --node       Displays node configuration (with begin/end brackets).\n"
-"          --persist    Displays persist configuration (with begin/end brackets).\n\n"
-"          -nameserver  Displays nameserver configuration (without begin/end brackets).\n"
-"          --nameserver Displays nameserver configuration (with begin/end brackets).\n"
+"     -wshort           Displays all node names in configuration short host name form prefixed with '-w'.\n\n"
+
+"     -nameserver -ns   Displays nameserver configuration (without begin/end brackets).\n"
+"     -node             Displays node configuration (without begin/end brackets).\n"
+"     -persist          Displays persist configuration (without begin/end brackets).\n\n"
+
+"     -node-max         Displays maximum number of node allowed in configuration.\n"
+"     -nid-count        Displays count of node-id(s) in the configuration.\n"
+"     -pnid-count       Displays count of physical-node-id(s) in the configuration.\n"
+"     -spares-count     Displays count of spare physical-node-id(s) in the configuration.\n\n"
+
+"     --nameserver --ns Displays nameserver configuration (with begin/end brackets).\n"
+"     --node            Displays node configuration (with begin/end brackets).\n"
+"     --persist         Displays persist configuration (with begin/end brackets).\n\n"   
+
+"     --node-max        Displays maximum number of node allowed in configuration (prefixed with 'Maximum Nodes:').\n"
+"     --nid-count       Displays count of node-id(s) in the configuration (prefixed with 'Node Ids:').\n"
+"     --pnid-count      Displays count of physical-node-id(s) in the configuration (prefixed with 'Physical Node Ids:').\n"
+"     --spares-count    Displays count of spare physical-node-id(s) in the configuration (prefixed with 'Spare Node Ids:').\n\n"
            );
 }
 
@@ -299,11 +326,11 @@ int DisplayNameServerConfig( void )
 
     if ( DisplayBeginEnd && TrafConfType == TrafConfType_NameServerConfig )
     {
-        printf( "\nEND name-server\n" );
+        printf( "\n\nEND name-server\n" );
     }
     else if ( TrafConfType == TrafConfType_NameServerConfig )
     {
-        printf( "\n" );
+        printf( "\n\n" );
     }
 
     return(rc);
@@ -375,6 +402,55 @@ int DisplayNodeConfig( char *nodeName )
 
 ///////////////////////////////////////////////////////////////////////////////
 //
+// Function/Method: DisplayConfigCounts()
+//
+///////////////////////////////////////////////////////////////////////////////
+int DisplayConfigCounts( void )
+{
+    int rc   = -1;
+
+    switch (TrafConfType)
+    {
+        case TrafConfType_NodeMax:
+            if ( DisplayLabel )
+            {
+                printf( "Maximum Nodes: " );
+            }
+            printf("%d", ClusterConfig.GetPNodesConfigMax() );
+            break;
+        case TrafConfType_NodeIdCount:
+            if ( DisplayLabel )
+            {
+                printf( "Node Ids: " );
+            }
+            printf("%d", ClusterConfig.GetLNodesCount() );
+            break;
+        case TrafConfType_PhysicalNodeIdCount:
+            if ( DisplayLabel )
+            {
+                printf( "Physical Node Ids: " );
+            }
+            printf("%d", ClusterConfig.GetPNodesCount() );
+            break;
+        case TrafConfType_SparesCount:
+            if ( DisplayLabel )
+            {
+                printf( "Spare Node Ids: " );
+            }
+            printf("%d", ClusterConfig.GetSNodesCount() );
+            break;
+        default:
+            printf( "Invalid configuration type!\n" );
+    }
+    if ( DisplayLabel )
+    {
+        printf( "\n" );
+    }
+    return(rc);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+//
 // Function/Method: DisplayPersistKeys()
 //
 ///////////////////////////////////////////////////////////////////////////////
@@ -564,6 +640,12 @@ int ProcessTrafConfig( void )
         case TrafConfType_NodeName_w:
             rc = DisplayNodeConfig( NodeName );
             break;
+        case TrafConfType_NodeMax:
+        case TrafConfType_NodeIdCount:
+        case TrafConfType_PhysicalNodeIdCount:
+        case TrafConfType_SparesCount:
+            rc = DisplayConfigCounts();
+            break;
         case TrafConfType_PersistConfig:
         case TrafConfType_PersistConfigKeys:
         case TrafConfType_PersistConfigKey:
@@ -643,6 +725,22 @@ int main( int argc, char *argv[] )
         {
             TrafConfType = TrafConfType_NodeConfig;
         }
+        else if ( strcasecmp( argv [argx], "-node-max" ) == 0 )
+        {
+            TrafConfType = TrafConfType_NodeMax;
+        }
+        else if ( strcasecmp( argv [argx], "-nid-count" ) == 0 )
+        {
+            TrafConfType = TrafConfType_NodeIdCount;
+        }
+        else if ( strcasecmp( argv [argx], "-pnid-count" ) == 0 )
+        {
+            TrafConfType = TrafConfType_PhysicalNodeIdCount;
+        }
+        else if ( strcasecmp( argv [argx], "-spares-count" ) == 0 )
+        {
+            TrafConfType = TrafConfType_SparesCount;
+        }
         else if ( strcasecmp( argv [argx], "-persist" ) == 0 )
         {
             TrafConfType = TrafConfType_PersistConfig;
@@ -657,6 +755,26 @@ int main( int argc, char *argv[] )
             DisplayBeginEnd = true;
             TrafConfType = TrafConfType_PersistConfig;
         }
+        else if ( strcasecmp( argv [argx], "--node-max" ) == 0 )
+        {
+            TrafConfType = TrafConfType_NodeMax;
+            DisplayLabel = true;
+        }
+        else if ( strcasecmp( argv [argx], "--nid-count" ) == 0 )
+        {
+            DisplayLabel = true;
+            TrafConfType = TrafConfType_NodeIdCount;
+        }
+        else if ( strcasecmp( argv [argx], "--pnid-count" ) == 0 )
+        {
+            DisplayLabel = true;
+            TrafConfType = TrafConfType_PhysicalNodeIdCount;
+        }
+        else if ( strcasecmp( argv [argx], "--spares-count" ) == 0 )
+        {
+            DisplayLabel = true;
+            TrafConfType = TrafConfType_SparesCount;
+        }
         else
         {
             DisplayUsage();

http://git-wip-us.apache.org/repos/asf/trafodion/blob/abf3c429/core/sqf/src/trafconf/trafconfig.h
----------------------------------------------------------------------
diff --git a/core/sqf/src/trafconf/trafconfig.h b/core/sqf/src/trafconf/trafconfig.h
deleted file mode 100644
index e69de29..0000000


[09/50] [abbrv] trafodion git commit: Enabled Name Server in monitor tests.

Posted by su...@apache.org.
Enabled Name Server in monitor tests.


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

Branch: refs/heads/master
Commit: 38eb84e69cb402746488b793d258b5bb798acd8d
Parents: f3daa45
Author: Zalo Correa <za...@esgyn.com>
Authored: Wed Mar 28 19:33:33 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Wed Mar 28 19:33:33 2018 -0700

----------------------------------------------------------------------
 core/sqf/monitor/linux/monitor.cxx |  5 +++--
 core/sqf/monitor/test/monitor.env  | 16 ++++++++--------
 core/sqf/monitor/test/runtest      | 28 ++++++++++++++++++++++++++++
 3 files changed, 39 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/38eb84e6/core/sqf/monitor/linux/monitor.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/monitor.cxx b/core/sqf/monitor/linux/monitor.cxx
index 4c67b15..77d7509 100755
--- a/core/sqf/monitor/linux/monitor.cxx
+++ b/core/sqf/monitor/linux/monitor.cxx
@@ -1622,12 +1622,13 @@ int main (int argc, char *argv[])
                 , CALL_COMP_GETVERS2(trafns), CommTypeString( CommType ));
 #else
     snprintf(buf, sizeof(buf),
-                 "[CMonitor::main], %s, Started! CommType: %s (%s%s%s)\n"
+                 "[CMonitor::main], %s, Started! CommType: %s (%s%s%s%s)\n"
                 , CALL_COMP_GETVERS2(monitor)
                 , CommTypeString( CommType )
                 , IsRealCluster?"RealCluster":"VirtualCluster"
                 , IsAgentMode?"/AgentMode":""
-                , IsMPIChild?"/MPIChild":"" );
+                , IsMPIChild?"/MPIChild":""
+                , NameServerEnabled?"/NameServerEnabled":"" );
 #endif
     mon_log_write(MON_MONITOR_MAIN_3, SQ_LOG_INFO, buf);
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/38eb84e6/core/sqf/monitor/test/monitor.env
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/test/monitor.env b/core/sqf/monitor/test/monitor.env
index bc50bfc..b8cf913 100644
--- a/core/sqf/monitor/test/monitor.env
+++ b/core/sqf/monitor/test/monitor.env
@@ -25,18 +25,18 @@
 #
 # Uncomment the next three environment variables
 #export SQ_MON_RUN_MODE=AGENT
-#export MONITOR_COMM_PORT=23390
-#export MONITOR_SYNC_PORT=23380
+MONITOR_COMM_PORT=23390
+MONITOR_SYNC_PORT=23380
 #
 #   NAME-SERVER - to disable process replication and enable name-server
 #
 # Uncomment the next six environment variables
-#export SQ_NAMESERVER_ENABLE=1
-#export NS_COMM_PORT=23370
-#export NS_SYNC_PORT=23360
-#export NS_M2N_COMM_PORT=23350
-#export MON2MON_COMM_PORT=23340
-#export MONITOR_COMM_PORT=23330
+SQ_NAMESERVER_ENABLE=1
+NS_COMM_PORT=23370
+NS_SYNC_PORT=23360
+NS_M2N_COMM_PORT=23350
+MON2MON_COMM_PORT=23340
+MONITOR_COMM_PORT=23330
 
 # Uncomment MON_TRACE_ENABLE and specific tracing level to enable 
 # Trafodion monitor process tracing

http://git-wip-us.apache.org/repos/asf/trafodion/blob/38eb84e6/core/sqf/monitor/test/runtest
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/test/runtest b/core/sqf/monitor/test/runtest
index a31e7a0..20c06a9 100755
--- a/core/sqf/monitor/test/runtest
+++ b/core/sqf/monitor/test/runtest
@@ -174,6 +174,8 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
+shell -c ps 
+shell -c ps monitor
 shell -a<<eof
  shutdown
  exit
@@ -213,6 +215,8 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
+shell -c ps 
+shell -c ps monitor
 shell -a<<eof
  shutdown
  exit
@@ -244,6 +248,8 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
+shell -c ps 
+shell -c ps monitor
 shell -a<<eof
  shutdown
  exit
@@ -286,6 +292,8 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
+shell -c ps 
+shell -c ps monitor
 shell -a<<eof
  shutdown
  exit
@@ -321,6 +329,8 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
+shell -c ps 
+shell -c ps monitor
 shell -a<<eof
  shutdown
  exit
@@ -345,6 +355,8 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
+shell -c ps 
+shell -c ps monitor
 shell -a<<eof
  shutdown
  exit
@@ -375,6 +387,8 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
+shell -c ps 
+shell -c ps monitor
 shell -a<<eof
  shutdown
  exit
@@ -411,6 +425,8 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
+shell -c ps 
+shell -c ps monitor
 shell -a<<eof
  shutdown
  exit
@@ -442,6 +458,8 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
+shell -c ps 
+shell -c ps monitor
 shell -a<<eof
  shutdown
  exit
@@ -475,6 +493,8 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
+shell -c ps 
+shell -c ps monitor
 shell -a<<eof
  shutdown
  exit
@@ -510,6 +530,8 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
+shell -c ps 
+shell -c ps monitor
 shell -a<<eof
  shutdown
  exit
@@ -534,6 +556,8 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
+shell -c ps 
+shell -c ps monitor
 shell -a<<eof
  shutdown
  exit
@@ -560,6 +584,8 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
+shell -c ps 
+shell -c ps monitor
 shell -a<<eof
  shutdown
  exit
@@ -585,6 +611,8 @@ shell <<eof
  exit
 eof
 if ( [ $test '==' -1 ] ); then
+shell -c ps 
+shell -c ps monitor
 shell -a<<eof
  shutdown
  exit


[44/50] [abbrv] trafodion git commit: Removed invocation of non-existent startup scripts.

Posted by su...@apache.org.
Removed invocation of non-existent startup scripts.


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

Branch: refs/heads/master
Commit: 1b228a9104fef92512140959681d3a5c241fca67
Parents: c870630
Author: Zalo Correa <za...@esgyn.com>
Authored: Mon Jun 4 10:45:56 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Mon Jun 4 10:45:56 2018 -0700

----------------------------------------------------------------------
 core/sqf/sql/scripts/gomon.cold | 16 ----------------
 1 file changed, 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/1b228a91/core/sqf/sql/scripts/gomon.cold
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/gomon.cold b/core/sqf/sql/scripts/gomon.cold
index 28807fd..6055490 100755
--- a/core/sqf/sql/scripts/gomon.cold
+++ b/core/sqf/sql/scripts/gomon.cold
@@ -117,22 +117,6 @@ fi
 idtmstart
 sqshell -c delay 1
 
-if [[ $TRAF_AGENT != "CM" ]]
-then
-  echo  "***"
-  echo  "***" `date`  " - Starting Cluster Monitor"
-  echo  "***"
-
-  cmonstart
-  sqshell -c delay 1
-fi
-
-echo  "***"
-echo  "***" `date`  " - Starting Node Monitors"
-echo  "***"
-
-nmonstart
-
 echo  "***"
 echo  "***" `date`  " - Starting Distributed Transaction Manager (DTM)"
 echo  "***"


[15/50] [abbrv] trafodion git commit: Update.

Posted by su...@apache.org.
Update.


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

Branch: refs/heads/master
Commit: 9467a473730c823540842bb533f85f1653769d4a
Parents: 5d97082
Author: Dave George <de...@gmail.com>
Authored: Wed Apr 4 14:13:15 2018 +0000
Committer: Dave George <de...@gmail.com>
Committed: Wed Apr 4 14:13:15 2018 +0000

----------------------------------------------------------------------
 core/sqf/monitor/linux/monitor.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/9467a473/core/sqf/monitor/linux/monitor.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/monitor.cxx b/core/sqf/monitor/linux/monitor.cxx
index e6aa68b..d97a3f0 100755
--- a/core/sqf/monitor/linux/monitor.cxx
+++ b/core/sqf/monitor/linux/monitor.cxx
@@ -1193,7 +1193,7 @@ int main (int argc, char *argv[])
     }
 
 #ifndef NAMESERVER_PROCESS
-    env = getenv("SQ_NAMESERVER_ENABLE");
+    env = getenv("SQ_NAMESERVER_ENABLED");
     if ( env && isdigit(*env) )
     {
         NameServerEnabled = atoi(env);


[41/50] [abbrv] trafodion git commit: More Name Server enabled process management fixes.

Posted by su...@apache.org.
More Name Server enabled process management fixes.


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

Branch: refs/heads/master
Commit: 65ac55633c34dc8ee12de5da4c6fbc91cd6b9093
Parents: 8e4f2c7
Author: Zalo Correa <za...@esgyn.com>
Authored: Fri May 25 14:44:54 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Fri May 25 14:44:54 2018 -0700

----------------------------------------------------------------------
 .../export/include/common/evl_sqlog_eventnum.h  |  34 ++
 core/sqf/monitor/linux/cluster.cxx              |  11 +-
 core/sqf/monitor/linux/notice.cxx               |  13 +-
 core/sqf/monitor/linux/nsreqprocinfons.cxx      |   6 +-
 core/sqf/monitor/linux/pnode.cxx                | 105 +++--
 core/sqf/monitor/linux/pnode.h                  |   2 +-
 core/sqf/monitor/linux/process.cxx              | 406 +++++++++++++++++--
 core/sqf/monitor/linux/process.h                |  11 +
 core/sqf/monitor/linux/reqkill.cxx              |  23 +-
 core/sqf/monitor/linux/reqnewproc.cxx           |  21 +-
 core/sqf/monitor/linux/reqnotify.cxx            |  23 +-
 core/sqf/monitor/linux/reqprocinfo.cxx          |  26 +-
 core/sqf/monitor/linux/reqqueue.cxx             | 117 +++---
 core/sqf/monitor/linux/tmsync.cxx               |  17 +
 14 files changed, 679 insertions(+), 136 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/65ac5563/core/sqf/export/include/common/evl_sqlog_eventnum.h
----------------------------------------------------------------------
diff --git a/core/sqf/export/include/common/evl_sqlog_eventnum.h b/core/sqf/export/include/common/evl_sqlog_eventnum.h
index 1f4d166..de3e60e 100644
--- a/core/sqf/export/include/common/evl_sqlog_eventnum.h
+++ b/core/sqf/export/include/common/evl_sqlog_eventnum.h
@@ -254,6 +254,8 @@
 #define MON_CLUSTER_ASSIGNMONITORLEADER_3   101015303
 #define MON_CLUSTER_ASSIGNMONITORLEADER_4   101015304
 
+#define MON_CLUSTER_CHECKIFDONE_1           101015401
+
 /* Module: monitor.cxx = 02 */
 
 #define MON_MONITOR_MAIN_1                  101020101
@@ -298,6 +300,7 @@
 #define MON_MONITOR_STARTPROCESS_12         101020512
 #define MON_MONITOR_STARTPROCESS_13         101020513
 #define MON_MONITOR_STARTPROCESS_14         101020514
+#define MON_MONITOR_STARTPROCESS_15         101020515
 #define MON_MONITOR_PROCESSINFO             101020601
 #define MON_MONITOR_PROCESSREQUEST_1        101020701
 #define MON_MONITOR_PROCESSREQUEST_2        101020702
@@ -382,6 +385,8 @@
 #define MON_PROCESS_CREATE_9                101031409
 #define MON_PROCESS_CREATE_10               101031410
 #define MON_PROCESS_CREATE_11               101031411
+#define MON_PROCESS_CREATE_12               101031412
+#define MON_PROCESS_CREATE_13               101031413
 #define MON_PROCESS_SETPROCESSSTATE_1       101031501
 #define MON_PROCESS_PIDHANGUPCHECK_1        101031601
 #define MON_PROCESS_PIDHANGUPCHECK_2        101031602
@@ -416,6 +421,14 @@
 #define MON_PROCESSCONT_KILLALLDOWN_1       101032301
 #define MON_PROCESS_SETSTATE_1              101032401
 #define MON_PROCESS_SETSTATE_2              101032402
+#define MON_PROCESS_COMPLETESTARTUP_1       101032501
+#define MON_PROCESS_COMPLETESTARTUP_2       101032502
+#define MON_PROCESS_COMPLETESTARTUP_3       101032503
+#define MON_PROCESSCONT_CHILDEXIT_1         101032601
+#define MON_PROCESS_PROCEXITNOTIFIERNODES_1 101032701
+#define MON_PROCESS_PROCEXIT_1              101032801
+#define MON_PROCESS_PROCEXIT_2              101032802
+#define MON_PROCESS_PROCEXITUNREGALL_1      101032901
 
 /* Module: pnode.cxx = 04 */
 
@@ -450,6 +463,19 @@
 #define MON_NODE_GETPROCESSNS_2             101041502
 #define MON_NODE_GETPROCESSNS_3             101041503
 #define MON_NODE_GETPROCESSNS_4             101041504
+#define MON_NODE_GETPROCESSNS_5             101041505
+#define MON_NODE_GETPROCESSNS_6             101041506
+#define MON_NODE_GETSTRINGID_1              101041601
+#define MON_NODE_GETSTRINGID_2              101041602
+#define MON_NODE_CLONEPROCESSNS_1           101041701
+#define MON_NODE_CLONEPROCESSNS_2           101041702
+#define MON_NODE_CLONEPROCESSNS_3           101041703
+#define MON_NODE_CLONEPROCESSNS_4           101041704
+#define MON_NODE_CLONEPROCESSNS_5           101041705
+#define MON_NODE_CLONEPROCESSNS_6           101041706
+#define MON_NODE_GETPROCESSLBYTYPENS_1      101041801
+#define MON_NODE_GETPROCESSLBYTYPENS_2      101041802
+#define MON_NODE_GETPROCESSLBYTYPENS_3      101041803
 
 /* Module: config.cxx = 05 */
 
@@ -747,6 +773,11 @@
 #define MON_REQ_IODATA_1                    101182201
 #define MON_REQ_STDIN_1                     101182301
 #define MON_REQ_STDIN_2                     101182302
+#define MON_REQ_KILL_1                      101182401
+#define MON_REQ_NOTIFY_1                    101182501
+#define MON_REQ_PROCINFO_1                  101182601
+#define MON_REQ_PROCINFOCONT_1              101182701
+#define MON_INTREQ_CHILDDEATH_1             101182801
 
 /* Module: clio.cxx = 19 */
 #define MON_CLIO_ACQUIRE_MSG_1              101190101
@@ -1048,6 +1079,9 @@
 #define PTP_COMMACCEPT_7                    101940107
 #define PTP_COMMACCEPT_8                    101940108
 
+/* Module notice.cxx = 95 */
+#define NOTICE_NOTIFYREMOTE_1               101950101
+
 /**********************************************/
 
 /*********** Seabed ***********/

http://git-wip-us.apache.org/repos/asf/trafodion/blob/65ac5563/core/sqf/monitor/linux/cluster.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/cluster.cxx b/core/sqf/monitor/linux/cluster.cxx
index 8768d2e..69647ec 100644
--- a/core/sqf/monitor/linux/cluster.cxx
+++ b/core/sqf/monitor/linux/cluster.cxx
@@ -7786,7 +7786,16 @@ bool CCluster::checkIfDone (  )
                                     Nodes->ProcessCount(), MyNode->ProcessCount());
     
                     waitForNameServerExit_ = true;
-                    NameServer->ProcessShutdown();
+                    int rc = NameServer->ProcessShutdown();
+                    if (rc)
+                    {
+                        char la_buf[MON_STRING_BUF_SIZE];
+                        snprintf( la_buf, sizeof(la_buf)
+                                , "[%s] - Shutdown request to Name Server failed, node going down\n"
+                                , method_name );
+                        mon_log_write( MON_CLUSTER_CHECKIFDONE_1, SQ_LOG_ERR, la_buf );
+                        ReqQueue.enqueueDownReq( MyPNID );
+                    }
                 }
             }
             else

http://git-wip-us.apache.org/repos/asf/trafodion/blob/65ac5563/core/sqf/monitor/linux/notice.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/notice.cxx b/core/sqf/monitor/linux/notice.cxx
index f478f45..64778d7 100644
--- a/core/sqf/monitor/linux/notice.cxx
+++ b/core/sqf/monitor/linux/notice.cxx
@@ -421,7 +421,18 @@ void CNotice::NotifyRemote( void )
                                    , targetLNode->GetNode()->GetName() );
         if (rc)
         {
-            // TODO: Error handling
+            char la_buf[MON_STRING_BUF_SIZE];
+            snprintf( la_buf, sizeof(la_buf)
+                    , "[%s] - Can't send process exit "
+                      "for process %s (%d, %d) "
+                      "to target node %s, nid=%d\n"
+                    , method_name
+                    , Process->GetName()
+                    , Process->GetNid()
+                    , Process->GetPid()
+                    , targetLNode->GetNode()->GetName()
+                    , targetLNode->GetNid() );
+            mon_log_write(NOTICE_NOTIFYREMOTE_1, SQ_LOG_ERR, la_buf);
         }
         nidQueue->pop();
     }

http://git-wip-us.apache.org/repos/asf/trafodion/blob/65ac5563/core/sqf/monitor/linux/nsreqprocinfons.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nsreqprocinfons.cxx b/core/sqf/monitor/linux/nsreqprocinfons.cxx
index 562fdb6..aa53437 100644
--- a/core/sqf/monitor/linux/nsreqprocinfons.cxx
+++ b/core/sqf/monitor/linux/nsreqprocinfons.cxx
@@ -59,7 +59,7 @@ CExtProcInfoNsReq::~CExtProcInfoNsReq()
 // Copy information for a specific process into the reply message buffer.
 void CExtProcInfoNsReq::copyInfo(CProcess *process, ProcessInfoNs_reply_def &process_info_ns)
 {
-    const char method_name[] = "CNameServer::SendReceive";
+    const char method_name[] = "CExtProcInfoNsReq::copyInfo";
     TRACE_ENTRY;
 
     CProcess *parent;
@@ -92,8 +92,8 @@ void CExtProcInfoNsReq::copyInfo(CProcess *process, ProcessInfoNs_reply_def &pro
     process_info_ns.unhooked = process->IsUnhooked();
     process_info_ns.event_messages = process->IsEventMessages();
     process_info_ns.system_messages = process->IsSystemMessages();
-    strncpy( process_info_ns.path, process->path(), MAX_PROCESS_PATH );
-    strncpy( process_info_ns.ldpath, process->ldpath(), MAX_PROCESS_PATH );
+    strncpy( process_info_ns.path, process->path(), MAX_SEARCH_PATH );
+    strncpy( process_info_ns.ldpath, process->ldpath(), MAX_SEARCH_PATH );
     strncpy( process_info_ns.program, process->program(), MAX_PROCESS_PATH );
 //    process_info_ns.pathStrId = process->pathStrId();
 //    process_info_ns.ldpathStrId = process->ldPathStrId();

http://git-wip-us.apache.org/repos/asf/trafodion/blob/65ac5563/core/sqf/monitor/linux/pnode.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnode.cxx b/core/sqf/monitor/linux/pnode.cxx
index c044100..73b0246 100644
--- a/core/sqf/monitor/linux/pnode.cxx
+++ b/core/sqf/monitor/linux/pnode.cxx
@@ -1035,7 +1035,7 @@ bool CNode::GetSchedulingData( void )
 }
 
 
-strId_t CNode::GetStringId( char *candidate, CLNode *targetLNode )
+strId_t CNode::GetStringId( char *candidate, CLNode *targetLNode, bool clone )
 {
     const char method_name[] = "CNode::GetStringId";
     strId_t id;
@@ -1059,21 +1059,33 @@ strId_t CNode::GetStringId( char *candidate, CLNode *targetLNode )
 #ifndef NAMESERVER_PROCESS
         if (NameServerEnabled)
         {
-            if (targetLNode != NULL &&
+            if (targetLNode != NULL && !clone &&
                 !MyNode->IsMyNode(targetLNode->GetNid()))
             {
                 // Forward the unique string to the target node
-                PtpClient->AddUniqStr( id.nid
-                                     , id.id
-                                     , candidate
-                                     , targetLNode->GetNid()
-                                     , targetLNode->GetNode()->GetName());
+                int rc = PtpClient->AddUniqStr( id.nid
+                                              , id.id
+                                              , candidate
+                                              , targetLNode->GetNid()
+                                              , targetLNode->GetNode()->GetName() );
+                if (rc)
+                {
+                    char la_buf[MON_STRING_BUF_SIZE];
+                    snprintf( la_buf, sizeof(la_buf)
+                            , "[%s] - Can't send unique string "
+                              "to target node %s, nid=%d\n"
+                            , method_name
+                            , targetLNode->GetNode()->GetName()
+                            , targetLNode->GetNid() );
+                    mon_log_write(MON_NODE_GETSTRINGID_1, SQ_LOG_ERR, la_buf);
+                }
             }
         }
         else
 #endif
         {
 #ifdef NAMESERVER_PROCESS
+            clone = clone;  // Make compiler happy!
             targetLNode = targetLNode;  // Make compiler happy!
 #endif
             CReplUniqStr *repl = new CReplUniqStr ( id.nid, id.id, candidate );
@@ -1092,15 +1104,26 @@ strId_t CNode::GetStringId( char *candidate, CLNode *targetLNode )
 #ifndef NAMESERVER_PROCESS
         if (NameServerEnabled)
         {
-            if (targetLNode != NULL &&
+            if (targetLNode != NULL && !clone &&
                 !MyNode->IsMyNode(targetLNode->GetNid()))
             {
                 // Forward the unique string to the target node
-                PtpClient->AddUniqStr( id.nid
-                                     , id.id
-                                     , candidate
-                                     , targetLNode->GetNid()
-                                     , targetLNode->GetNode()->GetName());
+                int rc = PtpClient->AddUniqStr( id.nid
+                                              , id.id
+                                              , candidate
+                                              , targetLNode->GetNid()
+                                              , targetLNode->GetNode()->GetName());
+                if (rc)
+                {
+                    char la_buf[MON_STRING_BUF_SIZE];
+                    snprintf( la_buf, sizeof(la_buf)
+                            , "[%s] - Can't send unique string "
+                              "to target node %s, nid=%d\n"
+                            , method_name
+                            , targetLNode->GetNode()->GetName()
+                            , targetLNode->GetNid() );
+                    mon_log_write(MON_NODE_GETSTRINGID_2, SQ_LOG_ERR, la_buf);
+                }
             }
         }
 #endif
@@ -1721,9 +1744,9 @@ CProcess *CNodeContainer::AddCloneProcess( ProcessInfoNs_reply_def *processInfo
     CLNode   *lnode = Nodes->GetLNode(processInfo->nid);
     CNode    *node = lnode->GetNode();
 
-    strId_t pathStrId = MyNode->GetStringId ( processInfo->path, lnode );
-    strId_t ldpathStrId = MyNode->GetStringId (processInfo->ldpath, lnode );
-    strId_t programStrId = MyNode->GetStringId ( processInfo->program, lnode );
+    strId_t pathStrId = MyNode->GetStringId ( processInfo->path, lnode, true );
+    strId_t ldpathStrId = MyNode->GetStringId (processInfo->ldpath, lnode, true );
+    strId_t programStrId = MyNode->GetStringId ( processInfo->program, lnode, true );
 
     CProcess *process = node->CloneProcess( processInfo->nid
                                           , processInfo->type
@@ -2535,7 +2558,7 @@ CProcess *CNodeContainer::CloneProcessNs( int nid
                 snprintf( buf, sizeof(buf),
                           "[%s] ProcessInfo failed, rc=%d\n"
                         , method_name, msg.u.reply.u.process_info_ns.return_code );
-                mon_log_write( MON_NODE_GETPROCESSNS_1, SQ_LOG_ERR, buf );
+                mon_log_write( MON_NODE_CLONEPROCESSNS_1, SQ_LOG_ERR, buf );
             }
         }
         else
@@ -2545,9 +2568,17 @@ CProcess *CNodeContainer::CloneProcessNs( int nid
                       "[%s], Invalid MsgType(%d)/ReplyType(%d) for "
                       "ProcessInfoNs\n"
                     , method_name, msg.type, msg.u.reply.type );
-            mon_log_write( MON_NODE_GETPROCESSNS_2, SQ_LOG_ERR, buf );
+            mon_log_write( MON_NODE_CLONEPROCESSNS_2, SQ_LOG_ERR, buf );
         }
     }
+    else
+    {
+        char la_buf[MON_STRING_BUF_SIZE];
+        snprintf( la_buf, sizeof(la_buf)
+                , "[%s] - Process info request to Name Server failed\n"
+                , method_name );
+        mon_log_write( MON_NODE_CLONEPROCESSNS_3, SQ_LOG_ERR, la_buf );
+    }
 
     TRACE_EXIT;
     return( process );
@@ -2596,7 +2627,7 @@ CProcess *CNodeContainer::CloneProcessNs( const char *name, Verifier_t verifier
                 snprintf( buf, sizeof(buf),
                           "[%s] ProcessInfo failed, rc=%d\n"
                         , method_name, msg.u.reply.u.process_info_ns.return_code );
-                mon_log_write( MON_NODE_GETPROCESSNS_3, SQ_LOG_ERR, buf );
+                mon_log_write( MON_NODE_CLONEPROCESSNS_4, SQ_LOG_ERR, buf );
             }
         }
         else
@@ -2606,9 +2637,17 @@ CProcess *CNodeContainer::CloneProcessNs( const char *name, Verifier_t verifier
                       "[%s], Invalid MsgType(%d)/ReplyType(%d) for "
                       "ProcessInfo\n"
                     , method_name, msg.type, msg.u.reply.type );
-            mon_log_write( MON_NODE_GETPROCESSNS_4, SQ_LOG_ERR, buf );
+            mon_log_write( MON_NODE_CLONEPROCESSNS_5, SQ_LOG_ERR, buf );
         }
     }
+    else
+    {
+        char la_buf[MON_STRING_BUF_SIZE];
+        snprintf( la_buf, sizeof(la_buf)
+                , "[%s] - Process info request to Name Server failed\n"
+                , method_name );
+        mon_log_write( MON_NODE_CLONEPROCESSNS_6, SQ_LOG_ERR, la_buf );
+    }
 
     TRACE_EXIT;
     return( process );
@@ -3243,6 +3282,11 @@ int CNodeContainer::GetProcessInfoNs( int nid
     }
     else
     {
+        char la_buf[MON_STRING_BUF_SIZE];
+        snprintf( la_buf, sizeof(la_buf)
+                , "[%s] - Process info request to Name Server failed\n"
+                , method_name );
+        mon_log_write( MON_NODE_GETPROCESSNS_3, SQ_LOG_ERR, la_buf );
         rc = MPI_ERR_OP;
     }
 
@@ -3293,7 +3337,7 @@ int CNodeContainer::GetProcessInfoNs( const char *name
                 snprintf( buf, sizeof(buf),
                           "[%s] ProcessInfo failed, rc=%d\n"
                         , method_name, msg.u.reply.u.process_info_ns.return_code );
-                mon_log_write( MON_NODE_GETPROCESSNS_3, SQ_LOG_ERR, buf );
+                mon_log_write( MON_NODE_GETPROCESSNS_4, SQ_LOG_ERR, buf );
             }
             rc = msg.u.reply.u.process_info_ns.return_code;
         }
@@ -3304,12 +3348,17 @@ int CNodeContainer::GetProcessInfoNs( const char *name
                       "[%s], Invalid MsgType(%d)/ReplyType(%d) for "
                       "ProcessInfo\n"
                     , method_name, msg.type, msg.u.reply.type );
-            mon_log_write( MON_NODE_GETPROCESSNS_4, SQ_LOG_ERR, buf );
+            mon_log_write( MON_NODE_GETPROCESSNS_5, SQ_LOG_ERR, buf );
             rc = MPI_ERR_OP;
         }
     }
     else
     {
+        char la_buf[MON_STRING_BUF_SIZE];
+        snprintf( la_buf, sizeof(la_buf)
+                , "[%s] - Process info request to Name Server failed\n"
+                , method_name );
+        mon_log_write( MON_NODE_GETPROCESSNS_6, SQ_LOG_ERR, la_buf );
         rc = MPI_ERR_OP;
     }
 
@@ -3383,7 +3432,7 @@ CProcess *CNodeContainer::GetProcessLByTypeNs( int nid, PROCESSTYPE type )
                 snprintf( buf, sizeof(buf),
                           "[%s] ProcessInfo failed, rc=%d\n"
                         , method_name, msg.u.reply.u.process_info_ns.return_code );
-                mon_log_write( MON_NODE_GETPROCESSNS_3, SQ_LOG_ERR, buf );
+                mon_log_write( MON_NODE_GETPROCESSLBYTYPENS_1, SQ_LOG_ERR, buf );
             }
         }
         else
@@ -3393,9 +3442,17 @@ CProcess *CNodeContainer::GetProcessLByTypeNs( int nid, PROCESSTYPE type )
                       "[%s], Invalid MsgType(%d)/ReplyType(%d) for "
                       "ProcessInfo\n"
                     , method_name, msg.type, msg.u.reply.type );
-            mon_log_write( MON_NODE_GETPROCESSNS_4, SQ_LOG_ERR, buf );
+            mon_log_write( MON_NODE_GETPROCESSLBYTYPENS_2, SQ_LOG_ERR, buf );
         }
     }
+    else
+    {
+        char la_buf[MON_STRING_BUF_SIZE];
+        snprintf( la_buf, sizeof(la_buf)
+                , "[%s] - Process info request to Name Server failed\n"
+                , method_name );
+        mon_log_write( MON_NODE_GETPROCESSLBYTYPENS_3, SQ_LOG_ERR, la_buf );
+    }
 
     TRACE_EXIT;
     return( process );

http://git-wip-us.apache.org/repos/asf/trafodion/blob/65ac5563/core/sqf/monitor/linux/pnode.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnode.h b/core/sqf/monitor/linux/pnode.h
index fbfddf4..b04e387 100644
--- a/core/sqf/monitor/linux/pnode.h
+++ b/core/sqf/monitor/linux/pnode.h
@@ -269,7 +269,7 @@ public:
     // If candidate string has not been seen before assign a unique
     // id and store it in the config database.   In either case return
     // the unique id as the value of the method.
-    strId_t GetStringId( char *candidate, CLNode *targetLNode = NULL );
+    strId_t GetStringId( char *candidate, CLNode *targetLNode = NULL, bool clone = false );
 
     inline int   GetTmSyncNid( void ) { return( tmSyncNid_ ); }
     inline SyncState GetTmSyncState( void ) { return( tmSyncState_ ); }

http://git-wip-us.apache.org/repos/asf/trafodion/blob/65ac5563/core/sqf/monitor/linux/process.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/process.cxx b/core/sqf/monitor/linux/process.cxx
index 5e7b792..3a3e699 100644
--- a/core/sqf/monitor/linux/process.cxx
+++ b/core/sqf/monitor/linux/process.cxx
@@ -651,14 +651,24 @@ void CProcess::procExitNotifierNodes( void )
         {
             if (NameServerEnabled && targetNode->GetPNid() != MyPNID)
             {
-                int rc = -1;
                 // Forward the process exit to the target node
-                rc = PtpClient->ProcessExit( this 
-                                           , targetLNode->GetNid()
-                                           , targetNode->GetName() ); 
+                int rc = PtpClient->ProcessExit( this 
+                                               , targetLNode->GetNid()
+                                               , targetNode->GetName() ); 
                 if (rc)
                 {
-                    // TODO: Error handling
+                    char la_buf[MON_STRING_BUF_SIZE];
+                    snprintf( la_buf, sizeof(la_buf)
+                            , "[%s] - Can't send process exit "
+                              "for process %s (%d, %d) "
+                              "to target node %s, nid=%d\n"
+                            , method_name
+                            , GetName()
+                            , GetNid()
+                            , GetPid()
+                            , targetLNode->GetNode()->GetName()
+                            , targetLNode->GetNid() );
+                    mon_log_write(MON_PROCESS_PROCEXITNOTIFIERNODES_1, SQ_LOG_ERR, la_buf);
                 }
             }
         }
@@ -709,7 +719,18 @@ void CProcess::procExitUnregAll ( _TM_Txid_External transId )
                                              , targetLNode->GetNode()->GetName() ); 
                 if (rc)
                 {
-                    // TODO: Error handling
+                    char la_buf[MON_STRING_BUF_SIZE];
+                    snprintf( la_buf, sizeof(la_buf)
+                            , "[%s] - Can't send process notify request "
+                              "for process %s (%d, %d) "
+                              "to target node %s, nid=%d\n"
+                            , method_name
+                            , targetProcess->GetName()
+                            , targetProcess->GetNid()
+                            , targetProcess->GetPid()
+                            , targetLNode->GetNode()->GetName()
+                            , targetLNode->GetNid() );
+                    mon_log_write(MON_PROCESS_PROCEXITUNREGALL_1, SQ_LOG_ERR, la_buf);
                 }
             }
             
@@ -726,6 +747,7 @@ void CProcess::procExitUnregAll ( _TM_Txid_External transId )
 }
 #endif
 
+#ifndef NAMESERVER_PROCESS
 void CProcess::childAdd ( int nid, int pid )
 {
     const char method_name[] = "CProcess::childAdd";
@@ -795,6 +817,81 @@ bool CProcess::childRemoveFirst ( nidPid_t & child)
     return result;
 }
 
+void CProcess::childUnHookedAdd( int nid, int pid )
+{
+    const char method_name[] = "CProcess::childUnHookedAdd";
+    TRACE_ENTRY;
+
+    if (trace_settings & (TRACE_REQUEST_DETAIL | TRACE_PROCESS_DETAIL))
+        trace_printf( "%s@%d adding unhooked child (%d:%d)\n"
+                    , method_name, __LINE__
+                    , nid, pid );
+
+    nidPid_t child = { nid, pid };
+    childrenListLock_.lock();
+    childrenUnHooked_.push_back ( child );
+    childrenListLock_.unlock();
+
+    TRACE_EXIT;
+}
+
+int CProcess::childUnHookedCount( void )
+{
+    const char method_name[] = "CProcess::childUnHookedCount";
+    TRACE_ENTRY;
+
+    childrenListLock_.lock();
+    int count = childrenUnHooked_.size();
+    childrenListLock_.unlock();
+
+    TRACE_EXIT;
+    return(count);
+}
+
+void CProcess::childUnHookedRemove( int nid, int pid )
+{
+    const char method_name[] = "CProcess::childUnHookedRemove";
+    TRACE_ENTRY;
+
+    nidPidList_t::iterator it;
+
+    childrenListLock_.lock();
+    for ( it = childrenUnHooked_.begin(); it != childrenUnHooked_.end(); ++it)
+    {
+        if (it->nid == nid && it->pid == pid )
+        {
+            childrenUnHooked_.erase ( it );
+            break;
+        }
+    }
+    childrenListLock_.unlock();
+
+    TRACE_EXIT;
+}
+
+bool CProcess::childUnHookedRemoveFirst( nidPid_t & child)
+{
+    const char method_name[] = "CProcess::childUnHookedRemoveFirst";
+    TRACE_ENTRY;
+
+    bool result = false;
+
+    childrenListLock_.lock();
+    if ( !childrenUnHooked_.empty() )
+    {
+        child = childrenUnHooked_.front ();
+        childrenUnHooked_.pop_front ();
+        result = true;
+
+    }
+    childrenListLock_.unlock();
+
+    TRACE_EXIT;
+
+    return result;
+}
+#endif
+
 #ifndef NAMESERVER_PROCESS
 void CProcess::CompleteDump(DUMPSTATUS status, char *core_file)
 {
@@ -882,7 +979,16 @@ void CProcess::CompleteProcessStartup (char *port, int os_pid, bool event_messag
                     rc = NameServer->ProcessNew(this); // in reqQueue thread (CExtStartupReq)
                     if (rc)
                     {
-                        // TODO: Error handling
+                        char la_buf[MON_STRING_BUF_SIZE];
+                        snprintf( la_buf, sizeof(la_buf)
+                                , "[%s] - Can't register new process "
+                                  "%s (%d, %d) "
+                                  "to Name Server process\n"
+                                , method_name
+                                , GetName()
+                                , GetNid()
+                                , GetPid() );
+                        mon_log_write(MON_PROCESS_COMPLETESTARTUP_1, SQ_LOG_ERR, la_buf);
                     }
 
                     if (Parent_Nid != -1)
@@ -893,14 +999,22 @@ void CProcess::CompleteProcessStartup (char *port, int os_pid, bool event_messag
                             rc = PtpClient->ProcessClone(this);
                             if (rc)
                             {
-                                // TODO: Error handling
+                                char la_buf[MON_STRING_BUF_SIZE];
+                                CLNode *parentLNode = NULL;
+                                parentLNode = Nodes->GetLNode( GetParentNid() );
+                                snprintf( la_buf, sizeof(la_buf)
+                                        , "[%s] - Can't send process clone request"
+                                          "for process %s (%d, %d) "
+                                          "to parent node %s, nid=%d\n"
+                                        , method_name
+                                        , GetName()
+                                        , GetNid()
+                                        , GetPid()
+                                        , parentLNode->GetNode()->GetName()
+                                        , parentLNode->GetNid() );
+                                mon_log_write(MON_PROCESS_COMPLETESTARTUP_2, SQ_LOG_ERR, la_buf);
                             }
                         }
-                        else
-                        {
-                            // TODO: Generate internal clone request?
-                            //       to update local parent?  
-                        }
                     }
                 }
                 else
@@ -929,14 +1043,22 @@ void CProcess::CompleteProcessStartup (char *port, int os_pid, bool event_messag
                         rc = PtpClient->ProcessClone(this);
                         if (rc)
                         {
-                            // TODO: Error handling
+                            char la_buf[MON_STRING_BUF_SIZE];
+                            CLNode *parentLNode = NULL;
+                            parentLNode = Nodes->GetLNode( GetParentNid() );
+                            snprintf( la_buf, sizeof(la_buf)
+                                    , "[%s] - Can't send process clone request"
+                                      "for process %s (%d, %d) "
+                                      "to parent node %s, nid=%d\n"
+                                    , method_name
+                                    , GetName()
+                                    , GetNid()
+                                    , GetPid()
+                                    , parentLNode->GetNode()->GetName()
+                                    , parentLNode->GetNid() );
+                            mon_log_write(MON_PROCESS_COMPLETESTARTUP_3, SQ_LOG_ERR, la_buf);
                         }
                     }
-                    else
-                    {
-                        // TODO: Generate internal clone request?
-                        //       to update local parent?  
-                    }
                 }
             }
             else
@@ -1616,6 +1738,7 @@ bool CProcess::Create (CProcess *parent, void* tag, int & result)
     int i;
     int j;
     int rc = -1;
+    int rc2 = -1;
     char *env;
     char **argv;
     char *childEnv[MAX_CHILD_ENV_VARS + 1];
@@ -2339,10 +2462,27 @@ bool CProcess::Create (CProcess *parent, void* tag, int & result)
             // Send actual pid and process name back to parent
             // STDIO Redirection requires that clone process in parent node
             // have the actual pid
-            PtpClient->ProcessInit( this
-                                  , tag
-                                  , 0
-                                  , parent->Nid );
+            rc2 = PtpClient->ProcessInit( this
+                                        , tag
+                                        , 0
+                                        , parent->Nid );
+            if (rc2)
+            {
+                char la_buf[MON_STRING_BUF_SIZE];
+                CLNode *parentLNode = NULL;
+                parentLNode = Nodes->GetLNode( parent->Nid );
+                snprintf( la_buf, sizeof(la_buf)
+                        , "[%s] - Can't send process create success "
+                          "for process %s (%d, %d) "
+                          "to parent node %s, nid=%d\n"
+                        , method_name
+                        , GetName()
+                        , GetNid()
+                        , GetPid()
+                        , parentLNode->GetNode()->GetName()
+                        , parentLNode->GetNid() );
+                mon_log_write(MON_PROCESS_CREATE_12, SQ_LOG_ERR, la_buf);
+            }
         }
 
         if (trace_settings & (TRACE_PROCESS | TRACE_REDIRECTION))
@@ -2708,6 +2848,31 @@ bool CProcess::Create (CProcess *parent, void* tag, int & result)
         successful = false;
         result = MPI_ERR_SPAWN;
 
+        if (NameServerEnabled)
+        {
+            rc2 = PtpClient->ProcessInit( this
+                                        , tag
+                                        , result
+                                        , parent->Nid );
+            if (rc2)
+            {
+                char la_buf[MON_STRING_BUF_SIZE];
+                CLNode *parentLNode = NULL;
+                parentLNode = Nodes->GetLNode( parent->Nid );
+                snprintf( la_buf, sizeof(la_buf)
+                        , "[%s] - Can't send process create failure "
+                          "for process %s (%d, %d) "
+                          "result to parent node %s, nid=%d, result=%d\n"
+                        , method_name
+                        , GetName()
+                        , GetNid()
+                        , GetPid()
+                        , parentLNode->GetNode()->GetName()
+                        , parentLNode->GetNid(), result );
+                mon_log_write(MON_PROCESS_CREATE_13, SQ_LOG_ERR, la_buf);
+            }
+        }
+
         char buf[MON_STRING_BUF_SIZE];
         snprintf(buf, sizeof(buf), "[CProcess::Create], Failed to start process %s path= %s.\n", Name, path.c_str());
         mon_log_write(MON_PROCESS_CREATE_11, SQ_LOG_ERR, buf);
@@ -3231,6 +3396,10 @@ void CProcess::Exit( CProcess *parent )
         if ( (parent != NULL) && (parent->GetState() == State_Up) )
         {
             parent->childRemove( Nid, Pid);
+            if (NameServerEnabled)
+            {
+                parent->childUnHookedRemove( Nid, Pid);
+            }
         }
 
         // Check if we need to output a entry into the process id map log file
@@ -3364,7 +3533,18 @@ void CProcess::Exit( CProcess *parent )
                                                , targetLNode->GetNode()->GetName() );
                 if (rc)
                 {
-                    // TODO: Error handling
+                    char la_buf[MON_STRING_BUF_SIZE];
+                    snprintf( la_buf, sizeof(la_buf)
+                            , "[%s] - Can't send process exit "
+                              "for process %s (%d, %d) "
+                              "to parent node %s, nid=%d\n"
+                            , method_name
+                            , GetName()
+                            , GetNid()
+                            , GetPid()
+                            , targetLNode->GetNode()->GetName()
+                            , targetLNode->GetNid() );
+                    mon_log_write(MON_PROCESS_PROCEXIT_1, SQ_LOG_ERR, la_buf);
                 }
             }
         }
@@ -3380,7 +3560,18 @@ void CProcess::Exit( CProcess *parent )
                                                , targetLNode->GetNode()->GetName() );
                 if (rc)
                 {
-                    // TODO: Error handling
+                    char la_buf[MON_STRING_BUF_SIZE];
+                    snprintf( la_buf, sizeof(la_buf)
+                            , "[%s] - Can't send process exit "
+                              "for process %s (%d, %d) "
+                              "to parent node %s, nid=%d\n"
+                            , method_name
+                            , GetName()
+                            , GetNid()
+                            , GetPid()
+                            , targetLNode->GetNode()->GetName()
+                            , targetLNode->GetNid() );
+                    mon_log_write(MON_PROCESS_PROCEXIT_2, SQ_LOG_ERR, la_buf);
                 }
             }
         }
@@ -4703,18 +4894,36 @@ void CProcessContainer::Child_Exit ( CProcess * parent )
                 {
                     if (NameServerEnabled)
                     {
-                        CNode  *childNode = NULL;
-                        childNode = childNode->GetNode();
-                        // Forward the process create to the target node
-                        PtpClient->ProcessKill( process
-                                              , process->GetAbort()
-                                              , childLNode->GetNid()
-                                              , childNode->GetName());
+                        CNode* childNode = childLNode->GetNode();
+                        // Forward the process kill to the target node
+                        int rc = PtpClient->ProcessKill( process
+                                                       , process->GetAbort()
+                                                       , childLNode->GetNid()
+                                                       , childNode->GetName() );
+                        if (rc)
+                        {
+                            char la_buf[MON_STRING_BUF_SIZE];
+                            snprintf( la_buf, sizeof(la_buf)
+                                    , "[%s] - Can't send process kill "
+                                      "request for child process %s (%d, %d) "
+                                      "to child node %s, nid=%d\n"
+                                    , method_name
+                                    , process->GetName()
+                                    , process->GetNid()
+                                    , process->GetPid()
+                                    , childNode->GetName()
+                                    , childLNode->GetNid() );
+                            mon_log_write(MON_PROCESSCONT_CHILDEXIT_1, SQ_LOG_ERR, la_buf);
+                        }
                     }
                 }
                 
                 if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
-                    trace_printf("%s@%d - Completed kill for child process %s (%d, %d)\n", method_name, __LINE__, process->GetName(), process->GetNid(), process->GetPid());
+                    trace_printf( "%s@%d - Completed kill for child process %s (%d, %d)\n"
+                                , method_name, __LINE__
+                                , process->GetName()
+                                , process->GetNid()
+                                , process->GetPid());
             }
             else
             {
@@ -4736,6 +4945,90 @@ void CProcessContainer::Child_Exit ( CProcess * parent )
     }
     TRACE_EXIT;
 }
+
+void CProcessContainer::ChildUnHooked_Exit( CProcess* parent )
+{
+    const char method_name[] = "CProcessContainer::ChildUnHooked_Exit";
+    TRACE_ENTRY;
+
+    CProcess *process;
+
+    if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+        trace_printf( "%s@%d with parent %s (%d,%d:%d)\n"
+                    , method_name, __LINE__
+                    , parent->GetName()
+                    , parent->GetNid()
+                    , parent->GetPid()
+                    , parent->GetVerifier() );
+
+    if (NameServerEnabled)
+    {
+        if ( parent && !parent->IsClone()
+           && ((MyNode->GetState() != State_Shutdown
+             && MyNode->GetShutdownLevel() == ShutdownLevel_Undefined)) )
+        {
+            CProcess::nidPid_t child;
+            CLNode* childLNode;
+
+            while ( parent->childUnHookedRemoveFirst( child ))
+            {
+                childLNode = Nodes->GetLNode( child.nid );
+                process = (childLNode != NULL )
+                             ? childLNode->GetNode()->GetProcess( child.pid ) : NULL;
+                if (process)
+                {
+                    if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
+                    {
+                        trace_printf( "%s@%d - Telling unhooked child process %s (%d,%d:%d) "
+                                      "of parent death %s (%d,%d:%d)\n"
+                                    , method_name, __LINE__
+                                    , process->GetName()
+                                    , process->GetNid()
+                                    , process->GetPid()
+                                    , process->GetVerifier()
+                                    , parent->GetName()
+                                    , parent->GetNid()
+                                    , parent->GetPid()
+                                    , parent->GetVerifier() );
+                    }
+    
+                    CNode* childNode = childLNode->GetNode();
+                    // Forward the parent's process exit to the child's node
+                    int rc = PtpClient->ProcessExit( parent
+                                                   , childLNode->GetNid()
+                                                   , childNode->GetName() );
+                    if (rc)
+                    {
+                        char la_buf[MON_STRING_BUF_SIZE];
+                        snprintf( la_buf, sizeof(la_buf)
+                                , "[%s] - Can't send process exit "
+                                  "request for parent process %s (%d,%d:%d) "
+                                  "to child's node %s, nid=%d\n"
+                                , method_name
+                                , parent->GetName()
+                                , parent->GetNid()
+                                , parent->GetPid()
+                                , parent->GetVerifier()
+                                , childNode->GetName()
+                                , childLNode->GetNid() );
+                        mon_log_write(MON_PROCESSCONT_CHILDEXIT_1, SQ_LOG_ERR, la_buf);
+                    }
+                    else
+                    {
+                        if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
+                            trace_printf( "%s@%d - Completed kill for parent process %s (%d,%d:%d)\n"
+                                        , method_name, __LINE__
+                                        , parent->GetName()
+                                        , parent->GetNid()
+                                        , parent->GetPid()
+                                        , parent->GetVerifier() );
+                    }
+                }
+            }
+        }
+    }
+    TRACE_EXIT;
+}
 #endif
 
 void CProcessContainer::CleanUpProcesses( void )
@@ -4922,7 +5215,6 @@ CProcess *CProcessContainer::CompleteProcessStartup (char *process_name,
                 // exits abnormally.
                 int parentNid;
                 int parentPid;
-                CProcess * parent;
                 if ( ! process->IsBackup() )
                 {
                     parentNid = process->GetParentNid();
@@ -4934,8 +5226,10 @@ CProcess *CProcessContainer::CompleteProcessStartup (char *process_name,
                     parentPid = process->GetPairParentPid();
                 }
 
+#ifndef NAMESERVER_PROCESS
                 if ( parentNid != -1 && parentPid != -1 )
                 {
+                    CProcess* parent;
                     parent = Nodes->GetLNode ( parentNid )
                                 ->GetProcessL( parentPid );
                     if ( parent && !process->IsBackup() )
@@ -4945,7 +5239,43 @@ CProcess *CProcessContainer::CompleteProcessStartup (char *process_name,
                         parent->childAdd ( process->GetNid(), os_pid );
                     }
                 }
+#endif
+            }
+#ifndef NAMESERVER_PROCESS
+            if (NameServerEnabled)
+            {
+                if (process->IsUnhooked())
+                {   // Parent process object keeps track of child processes
+                    // created. Needed when parent process exits to clean up
+                    // parent clone process object in remote nodes.
+                    int parentNid;
+                    int parentPid;
+                    CProcess* parent;
+                    if ( !process->IsBackup() )
+                    {
+                        parentNid = process->GetParentNid();
+                        parentPid = process->GetParentPid();
+                    }
+                    else
+                    {
+                        parentNid = process->GetPairParentNid();
+                        parentPid = process->GetPairParentPid();
+                    }
+    
+                    if ( parentNid != -1 && parentPid != -1 )
+                    {
+                        parent = Nodes->GetLNode(parentNid)->GetProcessL(parentPid);
+                        if ( parent && !parent->IsClone() && !process->IsBackup() )
+                        {
+                            parent->childUnHookedRemove( process->GetNid()
+                                                       , process->GetPid() );
+                            parent->childUnHookedAdd( process->GetNid()
+                                                    , os_pid );
+                        }
+                    }
+                }
             }
+#endif
             // Process id changed from when we started the process.  So
             // remap using the new pid.  [This could happen if, for example,
             // a shell script was the originally started process and it
@@ -5366,6 +5696,14 @@ void CProcessContainer::Exit_Process (CProcess *process, bool abend, int downNod
             Child_Exit(process);
         }
 
+        if (!process->IsClone() && NameServerEnabled)
+        {
+            if (process->childUnHookedCount() > 0)
+            {
+                ChildUnHooked_Exit(process);
+            }
+        }
+    
         if ( parent == NULL)
         {
             parent = Nodes->GetProcess( process->GetParentNid(),

http://git-wip-us.apache.org/repos/asf/trafodion/blob/65ac5563/core/sqf/monitor/linux/process.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/process.h b/core/sqf/monitor/linux/process.h
index 3c813bb..3cde3e5 100644
--- a/core/sqf/monitor/linux/process.h
+++ b/core/sqf/monitor/linux/process.h
@@ -73,6 +73,7 @@ class CProcessContainer
                                 , _TM_Txid_External trans_id );
 #ifndef NAMESERVER_PROCESS
     void Child_Exit ( CProcess * parent );
+    void ChildUnHooked_Exit ( CProcess * parent );
 #endif
     void CleanUpProcesses( void );
     CProcess *CloneProcess( int nid, 
@@ -428,11 +429,18 @@ class CProcess
     void SetHangupTime () { clock_gettime(CLOCK_REALTIME, &hangupTime_); }
     time_t GetHangupTime () { return hangupTime_.tv_sec; }
 
+#ifndef NAMESERVER_PROCESS
     void childAdd ( int nid, int pid );
     int childCount ( void );
     void childRemove ( int nid, int pid );
     bool childRemoveFirst ( nidPid_t & child );
 
+    void childUnHookedAdd( int nid, int pid );
+    int childUnHookedCount( void );
+    void childUnHookedRemove( int nid, int pid );
+    bool childUnHookedRemoveFirst( nidPid_t & child );
+#endif
+
     struct message_def * GetDeathNotice ( void );
     void PutDeathNotice( struct message_def * );
 
@@ -558,17 +566,20 @@ private:
 
     enum  { MAX_CHILD_ENV_VARS = 300 };
 
+#ifndef NAMESERVER_PROCESS
     // Container to keep track of this process' children created on
     // the local node.  Needed because if this process abornmally terminates
     // the children will be terminated too.
     typedef list<nidPid_t> nidPidList_t;
     nidPidList_t children_;
+    nidPidList_t childrenUnHooked_;   // only used with Name Server enabled
 
     // Lock for children_ list.   Temporarily using a lock but should 
     // be able to eliminate for better performance.   Once lioCleanupThread
     // and syncThread uniformly queue requests to be processed by worker
     // thread this lock should not be necessary.
     CLock       childrenListLock_;
+#endif
 
     // Container to hold dead process info to be sent as death notices
     // to an ssmp process.   This is a NULL list except when the CProcess

http://git-wip-us.apache.org/repos/asf/trafodion/blob/65ac5563/core/sqf/monitor/linux/reqkill.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqkill.cxx b/core/sqf/monitor/linux/reqkill.cxx
index e8cad71..b59cae2 100644
--- a/core/sqf/monitor/linux/reqkill.cxx
+++ b/core/sqf/monitor/linux/reqkill.cxx
@@ -94,10 +94,25 @@ void CExtKillReq::Kill( CProcess *process )
         if (NameServerEnabled)
         {
             // Forward the process create to the target node
-            PtpClient->ProcessKill( process
-                                  , process->GetAbort()
-                                  , lnode->GetNid()
-                                  , node->GetName());
+            int rc = PtpClient->ProcessKill( process
+                                           , process->GetAbort()
+                                           , lnode->GetNid()
+                                           , node->GetName());
+            if (rc)
+            {
+                char la_buf[MON_STRING_BUF_SIZE];
+                snprintf( la_buf, sizeof(la_buf)
+                        , "[%s] - Can't send process kill "
+                          "request for child process %s (%d, %d) "
+                          "to child node %s, nid=%d\n"
+                        , method_name
+                        , process->GetName()
+                        , process->GetNid()
+                        , process->GetPid()
+                        , node->GetName()
+                        , lnode->GetNid() );
+                mon_log_write(MON_REQ_KILL_1, SQ_LOG_ERR, la_buf);
+            }
         }
         else
         {

http://git-wip-us.apache.org/repos/asf/trafodion/blob/65ac5563/core/sqf/monitor/linux/reqnewproc.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqnewproc.cxx b/core/sqf/monitor/linux/reqnewproc.cxx
index a6da01e..972d785 100644
--- a/core/sqf/monitor/linux/reqnewproc.cxx
+++ b/core/sqf/monitor/linux/reqnewproc.cxx
@@ -532,9 +532,24 @@ void CExtNewProcReq::performRequest()
                     if (NameServerEnabled)
                     {
                         // Forward the process create to the target node
-                        PtpClient->ProcessNew( process
-                                             , lnode->GetNid()
-                                             , lnode->GetNode()->GetName());
+                        int rc = PtpClient->ProcessNew( process
+                                                      , lnode->GetNid()
+                                                      , lnode->GetNode()->GetName());
+                        if (rc)
+                        {
+                            char la_buf[MON_STRING_BUF_SIZE];
+                            snprintf( la_buf, sizeof(la_buf)
+                                    , "[%s] - Can't send process create "
+                                      "request for process %s (%d, %d) "
+                                      "to target node %s, nid=%d\n"
+                                    , method_name
+                                    , process->GetName()
+                                    , process->GetNid()
+                                    , process->GetPid()
+                                    , lnode->GetNode()->GetName()
+                                    , lnode->GetNid() );
+                            mon_log_write(MON_MONITOR_STARTPROCESS_15, SQ_LOG_ERR, la_buf);
+                        }
                     }
                     else
 #endif

http://git-wip-us.apache.org/repos/asf/trafodion/blob/65ac5563/core/sqf/monitor/linux/reqnotify.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqnotify.cxx b/core/sqf/monitor/linux/reqnotify.cxx
index 5900f01..4d278ce 100644
--- a/core/sqf/monitor/linux/reqnotify.cxx
+++ b/core/sqf/monitor/linux/reqnotify.cxx
@@ -274,16 +274,6 @@ void CExtNotifyReq::performRequest()
                 } 
                 else
                 {
-#if 0
-                    if ( msg_->u.request.u.notify.cancel )
-                    {   // Unregister interest in death of target process 
-                        status = targetProcess->CancelDeathNotification( nid_
-                                                                       , pid
-                                                                       , verifier_
-                                                                       , msg_->u.request.u.notify.trans_id);
-                    }
-                    else if (sourceProcess)
-#endif
                     if (sourceProcess)
                     {   // Register interest in death of target process 
                         if (NameServerEnabled && targetProcess->IsClone())
@@ -304,7 +294,18 @@ void CExtNotifyReq::performRequest()
                                                          , targetLNode->GetNode()->GetName() );
                             if (rc)
                             {
-                                // TODO: Error handling
+                                char la_buf[MON_STRING_BUF_SIZE];
+                                snprintf( la_buf, sizeof(la_buf)
+                                        , "[%s] - Can't send process notify request "
+                                          "for process %s (%d, %d) "
+                                          "to target node %s, nid=%d\n"
+                                        , method_name
+                                        , sourceProcess->GetName()
+                                        , sourceProcess->GetNid()
+                                        , sourceProcess->GetPid()
+                                        , targetLNode->GetNode()->GetName()
+                                        , targetLNode->GetNid() );
+                                mon_log_write(MON_REQ_NOTIFY_1, SQ_LOG_ERR, la_buf);
                             }
                         }
                         

http://git-wip-us.apache.org/repos/asf/trafodion/blob/65ac5563/core/sqf/monitor/linux/reqprocinfo.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqprocinfo.cxx b/core/sqf/monitor/linux/reqprocinfo.cxx
index 84dc3a7..d3f04e2 100644
--- a/core/sqf/monitor/linux/reqprocinfo.cxx
+++ b/core/sqf/monitor/linux/reqprocinfo.cxx
@@ -44,7 +44,7 @@ extern CNameServer *NameServer;
 // Copy information for a specific process into the reply message buffer.
 void CExtProcInfoBase::ProcessInfo_CopyData(CProcess *process, ProcessInfoState &procState)
 {
-    const char method_name[] = "CNameServer::SendReceive";
+    const char method_name[] = "CExtProcInfoBase::ProcessInfo_CopyData";
     CProcess *parent;
 
     TRACE_ENTRY;
@@ -356,7 +356,17 @@ void CExtProcInfoReq::performRequest()
     }
 
     if ( NameServerEnabled && !getMonitorInfo )
-        NameServer->ProcessInfo(msg_); // in reqQueue thread (CExternalReq)
+    {
+        int rc = NameServer->ProcessInfo(msg_); // in reqQueue thread (CExternalReq)
+        if (rc)
+        {
+            char la_buf[MON_STRING_BUF_SIZE];
+            snprintf( la_buf, sizeof(la_buf)
+                    , "[%s] - Process info request to Name Server failed\n"
+                    , method_name );
+            mon_log_write(MON_REQ_PROCINFO_1, SQ_LOG_ERR, la_buf);
+        }
+    }
 #endif
 
 #ifndef NAMESERVER_PROCESS
@@ -642,7 +652,17 @@ void CExtProcInfoContReq::performRequest()
     }
 
     if ( NameServerEnabled && !getMonitorInfo )
-        NameServer->ProcessInfoCont(msg_); // in reqQueue thread (CExternalReq)
+    {
+        int rc = NameServer->ProcessInfoCont(msg_); // in reqQueue thread (CExternalReq)
+        if (rc)
+        {
+            char la_buf[MON_STRING_BUF_SIZE];
+            snprintf( la_buf, sizeof(la_buf)
+                    , "[%s] - Process info continue request to Name Server failed\n"
+                    , method_name );
+            mon_log_write(MON_REQ_PROCINFOCONT_1, SQ_LOG_ERR, la_buf);
+        }
+    }
 #endif
 
 #ifndef NAMESERVER_PROCESS

http://git-wip-us.apache.org/repos/asf/trafodion/blob/65ac5563/core/sqf/monitor/linux/reqqueue.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqqueue.cxx b/core/sqf/monitor/linux/reqqueue.cxx
index 508a325..c7af4ca 100644
--- a/core/sqf/monitor/linux/reqqueue.cxx
+++ b/core/sqf/monitor/linux/reqqueue.cxx
@@ -1577,7 +1577,7 @@ void CIntNewProcReq::performRequest()
         else
         {
             if (NameServerEnabled)
-            { // Name Server find by nid,pid:verifier
+            {
                 if (trace_settings & TRACE_REQUEST)
                     trace_printf( "%s@%d" " - Getting parent process from Name Server (%d,%d:%d)\n"
                                 , method_name, __LINE__
@@ -1656,14 +1656,7 @@ void CIntNewProcReq::performRequest()
             {
                 // Process creation failure, relay error code to node
                 // that requested process creation.
-                if (NameServerEnabled)
-                {
-                    PtpClient->ProcessInit( newProcess
-                                          , reqTag_
-                                          , result
-                                          , parentNid_ );
-                }
-                else
+                if (!NameServerEnabled)
                 {
                     CReplProcInit *repl = new CReplProcInit(newProcess, reqTag_,
                                                             result, parentNid_);
@@ -2285,9 +2278,10 @@ void CIntProcInitReq::performRequest()
         Nodes->GetLNode( process_->GetNid() )->GetNode()->AddToPidMap(process_->GetPid(), process_);
         Nodes->GetLNode( process_->GetNid() )->GetNode()->AddToNameMap(process_);
 
+        CProcess* parent;
+
         if (process_->IsBackup())
         {
-            CProcess * parent;
             parent = Nodes->GetProcess(process_->GetParentNid(),
                                        process_->GetParentPid(), false);
             if (parent)
@@ -2295,53 +2289,59 @@ void CIntProcInitReq::performRequest()
                 // this backup process object.
                 if (trace_settings & (TRACE_SYNC | TRACE_PROCESS))
                 {
-                    trace_printf("%s@%d - For backup process (%d, %d)"
-                                 ", for parent (%d, %d) setting "
-                                 "parent's Parent_Nid/Parent_Pid="
-                                 "(%d, %d).\n",
-                                 method_name, __LINE__,  process_->GetNid(),
-                                 process_->GetPid(), parent->GetNid(),
-                                 parent->GetPid(),
-                                 process_->GetNid(), process_->GetPid());
+                    trace_printf( "%s@%d - For backup process %s (%d,%d:%d)"
+                                  ", for parent %s (%d,%d:%d) setting "
+                                  "parent's Parent_Nid/Parent_Pid="
+                                  "(%d,%d).\n"
+                                , method_name, __LINE__
+                                , process_->GetName()
+                                , process_->GetNid()
+                                , process_->GetPid()
+                                , process_->GetVerifier()
+                                , parent->GetName()
+                                , parent->GetNid()
+                                , parent->GetPid()
+                                , parent->GetVerifier()
+                                , process_->GetNid()
+                                , process_->GetPid());
                 }
                 parent->SetParentNid ( process_->GetNid() );
                 parent->SetParentPid ( process_->GetPid() );
             }
         }
-
-
-#ifdef QUICK_WAITED_NEWPROCESS_REPLY
-// Following allows reply to a "waited" new process request before we
-// get the "startup" message from the process.   This make the process
-// creation appear to complete more quickly.   However there are potential
-// problems if the requester immediately tries to open the new process
-// because it is not ready yet.   So need to handle quick "open" of this
-// type before re-enabling this code section.
-                if (!process->IsNowait())
-                {   // new process request was a "waited" request
-                    if (process->GetParentNid() == -1)
-                    {
-                        parent = NULL;
-                    }
-                    else
-                    {
-                        parent =
-                            LNode[process->GetParentNid()]->
-                            GetProcessL(process->GetParentPid());
-                    }
-
-                    if (parent)
-                    {
-                        reply_msg = process->parentContext();
-                        if ( reply_msg )
-                        {
-                            // the parent gets a new_process reply
-                            parent->ReplyNewProcess ( reply_msg, process );
-
-                            process->parentContext (NULL);
-                        }
+#ifndef NAMESERVER_PROCESS
+        if (NameServerEnabled)
+        {
+            if (process_->IsUnhooked())
+            {
+                if ( process_->GetParentNid() != -1 && process_->GetParentPid() != -1 )
+                {
+                    parent = Nodes->GetProcess(process_->GetParentNid(),
+                                               process_->GetParentPid(), false);
+                    if (parent && !parent->IsClone())
+                    {   // Parent process object keeps track of child processes
+                        // created. Needed when parent process exits to clean up
+                        // parent clone process object in remote nodes.
+                        if (trace_settings & (TRACE_SYNC_DETAIL | TRACE_REQUEST_DETAIL
+                                              | TRACE_PROCESS_DETAIL))
+                            trace_printf( "%s@%d - Adding unhooked child process %s (%d,%d:%d) to "
+                                          "parent %s (%d,%d:%d)\n"
+                                        , method_name, __LINE__
+                                        , process_->GetName()
+                                        , process_->GetNid()
+                                        , process_->GetPid()
+                                        , process_->GetVerifier()
+                                        , parent->GetName()
+                                        , parent->GetNid()
+                                        , parent->GetPid()
+                                        , parent->GetVerifier() );
+            
+                        parent->childUnHookedAdd( process_->GetNid()
+                                                , process_->GetPid() );
                     }
                 }
+            }
+        }
 #endif
     }
 
@@ -2599,7 +2599,22 @@ void CIntChildDeathReq::performRequest()
         }
 #ifndef NAMESERVER_PROCESS
         if ( NameServerEnabled )
-            NameServer->ProcessDelete(process_); // in reqQueue thread (CIntChildDeathReq)
+        {
+            int rc = NameServer->ProcessDelete(process_); // in reqQueue thread (CIntChildDeathReq)
+            if (rc)
+            {
+                char la_buf[MON_STRING_BUF_SIZE];
+                snprintf( la_buf, sizeof(la_buf)
+                        , "[%s] - Process delete request to Name Server failed"
+                          "for child process %s (%d, %d:%d)\n"
+                        , method_name
+                        , process_->GetName()
+                        , process_->GetNid()
+                        , process_->GetPid()
+                        , process_->GetVerifier() );
+                mon_log_write(MON_INTREQ_CHILDDEATH_1, SQ_LOG_ERR, la_buf);
+            }
+        }
 #endif
         MyNode->DelFromNameMap ( process_ );
         MyNode->DelFromPidMap ( process_ );

http://git-wip-us.apache.org/repos/asf/trafodion/blob/65ac5563/core/sqf/monitor/linux/tmsync.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/tmsync.cxx b/core/sqf/monitor/linux/tmsync.cxx
index e6e3a76..548ae81 100644
--- a/core/sqf/monitor/linux/tmsync.cxx
+++ b/core/sqf/monitor/linux/tmsync.cxx
@@ -1010,6 +1010,23 @@ void CTmSync_Container::SendUnsolicitedMessages (void)
                     delete msg;
                     msg = NULL;
                 }
+                if (NameServerEnabled)
+                {
+                    if (!MyNode->IsMyNode( tm->GetNid() ))
+                    {
+                        if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+                        {
+                            trace_printf( "%s@%d - Deleting clone process %s, (%d,%d:%d)\n"
+                                        , method_name, __LINE__
+                                        , tm->GetName()
+                                        , tm->GetNid()
+                                        , tm->GetPid()
+                                        , tm->GetVerifier() );
+                        }
+                        Nodes->DeleteCloneProcess( tm );
+                    }
+                
+                }
             }
             else
             {


[37/50] [abbrv] trafodion git commit: Fixes to external requests with Name Server enabled and target process is in a remote node.

Posted by su...@apache.org.
Fixes to external requests with Name Server enabled and target process is in a remote node.


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

Branch: refs/heads/master
Commit: 731fd2d1dc6aa8cbce40bc92a0370d5eed315645
Parents: 1f7eabb
Author: Zalo Correa <za...@esgyn.com>
Authored: Thu May 17 17:05:11 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Thu May 17 17:05:11 2018 -0700

----------------------------------------------------------------------
 core/sqf/monitor/linux/config.cxx    |  20 ++-
 core/sqf/monitor/linux/pnode.cxx     | 246 +++++++++++++++---------------
 core/sqf/monitor/linux/pnode.h       |  10 +-
 core/sqf/monitor/linux/reqdump.cxx   |  88 +++++++++--
 core/sqf/monitor/linux/reqevent.cxx  | 121 ++++++++++-----
 core/sqf/monitor/linux/reqkill.cxx   | 107 ++++++++++---
 core/sqf/monitor/linux/reqnotify.cxx |  27 +---
 core/sqf/monitor/linux/reqopen.cxx   |  10 +-
 core/sqf/monitor/linux/reqqueue.cxx  |  18 +--
 9 files changed, 414 insertions(+), 233 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/731fd2d1/core/sqf/monitor/linux/config.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/config.cxx b/core/sqf/monitor/linux/config.cxx
index db08956..c757e25 100644
--- a/core/sqf/monitor/linux/config.cxx
+++ b/core/sqf/monitor/linux/config.cxx
@@ -246,7 +246,7 @@ void CConfigGroup::NormalizeName (string &name)
 
 void CConfigGroup::SendChangeNotification (CConfigKey *key)
 {
-    CProcess *process;
+    CProcess *targetProcess;
     struct message_def *msg;
 
     const char method_name[] = "CConfigGroup::SendChangeNotification";
@@ -357,16 +357,16 @@ void CConfigGroup::SendChangeNotification (CConfigKey *key)
         
     case ConfigType_Process:
         // check if we need to associate a process
-        Nodes->GetLNode ((char *)name_.c_str(), &process);
-        if ( process )
+        Nodes->GetLNode ((char *)name_.c_str(), &targetProcess);
+        if ( targetProcess )
         {
-            if ( process->IsSystemMessages() && !process->IsClone() )
+            if ( targetProcess->IsSystemMessages() && !targetProcess->IsClone() )
             {
                 if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_INIT))
-                    trace_printf("%s@%d - Sending Configuration Change message to %s\n", method_name, __LINE__, process->GetName());
+                    trace_printf("%s@%d - Sending Configuration Change message to %s\n", method_name, __LINE__, targetProcess->GetName());
 #ifndef NAMESERVER_PROCESS
-                SQ_theLocalIOToClient->putOnNoticeQueue( process->GetPid()
-                                                       , process->GetVerifier()
+                SQ_theLocalIOToClient->putOnNoticeQueue( targetProcess->GetPid()
+                                                       , targetProcess->GetVerifier()
                                                        , msg
                                                        , NULL);
 #endif
@@ -374,7 +374,11 @@ void CConfigGroup::SendChangeNotification (CConfigKey *key)
             else
             {
                 if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_INIT))
-                    trace_printf("%s@%d - Not sending Configuration Change message to %s, system_messages=%d, isClone=%d\n", method_name, __LINE__, process->GetName(), process->IsSystemMessages(), process->IsClone());
+                    trace_printf("%s@%d - Not sending Configuration Change message to %s, system_messages=%d, isClone=%d\n"
+                                , method_name, __LINE__
+                                , targetProcess->GetName()
+                                , targetProcess->IsSystemMessages()
+                                , targetProcess->IsClone());
 
                 delete msg;
             }

http://git-wip-us.apache.org/repos/asf/trafodion/blob/731fd2d1/core/sqf/monitor/linux/pnode.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnode.cxx b/core/sqf/monitor/linux/pnode.cxx
index 0884343..c044100 100644
--- a/core/sqf/monitor/linux/pnode.cxx
+++ b/core/sqf/monitor/linux/pnode.cxx
@@ -2491,6 +2491,131 @@ void CNodeContainer::CancelDeathNotification( int nid
 }
 #endif
    
+#ifndef NAMESERVER_PROCESS
+CProcess *CNodeContainer::CloneProcessNs( int nid
+                                        , int pid
+                                        , Verifier_t verifier )
+{
+    const char method_name[] = "CNodeContainer::CloneProcessNs";
+    TRACE_ENTRY;
+
+    CProcess *process = NULL;
+
+    struct message_def msg;
+    msg.type = MsgType_Service;
+    msg.noreply = false;
+    msg.reply_tag = REPLY_TAG;
+    msg.u.request.type = ReqType_ProcessInfoNs;
+
+    struct ProcessInfo_def *processInfo = &msg.u.request.u.process_info;
+    processInfo->nid = -1;
+    processInfo->pid = -1;
+    processInfo->verifier = -1;
+    processInfo->process_name[0] = 0;
+    processInfo->target_nid = nid;
+    processInfo->target_pid = pid;
+    processInfo->target_verifier = verifier;
+    processInfo->target_process_name[0] = 0;
+    processInfo->target_process_pattern[0] = 0;
+    processInfo->type = ProcessType_Undefined;
+    
+    int error = NameServer->ProcessInfoNs(&msg); // in reqQueue thread (CExternalReq)
+    if (error == 0)
+    {
+        if ( (msg.type == MsgType_Service) &&
+             (msg.u.reply.type == ReplyType_ProcessInfoNs) )
+        {
+            if ( msg.u.reply.u.process_info_ns.return_code == MPI_SUCCESS )
+            {
+                process = AddCloneProcess( &msg.u.reply.u.process_info_ns );
+            }
+            else
+            {
+                char buf[MON_STRING_BUF_SIZE];
+                snprintf( buf, sizeof(buf),
+                          "[%s] ProcessInfo failed, rc=%d\n"
+                        , method_name, msg.u.reply.u.process_info_ns.return_code );
+                mon_log_write( MON_NODE_GETPROCESSNS_1, SQ_LOG_ERR, buf );
+            }
+        }
+        else
+        {
+            char buf[MON_STRING_BUF_SIZE];
+            snprintf( buf, sizeof(buf),
+                      "[%s], Invalid MsgType(%d)/ReplyType(%d) for "
+                      "ProcessInfoNs\n"
+                    , method_name, msg.type, msg.u.reply.type );
+            mon_log_write( MON_NODE_GETPROCESSNS_2, SQ_LOG_ERR, buf );
+        }
+    }
+
+    TRACE_EXIT;
+    return( process );
+}
+#endif
+   
+#ifndef NAMESERVER_PROCESS
+CProcess *CNodeContainer::CloneProcessNs( const char *name, Verifier_t verifier )
+{
+    const char method_name[] = "CNodeContainer::CloneProcessNs";
+    TRACE_ENTRY;
+
+    CProcess *process = NULL;
+
+    struct message_def msg;
+    msg.type = MsgType_Service;
+    msg.noreply = false;
+    msg.reply_tag = REPLY_TAG;
+    msg.u.request.type = ReqType_ProcessInfoNs;
+
+    struct ProcessInfo_def *processInfo = &msg.u.request.u.process_info;
+    processInfo->nid = -1;
+    processInfo->pid = -1;
+    processInfo->verifier = -1;
+    processInfo->process_name[0] = 0;
+    processInfo->target_nid = -1;
+    processInfo->target_pid = -1;
+    processInfo->target_verifier = verifier;
+    STRCPY( processInfo->target_process_name, name);
+    processInfo->target_process_pattern[0] = 0;
+    processInfo->type = ProcessType_Undefined;
+
+    int error = NameServer->ProcessInfoNs(&msg); // in reqQueue thread (CExternalReq)
+    if (error == 0)
+    {
+        if ( (msg.type == MsgType_Service) &&
+             (msg.u.reply.type == ReplyType_ProcessInfoNs) )
+        {
+            if ( msg.u.reply.u.process_info_ns.return_code == MPI_SUCCESS )
+            {
+                process = AddCloneProcess( &msg.u.reply.u.process_info_ns );
+            }
+            else
+            {
+                char buf[MON_STRING_BUF_SIZE];
+                snprintf( buf, sizeof(buf),
+                          "[%s] ProcessInfo failed, rc=%d\n"
+                        , method_name, msg.u.reply.u.process_info_ns.return_code );
+                mon_log_write( MON_NODE_GETPROCESSNS_3, SQ_LOG_ERR, buf );
+            }
+        }
+        else
+        {
+            char buf[MON_STRING_BUF_SIZE];
+            snprintf( buf, sizeof(buf),
+                      "[%s], Invalid MsgType(%d)/ReplyType(%d) for "
+                      "ProcessInfo\n"
+                    , method_name, msg.type, msg.u.reply.type );
+            mon_log_write( MON_NODE_GETPROCESSNS_4, SQ_LOG_ERR, buf );
+        }
+    }
+
+    TRACE_EXIT;
+    return( process );
+}
+#endif
+   
+#ifndef NAMESERVER_PROCESS
 void CNodeContainer::DeleteCloneProcess( CProcess *process )
 {
     const char method_name[] = "CNodeContainer::DeleteCloneProcess";
@@ -2504,6 +2629,7 @@ void CNodeContainer::DeleteCloneProcess( CProcess *process )
 
     TRACE_EXIT;
 }
+#endif
 
 void CNodeContainer::DeletedNode( CNode *node )
 {
@@ -3275,126 +3401,6 @@ CProcess *CNodeContainer::GetProcessLByTypeNs( int nid, PROCESSTYPE type )
     return( process );
 }
 
-CProcess *CNodeContainer::GetProcessNs( int nid
-                                      , int pid
-                                      , Verifier_t verifier )
-{
-    const char method_name[] = "CNodeContainer::GetProcessNs";
-    TRACE_ENTRY;
-
-    CProcess *process = NULL;
-
-    struct message_def msg;
-    msg.type = MsgType_Service;
-    msg.noreply = false;
-    msg.reply_tag = REPLY_TAG;
-    msg.u.request.type = ReqType_ProcessInfoNs;
-
-    struct ProcessInfo_def *processInfo = &msg.u.request.u.process_info;
-    processInfo->nid = -1;
-    processInfo->pid = -1;
-    processInfo->verifier = -1;
-    processInfo->process_name[0] = 0;
-    processInfo->target_nid = nid;
-    processInfo->target_pid = pid;
-    processInfo->target_verifier = verifier;
-    processInfo->target_process_name[0] = 0;
-    processInfo->target_process_pattern[0] = 0;
-    processInfo->type = ProcessType_Undefined;
-    
-    int error = NameServer->ProcessInfoNs(&msg); // in reqQueue thread (CExternalReq)
-    if (error == 0)
-    {
-        if ( (msg.type == MsgType_Service) &&
-             (msg.u.reply.type == ReplyType_ProcessInfoNs) )
-        {
-            if ( msg.u.reply.u.process_info_ns.return_code == MPI_SUCCESS )
-            {
-                process = AddCloneProcess( &msg.u.reply.u.process_info_ns );
-            }
-            else
-            {
-                char buf[MON_STRING_BUF_SIZE];
-                snprintf( buf, sizeof(buf),
-                          "[%s] ProcessInfo failed, rc=%d\n"
-                        , method_name, msg.u.reply.u.process_info_ns.return_code );
-                mon_log_write( MON_NODE_GETPROCESSNS_1, SQ_LOG_ERR, buf );
-            }
-        }
-        else
-        {
-            char buf[MON_STRING_BUF_SIZE];
-            snprintf( buf, sizeof(buf),
-                      "[%s], Invalid MsgType(%d)/ReplyType(%d) for "
-                      "ProcessInfoNs\n"
-                    , method_name, msg.type, msg.u.reply.type );
-            mon_log_write( MON_NODE_GETPROCESSNS_2, SQ_LOG_ERR, buf );
-        }
-    }
-
-    TRACE_EXIT;
-    return( process );
-}
-
-CProcess *CNodeContainer::GetProcessNs( const char *name, Verifier_t verifier )
-{
-    const char method_name[] = "CNodeContainer::GetProcessNs";
-    TRACE_ENTRY;
-
-    CProcess *process = NULL;
-
-    struct message_def msg;
-    msg.type = MsgType_Service;
-    msg.noreply = false;
-    msg.reply_tag = REPLY_TAG;
-    msg.u.request.type = ReqType_ProcessInfoNs;
-
-    struct ProcessInfo_def *processInfo = &msg.u.request.u.process_info;
-    processInfo->nid = -1;
-    processInfo->pid = -1;
-    processInfo->verifier = -1;
-    processInfo->process_name[0] = 0;
-    processInfo->target_nid = -1;
-    processInfo->target_pid = -1;
-    processInfo->target_verifier = verifier;
-    STRCPY( processInfo->target_process_name, name);
-    processInfo->target_process_pattern[0] = 0;
-    processInfo->type = ProcessType_Undefined;
-
-    int error = NameServer->ProcessInfoNs(&msg); // in reqQueue thread (CExternalReq)
-    if (error == 0)
-    {
-        if ( (msg.type == MsgType_Service) &&
-             (msg.u.reply.type == ReplyType_ProcessInfoNs) )
-        {
-            if ( msg.u.reply.u.process_info_ns.return_code == MPI_SUCCESS )
-            {
-                process = AddCloneProcess( &msg.u.reply.u.process_info_ns );
-            }
-            else
-            {
-                char buf[MON_STRING_BUF_SIZE];
-                snprintf( buf, sizeof(buf),
-                          "[%s] ProcessInfo failed, rc=%d\n"
-                        , method_name, msg.u.reply.u.process_info_ns.return_code );
-                mon_log_write( MON_NODE_GETPROCESSNS_3, SQ_LOG_ERR, buf );
-            }
-        }
-        else
-        {
-            char buf[MON_STRING_BUF_SIZE];
-            snprintf( buf, sizeof(buf),
-                      "[%s], Invalid MsgType(%d)/ReplyType(%d) for "
-                      "ProcessInfo\n"
-                    , method_name, msg.type, msg.u.reply.type );
-            mon_log_write( MON_NODE_GETPROCESSNS_4, SQ_LOG_ERR, buf );
-        }
-    }
-
-    TRACE_EXIT;
-    return( process );
-}
-
 SyncState CNodeContainer::GetTmState ( SyncState check_state )
 {
     SyncState state = check_state;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/731fd2d1/core/sqf/monitor/linux/pnode.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnode.h b/core/sqf/monitor/linux/pnode.h
index dafee70..fbfddf4 100644
--- a/core/sqf/monitor/linux/pnode.h
+++ b/core/sqf/monitor/linux/pnode.h
@@ -78,6 +78,11 @@ public:
                                    , int verifier
                                    , _TM_Txid_External trans_id );
     void    ChangedNode( CNode *node );
+    CProcess *CloneProcessNs( int nid
+                            , int pid
+                            , Verifier_t verifier );
+    CProcess *CloneProcessNs( const char *name
+                            , Verifier_t verifier );
     void    DeleteCloneProcess( CProcess *process );
     void    DeletedNode( CNode *node );
     bool    DeleteNode( int pnid );
@@ -124,11 +129,6 @@ public:
                             , ProcessInfoNs_reply_def *processInfo );
     CProcess *GetProcessLByTypeNs( int nid
                                  , PROCESSTYPE type );
-    CProcess *GetProcessNs( int nid
-                          , int pid
-                          , Verifier_t verifier );
-    CProcess *GetProcessNs( const char *name
-                          , Verifier_t verifier );
     SyncState GetTmState( SyncState check_state );
     CNode  *GetZoneNode( int zid );
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/731fd2d1/core/sqf/monitor/linux/reqdump.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqdump.cxx b/core/sqf/monitor/linux/reqdump.cxx
index 4e56bb5..5d2dd5e 100644
--- a/core/sqf/monitor/linux/reqdump.cxx
+++ b/core/sqf/monitor/linux/reqdump.cxx
@@ -32,6 +32,7 @@
 extern CMonStats *MonStats;
 extern CNode *MyNode;
 extern CNodeContainer *Nodes;
+extern bool NameServerEnabled;
 
 CExtDumpReq::CExtDumpReq (reqQueueMsg_t msgType, int pid,
                           struct message_def *msg )
@@ -73,8 +74,9 @@ void CExtDumpReq::performRequest()
     const char method_name[] = "CExtDumpReq::performRequest";
     TRACE_ENTRY;
 
-    CProcess *target;
-    CProcess *requester;
+    CProcess *cloneProcess = NULL;
+    CProcess *targetProcess = NULL;
+    CProcess *requester = NULL;
     CLNode   *lnode;
     string    target_process_name;
     int       target_nid = -1;
@@ -127,28 +129,76 @@ void CExtDumpReq::performRequest()
     {
         if ( target_process_name.size() )
         { // find by name
-            target = Nodes->GetProcess( target_process_name.c_str()
-                                      , target_verifier );
+            targetProcess = Nodes->GetProcess( target_process_name.c_str()
+                                             , target_verifier );
         }
         else
         { // find by nid, pid
-            target = Nodes->GetProcess( target_nid
-                                      , target_pid
-                                      , target_verifier );
+            targetProcess = Nodes->GetProcess( target_nid
+                                             , target_pid
+                                             , target_verifier );
         }
 
-        if ( target )
+        if ( !targetProcess )
+        {
+            if (NameServerEnabled)
+            {
+                if ( target_process_name.size() )
+                { // Name Server find by name:verifier
+                    if (trace_settings & TRACE_REQUEST)
+                    {
+                        trace_printf( "%s@%d" " - Getting targetProcess from Name Server (%s:%d)" "\n"
+                                    , method_name, __LINE__
+                                    , target_process_name.c_str()
+                                    , target_verifier );
+                    }
+                    cloneProcess = Nodes->CloneProcessNs( target_process_name.c_str()
+                                                        , target_verifier );
+                    targetProcess = cloneProcess;
+                }     
+                else
+                { // Name Server find by nid,pid:verifier
+                    if (trace_settings & TRACE_REQUEST)
+                    {
+                        trace_printf( "%s@%d" " - Getting targetProcess from Name Server (%d,%d:%d)\n"
+                                    , method_name, __LINE__
+                                    , target_nid
+                                    , target_pid
+                                    , target_verifier );
+                    }
+                    cloneProcess = Nodes->CloneProcessNs( target_nid
+                                                        , target_pid
+                                                        , target_verifier );
+                    targetProcess = cloneProcess;
+                }
+                if (targetProcess)
+                {
+                    if (trace_settings & TRACE_REQUEST)
+                        trace_printf( "%s@%d - Found targetProcess %s (%d,%d:%d), clone=%d\n"
+                                    , method_name, __LINE__
+                                    , targetProcess->GetName()
+                                    , targetProcess->GetNid()
+                                    , targetProcess->GetPid()
+                                    , targetProcess->GetVerifier()
+                                    , targetProcess->IsClone() );
+                }
+            }
+        }
+
+        if ( targetProcess )
         {
             if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
                 trace_printf("%s@%d - Dump Process name=%s, nid=%d, pid=%d\n",
-                             method_name, __LINE__, target->GetName(),
-                             target->GetNid(), target->GetPid());
-            target->parentContext(msg_);
+                             method_name, __LINE__, targetProcess->GetName(),
+                             targetProcess->GetNid(), targetProcess->GetPid());
+            targetProcess->parentContext(msg_);
             lnode = Nodes->GetLNode(target_nid);
             if (lnode->Dump_Process(requester,
-                                    target,
+                                    targetProcess,
                                     msg_->u.request.u.dump.path) != SUCCESS)
+            {
                 rc = MPI_ERR_SPAWN;
+            }
         }
         else
         {
@@ -163,6 +213,20 @@ void CExtDumpReq::performRequest()
             // Otherwise the dump has been initiated and reply will be sent
             // upon completion.
 
+            if (NameServerEnabled && cloneProcess)
+            {
+                if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+                {
+                    trace_printf( "%s@%d - Deleting clone process %s, (%d,%d:%d)\n"
+                                , method_name, __LINE__
+                                , cloneProcess->GetName()
+                                , cloneProcess->GetNid()
+                                , cloneProcess->GetPid()
+                                , cloneProcess->GetVerifier() );
+                }
+                Nodes->DeleteCloneProcess( cloneProcess );
+            }
+
             if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
                 trace_printf("%s@%d - Unsuccessful rc=%d\n", method_name, __LINE__, rc);
             // build reply

http://git-wip-us.apache.org/repos/asf/trafodion/blob/731fd2d1/core/sqf/monitor/linux/reqevent.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqevent.cxx b/core/sqf/monitor/linux/reqevent.cxx
index 422c861..01c9067 100644
--- a/core/sqf/monitor/linux/reqevent.cxx
+++ b/core/sqf/monitor/linux/reqevent.cxx
@@ -32,6 +32,7 @@
 extern CMonStats *MonStats;
 extern CNode *MyNode;
 extern CNodeContainer *Nodes;
+extern bool NameServerEnabled;
 
 CExtEventReq::CExtEventReq (reqQueueMsg_t msgType, int pid,
                             struct message_def *msg )
@@ -85,7 +86,8 @@ void CExtEventReq::performRequest()
     int pid;
     int num_procs;
     PROCESSTYPE type;
-    CProcess *process = NULL;
+    CProcess *cloneProcess = NULL;
+    CProcess *targetProcess = NULL;
     CProcess *requester;
 
     // Record statistics (sonar counters)
@@ -134,7 +136,7 @@ void CExtEventReq::performRequest()
 
         // Only monitor can send events to SQWatchdog process
         if ( type != ProcessType_Watchdog )
-        { // Only monitor can send events to SQWatchdog process
+        {
             if (msg_->u.request.u.event.target_nid == -1)
             {
                 if (trace_settings & TRACE_REQUEST)
@@ -161,50 +163,84 @@ void CExtEventReq::performRequest()
 
                 if ( target_process_name.size() )
                 { // find by name
-                    process = Nodes->GetProcess( target_process_name.c_str()
-                                               , target_verifier );
-                    if ( process && trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+                    targetProcess = Nodes->GetProcess( target_process_name.c_str()
+                                                     , target_verifier );
+                    if ( !targetProcess )
+                    {
+                        if (NameServerEnabled)
+                        { // Name Server find by name:verifier
+                            if (trace_settings & TRACE_REQUEST)
+                            {
+                                trace_printf( "%s@%d" " - Getting targetProcess from Name Server (%s:%d)" "\n"
+                                            , method_name, __LINE__
+                                            , target_process_name.c_str()
+                                            , target_verifier );
+                            }
+                            cloneProcess = Nodes->CloneProcessNs( target_process_name.c_str()
+                                                                , target_verifier );
+                            targetProcess = cloneProcess;
+                        }     
+                    }
+                    if ( targetProcess && trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
                     {
                         trace_printf( "%s@%d - Found target by name %s (%d, %d:%d)\n"
                                     , method_name, __LINE__
-                                    , process->GetName()
-                                    , process->GetNid()
-                                    , process->GetPid()
-                                    , process->GetVerifier());
+                                    , targetProcess->GetName()
+                                    , targetProcess->GetNid()
+                                    , targetProcess->GetPid()
+                                    , targetProcess->GetVerifier());
                     }
-                    pid = process ? process->GetPid() : -1;
+                    pid = targetProcess ? targetProcess->GetPid() : -1;
                 }
                 else if (pid == -1)
                 { // get info for all processes in node
-                    process = Nodes->GetLNode(nid)->GetFirstProcess();
-                    if ( process && trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+                    targetProcess = Nodes->GetLNode(nid)->GetFirstProcess();
+                    if ( targetProcess && trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
                     {
                         trace_printf( "%s@%d - Found target first process %s (%d, %d:%d)\n"
                                     , method_name, __LINE__
-                                    , process->GetName()
-                                    , process->GetNid()
-                                    , process->GetPid()
-                                    , process->GetVerifier());
+                                    , targetProcess->GetName()
+                                    , targetProcess->GetNid()
+                                    , targetProcess->GetPid()
+                                    , targetProcess->GetVerifier());
                     }
                 }
                 else
                 { // get info for single process in node by pid
-                    process = Nodes->GetProcess( target_nid
-                                               , pid
-                                               , target_verifier );
-                    if ( process && trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+                    targetProcess = Nodes->GetProcess( target_nid
+                                                     , pid
+                                                     , target_verifier );
+                    if ( !targetProcess )
+                    {
+                        if (NameServerEnabled)
+                        { // Name Server find by nid,pid:verifier
+                            if (trace_settings & TRACE_REQUEST)
+                            {
+                                trace_printf( "%s@%d" " - Getting targetProcess from Name Server (%d,%d:%d)\n"
+                                            , method_name, __LINE__
+                                            , target_nid
+                                            , pid
+                                            , target_verifier );
+                            }
+                            cloneProcess = Nodes->CloneProcessNs( target_nid
+                                                                , pid
+                                                                , target_verifier );
+                            targetProcess = cloneProcess;
+                        }
+                    }
+                    if ( targetProcess && trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
                     {
                         trace_printf( "%s@%d - Found target by nid,pid %s (%d, %d:%d)\n"
                                     , method_name, __LINE__
-                                    , process->GetName()
-                                    , process->GetNid()
-                                    , process->GetPid()
-                                    , process->GetVerifier());
+                                    , targetProcess->GetName()
+                                    , targetProcess->GetNid()
+                                    , targetProcess->GetPid()
+                                    , targetProcess->GetVerifier());
                     }
                 }
             }
             
-            if ( !process && target_nid != -1 && 
+            if ( !targetProcess && target_nid != -1 && 
                  (trace_settings & (TRACE_REQUEST | TRACE_PROCESS)))
                 trace_printf("%s@%d" " - Target process not found! %s (%d, %d:%d)\n"
                             , method_name, __LINE__
@@ -220,36 +256,49 @@ void CExtEventReq::performRequest()
             {
                 if (target_nid == -1)
                 {
-                    process = lnode->GetFirstProcess();
+                    targetProcess = lnode->GetFirstProcess();
                 }
-                while (process && num_procs < MAX_PROC_LIST)
+                while (targetProcess && num_procs < MAX_PROC_LIST)
                 {
-                    if (pid == -1 || process->GetPid() == pid)
+                    if (pid == -1 || targetProcess->GetPid() == pid)
                     {
-                        if ( process->GetType() != ProcessType_Watchdog )
+                        if ( targetProcess->GetType() != ProcessType_Watchdog )
                         {
-                            if (type == ProcessType_Undefined || type == process->GetType())
+                            if (type == ProcessType_Undefined || type == targetProcess->GetType())
                             {
-                                process->GenerateEvent( msg_->u.request.u.event.event_id,
+                                targetProcess->GenerateEvent( msg_->u.request.u.event.event_id,
                                                         msg_->u.request.u.event.length,
                                                         msg_->u.request.u.event.data );
                                 if (trace_settings & TRACE_REQUEST)
                                     trace_printf( "%s@%d - Event %d sent to %s (%d, %d:%d)\n"
                                                 , method_name, __LINE__
                                                 , msg_->u.request.u.event.event_id
-                                                , process->GetName()
-                                                , process->GetNid()
-                                                , process->GetPid()
-                                                , process->GetVerifier());
+                                                , targetProcess->GetName()
+                                                , targetProcess->GetNid()
+                                                , targetProcess->GetPid()
+                                                , targetProcess->GetVerifier());
                                 rc = MPI_SUCCESS;
                             }
                         }
                     }
                     else
                     {
+                        if (NameServerEnabled && cloneProcess)
+                        {
+                            if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+                            {
+                                trace_printf( "%s@%d - Deleting clone process %s, (%d,%d:%d)\n"
+                                            , method_name, __LINE__
+                                            , cloneProcess->GetName()
+                                            , cloneProcess->GetNid()
+                                            , cloneProcess->GetPid()
+                                            , cloneProcess->GetVerifier() );
+                            }
+                            Nodes->DeleteCloneProcess( cloneProcess );
+                        }
                         break;
                     }
-                    process = process->GetNextL();
+                    targetProcess = targetProcess->GetNextL();
                 }
             }
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/731fd2d1/core/sqf/monitor/linux/reqkill.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqkill.cxx b/core/sqf/monitor/linux/reqkill.cxx
index ee88a19..e8cad71 100644
--- a/core/sqf/monitor/linux/reqkill.cxx
+++ b/core/sqf/monitor/linux/reqkill.cxx
@@ -138,7 +138,8 @@ void CExtKillReq::Kill( CProcess *process )
 void CExtKillReq::performRequest()
 {
     bool status = FAILURE;
-    CProcess *process = NULL;
+    CProcess *cloneProcess = NULL;
+    CProcess *targetProcess = NULL;
     CProcess *backup = NULL;
 
     const char method_name[] = "CExtKillReq::performRequest";
@@ -195,41 +196,113 @@ void CExtKillReq::performRequest()
     {
         if ( target_process_name.size() )
         { // find by name (check node state, don't check process state, not backup)
-            process = Nodes->GetProcess( target_process_name.c_str()
-                                       , target_verifier
-                                       , true, false, false );
-            if ( process &&
+            targetProcess = Nodes->GetProcess( target_process_name.c_str()
+                                              , target_verifier
+                                              , true, false, false );
+            if ( targetProcess &&
                 (msg_->u.request.u.kill.target_nid == -1 ||
                  msg_->u.request.u.kill.target_pid == -1))
             {
-                backup = process->GetBackup ();
+                backup = targetProcess->GetBackup ();
             }
         }
         else
         { // find by nid (check node state, don't check process state, backup is Ok)
-            process = Nodes->GetProcess( target_nid
-                                       , target_pid
-                                       , target_verifier
-                                       , true, false, true );
+            targetProcess = Nodes->GetProcess( target_nid
+                                             , target_pid
+                                             , target_verifier
+                                             , true, false, true );
             backup = NULL;
         }
 
+        if ( targetProcess )
+        {
+            if (trace_settings & TRACE_REQUEST)
+            {
+                trace_printf( "%s@%d - Found targetProcess %s (%d,%d:%d), clone=%d\n"
+                            , method_name, __LINE__
+                            , targetProcess->GetName()
+                            , targetProcess->GetNid()
+                            , targetProcess->GetPid()
+                            , targetProcess->GetVerifier()
+                            , targetProcess->IsClone() );
+            }
+        }
+        else
+        {
+            if (NameServerEnabled)
+            {
+                if ( target_process_name.size() )
+                { // Name Server find by name:verifier
+                    if (trace_settings & TRACE_REQUEST)
+                    {
+                        trace_printf( "%s@%d" " - Getting targetProcess from Name Server (%s:%d)" "\n"
+                                    , method_name, __LINE__
+                                    , target_process_name.c_str()
+                                    , target_verifier );
+                    }
+                    cloneProcess = Nodes->CloneProcessNs( target_process_name.c_str()
+                                                        , target_verifier );
+                    targetProcess = cloneProcess;
+                }     
+                else
+                { // Name Server find by nid,pid:verifier
+                    if (trace_settings & TRACE_REQUEST)
+                    {
+                        trace_printf( "%s@%d" " - Getting targetProcess from Name Server (%d,%d:%d)\n"
+                                    , method_name, __LINE__
+                                    , target_nid
+                                    , target_pid
+                                    , target_verifier );
+                    }
+                    cloneProcess = Nodes->CloneProcessNs( target_nid
+                                                        , target_pid
+                                                        , target_verifier );
+                    targetProcess = cloneProcess;
+                }
+                if (targetProcess)
+                {
+                    if (trace_settings & TRACE_REQUEST)
+                        trace_printf( "%s@%d - Found targetProcess %s (%d,%d:%d), clone=%d\n"
+                                    , method_name, __LINE__
+                                    , targetProcess->GetName()
+                                    , targetProcess->GetNid()
+                                    , targetProcess->GetPid()
+                                    , targetProcess->GetVerifier()
+                                    , targetProcess->IsClone() );
+                }
+            }
+        }
 
-        if (process)
+        if (targetProcess)
         {
-            process->SetAbort( msg_->u.request.u.kill.persistent_abort );
+            targetProcess->SetAbort( msg_->u.request.u.kill.persistent_abort );
             if (backup)
             {
                 // We are killing both the primary and backup processes
                 Kill( backup );
             }
-            Kill( process );
+            Kill( targetProcess );
+
+            if (NameServerEnabled && cloneProcess)
+            {
+                if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+                {
+                    trace_printf( "%s@%d - Deleting clone process %s, (%d,%d:%d)\n"
+                                , method_name, __LINE__
+                                , cloneProcess->GetName()
+                                , cloneProcess->GetNid()
+                                , cloneProcess->GetPid()
+                                , cloneProcess->GetVerifier() );
+                }
+                Nodes->DeleteCloneProcess( cloneProcess );
+            }
 
             msg_->u.reply.type = ReplyType_Generic;
-            msg_->u.reply.u.generic.nid = process->GetNid();
-            msg_->u.reply.u.generic.pid = process->GetPid();
-            msg_->u.reply.u.generic.verifier = process->GetVerifier();
-            strcpy (msg_->u.reply.u.generic.process_name, process->GetName());
+            msg_->u.reply.u.generic.nid = targetProcess->GetNid();
+            msg_->u.reply.u.generic.pid = targetProcess->GetPid();
+            msg_->u.reply.u.generic.verifier = targetProcess->GetVerifier();
+            strcpy (msg_->u.reply.u.generic.process_name, targetProcess->GetName());
             msg_->u.reply.u.generic.return_code = MPI_SUCCESS;
             status = SUCCESS;
         }

http://git-wip-us.apache.org/repos/asf/trafodion/blob/731fd2d1/core/sqf/monitor/linux/reqnotify.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqnotify.cxx b/core/sqf/monitor/linux/reqnotify.cxx
index 6dc43fc..5900f01 100644
--- a/core/sqf/monitor/linux/reqnotify.cxx
+++ b/core/sqf/monitor/linux/reqnotify.cxx
@@ -215,14 +215,7 @@ void CExtNotifyReq::performRequest()
             }
             else
             {
-                if (!NameServerEnabled)
-                {
-                    if (trace_settings & TRACE_REQUEST)
-                    {
-                        trace_printf("%s@%d - Can't find targetProcess\n", method_name, __LINE__);
-                    }
-                }
-                else
+                if (NameServerEnabled)
                 {
                     if ( target_process_name.size() )
                     { // Name Server find by name:verifier
@@ -233,8 +226,8 @@ void CExtNotifyReq::performRequest()
                                         , target_process_name.c_str()
                                         , target_verifier );
                         }
-                        targetProcess = Nodes->GetProcessNs( target_process_name.c_str()
-                                                           , target_verifier );
+                        targetProcess = Nodes->CloneProcessNs( target_process_name.c_str()
+                                                             , target_verifier );
                     }     
                     else
                     { // Name Server find by nid,pid:verifier
@@ -246,9 +239,9 @@ void CExtNotifyReq::performRequest()
                                         , target_pid
                                         , target_verifier );
                         }
-                        targetProcess = Nodes->GetProcessNs( target_nid
-                                                           , target_pid
-                                                           , target_verifier );
+                        targetProcess = Nodes->CloneProcessNs( target_nid
+                                                             , target_pid
+                                                             , target_verifier );
                     }
                     if (targetProcess)
                     {
@@ -261,14 +254,6 @@ void CExtNotifyReq::performRequest()
                                         , targetProcess->GetVerifier()
                                         , targetProcess->IsClone() );
                     }
-                    else
-                    {
-                        trace_printf( "%s@%d" " - Can't find targetProcess (%d,%d:%d)\n"
-                                    , method_name, __LINE__
-                                    , target_nid
-                                    , target_pid
-                                    , target_verifier );
-                    }
                 }
             }
             

http://git-wip-us.apache.org/repos/asf/trafodion/blob/731fd2d1/core/sqf/monitor/linux/reqopen.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqopen.cxx b/core/sqf/monitor/linux/reqopen.cxx
index 379049f..f131a08 100644
--- a/core/sqf/monitor/linux/reqopen.cxx
+++ b/core/sqf/monitor/linux/reqopen.cxx
@@ -291,8 +291,8 @@ bool CExtOpenReq::prepare()
                                 , method_name, __LINE__
                                 , target_process_name.c_str()
                                 , target_verifier );
-                openedProcess = Nodes->GetProcessNs( target_process_name.c_str()
-                                                   , target_verifier );
+                openedProcess = Nodes->CloneProcessNs( target_process_name.c_str()
+                                                     , target_verifier );
             }     
             else
             { // Name Server find by nid,pid:verifier
@@ -302,9 +302,9 @@ bool CExtOpenReq::prepare()
                                 , target_nid
                                 , target_pid
                                 , target_verifier );
-                openedProcess = Nodes->GetProcessNs( target_nid
-                                                   , target_pid
-                                                   , target_verifier );
+                openedProcess = Nodes->CloneProcessNs( target_nid
+                                                     , target_pid
+                                                     , target_verifier );
             }
         }
         

http://git-wip-us.apache.org/repos/asf/trafodion/blob/731fd2d1/core/sqf/monitor/linux/reqqueue.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqqueue.cxx b/core/sqf/monitor/linux/reqqueue.cxx
index b10716c..508a325 100644
--- a/core/sqf/monitor/linux/reqqueue.cxx
+++ b/core/sqf/monitor/linux/reqqueue.cxx
@@ -1584,9 +1584,9 @@ void CIntNewProcReq::performRequest()
                                 , parentNid_
                                 , parentPid_
                                 , parentVerifier_ );
-                parentProcess = Nodes->GetProcessNs( parentNid_
-                                                   , parentPid_
-                                                   , parentVerifier_ );
+                parentProcess = Nodes->CloneProcessNs( parentNid_
+                                                     , parentPid_
+                                                     , parentVerifier_ );
             }
         }
     }
@@ -1964,9 +1964,9 @@ void CIntNotifyReq::performRequest()
                             , pid_
                             , verifier_ );
             }
-            sourceProcess = Nodes->GetProcessNs( nid_
-                                               , pid_
-                                               , verifier_ );
+            sourceProcess = Nodes->CloneProcessNs( nid_
+                                                 , pid_
+                                                 , verifier_ );
             if (sourceProcess)
             {
                 if (trace_settings & TRACE_REQUEST)
@@ -2037,9 +2037,9 @@ void CIntNotifyReq::performRequest()
                                 , targetPid_
                                 , targetVerifier_ );
                 }
-                targetProcess = Nodes->GetProcessNs( targetNid_
-                                                   , targetPid_
-                                                   , targetVerifier_ );
+                targetProcess = Nodes->CloneProcessNs( targetNid_
+                                                     , targetPid_
+                                                     , targetVerifier_ );
                 if (targetProcess)
                 {
                     if (trace_settings & TRACE_REQUEST)


[49/50] [abbrv] trafodion git commit: Merge branch 'master' into TRAFODION-2884

Posted by su...@apache.org.
Merge branch 'master' into TRAFODION-2884

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

Branch: refs/heads/master
Commit: 87210a56c0b209253f54ba1957c826afda3b9f7c
Parents: 46bba63 5b5ab32
Author: Zalo Correa <za...@esgyn.com>
Authored: Fri Jun 15 17:15:45 2018 -0600
Committer: GitHub <no...@github.com>
Committed: Fri Jun 15 17:15:45 2018 -0600

----------------------------------------------------------------------
 .../jdbc/t4/CONNECTION_CONTEXT_def.java         |    1 +
 .../jdbc/t4/InitializeDialogueMessage.java      |    3 +-
 .../trafodion/jdbc/t4/InterfaceConnection.java  |    7 +-
 .../trafodion/jdbc/t4/InterfaceResultSet.java   |  103 +-
 .../org/trafodion/jdbc/t4/T4DSProperties.java   |    3 +
 .../org/trafodion/jdbc/t4/T4Properties.java     |   32 +-
 .../java/org/trafodion/jdbc/t4/TRANSPORT.java   |    1 +
 .../org/trafodion/jdbc/t4/TrafT4Statement.java  |    4 +-
 core/conn/odbc/src/odbc/Common/Global.h         |    3 +
 .../odbc/Krypton/generated_incs/odbcCommon.h    |    1 +
 .../src/odbc/nsksrvr/Interface/odbcs_srvr.cpp   |    1 +
 core/conn/odbc/src/odbc/nsksrvr/SrvrConnect.cpp |    1 +
 .../odbc/src/odbc/nsksrvrcore/srvrothers.cpp    |  137 +-
 core/conn/trafci/install/Installer.java-tmpl    |    8 +
 core/sqf/export/include/seabed/int/thread.inl   |    3 +
 core/sqf/sql/scripts/install_local_hadoop       |   22 +-
 core/sqf/src/seatrans/hbase-trx/pom.xml.cdh54   |    1 +
 core/sqf/src/seatrans/hbase-trx/pom.xml.cdh55   |    1 +
 core/sqf/src/seatrans/hbase-trx/pom.xml.cdh57   |    1 +
 core/sqf/src/seatrans/hbase-trx/pom.xml.hdp     |    1 +
 core/sqf/src/seatrans/hbase-trx/pom.xml.hdp2_1  |    1 +
 core/sqf/src/seatrans/hbase-trx/pom.xml.mapr    |  334 ----
 core/sqf/src/trafconf/Makefile                  |    3 +
 core/sqf/src/trafconf/tctrace.h                 |    2 +-
 core/sql/bin/SqlciErrors.txt                    |   13 +-
 core/sql/cli/Cli.cpp                            |   15 +
 core/sql/cli/Cli.h                              |    8 +-
 core/sql/cli/CliExtern.cpp                      |  122 ++
 core/sql/cli/Context.cpp                        |   86 +
 core/sql/cli/Context.h                          |    6 +-
 core/sql/cli/SessionDefaults.cpp                |    4 +-
 core/sql/comexe/ComTdbExeUtil.cpp               |   15 -
 core/sql/comexe/ComTdbExeUtil.h                 |   27 +-
 core/sql/common/ComAnsiNamePart.cpp             |   24 +
 core/sql/common/ComAnsiNamePart.h               |    2 +
 core/sql/common/ComObjectName.cpp               |    7 +-
 core/sql/common/NAString.cpp                    |   27 +-
 core/sql/common/NAType.cpp                      |   10 +-
 core/sql/common/OperTypeEnum.h                  |    4 +
 core/sql/executor/ExComTdb.cpp                  |    1 -
 core/sql/executor/ExExeUtil.h                   |   55 +-
 core/sql/executor/ExExeUtilGet.cpp              |  244 ++-
 core/sql/executor/ExExeUtilLoad.cpp             |   70 +-
 core/sql/executor/ExExeUtilMisc.cpp             |   39 -
 core/sql/executor/HiveClient_JNI.cpp            |    3 +-
 core/sql/executor/JavaObjectInterface.cpp       |   43 +-
 core/sql/executor/JavaObjectInterface.h         |    8 +-
 core/sql/executor/hiveHook.cpp                  |   14 +-
 core/sql/exp/ExpErrorEnums.h                    |    1 +
 core/sql/exp/ExpLOB.cpp                         |  131 +-
 core/sql/exp/ExpLOB.h                           |   15 +-
 core/sql/exp/ExpLOBenums.h                      |    2 +-
 core/sql/exp/ExpLOBexternal.h                   |    4 +-
 core/sql/exp/ExpPCodeClauseGen.cpp              |    4 +
 core/sql/exp/exp_bignum.cpp                     |   14 +
 core/sql/exp/exp_clause.cpp                     |    3 +
 core/sql/exp/exp_clause_derived.h               |   14 +-
 core/sql/export/ComDiags.cpp                    |    1 +
 core/sql/generator/GenExpGenerator.cpp          |    2 +
 core/sql/generator/GenExpGenerator.h            |    9 +-
 core/sql/generator/GenExplain.cpp               |   25 +-
 core/sql/generator/GenFastTransport.cpp         |    6 +
 core/sql/generator/GenItemExpr.cpp              |    2 +
 core/sql/generator/GenItemFunc.cpp              |   10 +-
 core/sql/generator/GenPreCode.cpp               |    8 +-
 core/sql/generator/GenRelExeUtil.cpp            |   40 +-
 core/sql/generator/GenRelScan.cpp               |    4 +
 core/sql/generator/Generator.h                  |    2 +-
 core/sql/optimizer/BindItemExpr.cpp             |  157 +-
 core/sql/optimizer/BindRelExpr.cpp              |    5 +-
 core/sql/optimizer/ItemFunc.h                   |    3 +
 core/sql/optimizer/NATable.cpp                  |   31 +-
 core/sql/optimizer/NATable.h                    |   42 +-
 core/sql/optimizer/NormRelExpr.cpp              |   18 +-
 core/sql/optimizer/RelExeUtil.cpp               |   92 +-
 core/sql/optimizer/RelExeUtil.h                 |   11 +-
 core/sql/optimizer/RelExpr.cpp                  |    4 +-
 core/sql/optimizer/RelMisc.h                    |    2 +
 core/sql/optimizer/ValueDesc.cpp                |   27 +-
 core/sql/optimizer/hiveHook.h                   |   16 +
 core/sql/parser/AllStmtDDL.h                    |    2 +
 core/sql/parser/ElemDDLConstraintPK.h           |   23 +-
 core/sql/parser/ElemDDLLikeOptions.cpp          |   30 +
 core/sql/parser/ElemDDLLikeOptions.h            |   33 +
 core/sql/parser/ElemDDLNode.cpp                 |    6 +
 core/sql/parser/ElemDDLNode.h                   |    6 +-
 core/sql/parser/ParDDLLikeOpts.cpp              |   15 +
 core/sql/parser/ParDDLLikeOptsCreateTable.h     |   14 +
 core/sql/parser/ParKeyWords.cpp                 |    2 -
 core/sql/parser/SqlParserAux.cpp                |   75 +-
 core/sql/parser/SqlParserAux.h                  |   14 +-
 core/sql/parser/StmtDDLCleanupObjects.h         |    4 +-
 core/sql/parser/StmtDDLCreate.cpp               |   35 +-
 core/sql/parser/StmtDDLCreateTable.h            |   14 +
 core/sql/parser/StmtDDLCreateView.h             |    7 +
 core/sql/parser/StmtDDLDrop.cpp                 |    3 +-
 core/sql/parser/StmtDDLDropView.h               |    6 +
 core/sql/parser/StmtDDLMisc.cpp                 |    2 -
 core/sql/parser/StmtDDLRegOrUnregHive.cpp       |    4 +-
 core/sql/parser/StmtDDLRegOrUnregHive.h         |    6 +-
 core/sql/parser/StmtDDLonHiveObjects.h          |  191 +++
 core/sql/parser/sqlparser.y                     | 1163 +++++++------
 core/sql/parser/ulexer.cpp                      |   25 +-
 .../sql/regress/compGeneral/DIFF006.KNOWN.SB.OS |   12 -
 core/sql/regress/compGeneral/EXPECTED006.SB     |   53 +-
 core/sql/regress/compGeneral/EXPECTEDTOK        |    7 +-
 core/sql/regress/compGeneral/EXPECTEDTOK2       |    7 +-
 core/sql/regress/compGeneral/TEST006            |    1 +
 core/sql/regress/core/EXPECTED002.LINUX         |   15 +
 core/sql/regress/core/EXPECTED037.SB            |   39 +-
 core/sql/regress/core/EXPECTED056.SB            |    6 +
 core/sql/regress/core/EXPECTED116               |  197 ++-
 core/sql/regress/core/TEST002                   |    5 +
 core/sql/regress/core/TEST037                   |   20 +
 core/sql/regress/core/TEST056                   |    2 +
 core/sql/regress/executor/EXPECTED016.SB        |   20 +-
 core/sql/regress/executor/EXPECTED020           |    4 +
 core/sql/regress/executor/EXPECTED063           |   24 +-
 core/sql/regress/executor/EXPECTED122           |   27 +-
 core/sql/regress/executor/TEST016               |    7 +-
 core/sql/regress/executor/TEST063               |    2 +-
 core/sql/regress/executor/TEST122               |    5 +-
 core/sql/regress/hive/DIFF003.KNOWN             |   10 +-
 core/sql/regress/hive/DIFF008.KNOWN             |    7 +
 core/sql/regress/hive/DIFF009.KNOWN             |    3 +
 core/sql/regress/hive/EXPECTED003               |    2 +-
 core/sql/regress/hive/EXPECTED005               |  189 ++-
 core/sql/regress/hive/EXPECTED007               |  314 +++-
 core/sql/regress/hive/EXPECTED008               | 1108 ++++++++++++
 core/sql/regress/hive/EXPECTED009               |   96 +-
 core/sql/regress/hive/EXPECTED018               |  840 ++++++----
 core/sql/regress/hive/FILTER005                 |    1 +
 core/sql/regress/hive/FILTER008                 |   35 +
 core/sql/regress/hive/TEST003                   |    2 +-
 core/sql/regress/hive/TEST005                   |   57 +-
 core/sql/regress/hive/TEST005_a.hive.sql        |    2 +
 core/sql/regress/hive/TEST007                   |   53 +-
 core/sql/regress/hive/TEST008                   |  309 ++++
 core/sql/regress/hive/TEST009                   |    4 +-
 core/sql/regress/hive/TEST009_a.hive.sql        |    8 +-
 core/sql/regress/hive/TEST009_b.hive.sql        |   30 +-
 core/sql/regress/hive/TEST018                   |  160 +-
 .../hive/TEST018_create_hive_tables.hive        |   20 +-
 core/sql/regress/privs1/EXPECTED125             |  729 ++++++++
 core/sql/regress/privs1/TEST125                 |   51 +
 core/sql/regress/privs2/EXPECTED129             |   36 +-
 core/sql/regress/privs2/EXPECTED144             |  301 +++-
 core/sql/regress/privs2/EXPECTED146             |  125 +-
 core/sql/regress/privs2/TEST138                 |    1 +
 core/sql/regress/privs2/TEST144                 |   39 +-
 core/sql/regress/privs2/TEST146                 |    7 +
 core/sql/regress/seabase/EXPECTED003            |    6 +-
 core/sql/regress/seabase/EXPECTED020            |   58 +-
 core/sql/regress/seabase/EXPECTED031            |   59 +-
 core/sql/regress/seabase/EXPECTED032            |  248 ++-
 core/sql/regress/seabase/TEST020                |    4 +-
 core/sql/regress/seabase/TEST026                |    1 +
 core/sql/regress/seabase/TEST031                |   10 +-
 core/sql/regress/seabase/TEST032                |   56 +
 core/sql/runtimestats/SqlStats.cpp              |   22 +-
 core/sql/runtimestats/SqlStats.h                |    3 +
 core/sql/runtimestats/rts_msg.cpp               |   39 +
 core/sql/runtimestats/rts_msg.h                 |   40 +-
 core/sql/runtimestats/sscpipc.cpp               |   53 +
 core/sql/runtimestats/sscpipc.h                 |    1 +
 core/sql/runtimestats/ssmpipc.cpp               |   85 +
 core/sql/runtimestats/ssmpipc.h                 |    5 +-
 core/sql/sqlci/sqlci_lex.ll                     |    2 -
 core/sql/sqlci/sqlci_yacc.y                     |   11 -
 core/sql/sqlcomp/CmpDescribe.cpp                |  277 ++-
 core/sql/sqlcomp/CmpDescribe.h                  |   68 +-
 core/sql/sqlcomp/CmpSeabaseDDL.h                |   36 +-
 core/sql/sqlcomp/CmpSeabaseDDLauth.cpp          |   69 +-
 core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp       |  185 +-
 core/sql/sqlcomp/CmpSeabaseDDLcleanup.h         |    5 +-
 core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp        |   28 +-
 core/sql/sqlcomp/CmpSeabaseDDLschema.cpp        |    5 +-
 core/sql/sqlcomp/CmpSeabaseDDLtable.cpp         | 1585 ++++++++++++++----
 core/sql/sqlcomp/CmpSeabaseDDLview.cpp          |   20 +
 core/sql/sqlcomp/DefaultConstants.h             |   20 +
 core/sql/sqlcomp/nadefaults.cpp                 |   17 +-
 core/sql/sqlcomp/parser.cpp                     |  131 +-
 core/sql/sqlcomp/parser.h                       |  100 ++
 .../main/java/org/trafodion/sql/HiveClient.java |    6 +-
 core/sql/ustat/hs_la.cpp                        |    6 +-
 .../org/trafodion/dcs/server/ServerManager.java |   14 +-
 .../src/asciidoc/_chapters/binder_msgs.adoc     |   17 +
 .../src/asciidoc/_chapters/sql_statements.adoc  |  106 +-
 .../src/asciidoc/_chapters/sql_utilities.adoc   |    2 +-
 install/python-installer/configs/version.json   |    4 +-
 190 files changed, 9579 insertions(+), 2723 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/87210a56/core/sqf/src/trafconf/Makefile
----------------------------------------------------------------------
diff --cc core/sqf/src/trafconf/Makefile
index 42e81bc,507e296..f48a281
--- a/core/sqf/src/trafconf/Makefile
+++ b/core/sqf/src/trafconf/Makefile
@@@ -44,11 -44,14 +44,14 @@@ LIBS		= $(LIBTRAFCONFIG
  LIBSX	+= -lrt
  
  # need -lsqlite3 for SQLite
 -LIBSX	+=  -lsqlite3
 +LIBSX	+=  -lsqlite3 -lpthread
  
+ # need -lpthread starting on CentOS7
+ LIBSX	+=  -lpthread  
+ 
  PROGS		= $(TRAFCONF)
  
 -OBJTRAFCONFIG		= $(OUTDIR)/trafconfig.o \
 +OBJTRAFCONFIG	= $(OUTDIR)/trafconfig.o \
  		  $(OUTDIR)/tcdb.o \
  		  $(OUTDIR)/tcdbstore.o \
  		  $(OUTDIR)/tclog.o \

http://git-wip-us.apache.org/repos/asf/trafodion/blob/87210a56/core/sqf/src/trafconf/tctrace.h
----------------------------------------------------------------------


[46/50] [abbrv] trafodion git commit: Fix RHEL 7 compile error.

Posted by su...@apache.org.
Fix RHEL 7 compile error.


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

Branch: refs/heads/master
Commit: edb10f1288f79efae7edb4d6ce66ec67cd6b6856
Parents: 4d05071
Author: Zalo Correa <za...@esgyn.com>
Authored: Tue Jun 5 06:27:07 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Tue Jun 5 06:27:07 2018 -0700

----------------------------------------------------------------------
 core/sqf/monitor/linux/process.cxx | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/edb10f12/core/sqf/monitor/linux/process.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/process.cxx b/core/sqf/monitor/linux/process.cxx
index 3a3e699..9b9ee00 100644
--- a/core/sqf/monitor/linux/process.cxx
+++ b/core/sqf/monitor/linux/process.cxx
@@ -5209,6 +5209,7 @@ CProcess *CProcessContainer::CompleteProcessStartup (char *process_name,
     {
         if (process->GetPid() != os_pid)
         { // Process id changed from when we started the process.
+#ifndef NAMESERVER_PROCESS
             if ( !process->IsUnhooked() )
             {   // Parent process object keeps track of child processes
                 // created on this node.  Needed in case parent process
@@ -5226,7 +5227,6 @@ CProcess *CProcessContainer::CompleteProcessStartup (char *process_name,
                     parentPid = process->GetPairParentPid();
                 }
 
-#ifndef NAMESERVER_PROCESS
                 if ( parentNid != -1 && parentPid != -1 )
                 {
                     CProcess* parent;
@@ -5239,9 +5239,7 @@ CProcess *CProcessContainer::CompleteProcessStartup (char *process_name,
                         parent->childAdd ( process->GetNid(), os_pid );
                     }
                 }
-#endif
             }
-#ifndef NAMESERVER_PROCESS
             if (NameServerEnabled)
             {
                 if (process->IsUnhooked())


[20/50] [abbrv] trafodion git commit: Update.

Posted by su...@apache.org.
Update.


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

Branch: refs/heads/master
Commit: 47b3793a1ad8cb48be87dade29a272f0f97d2cc9
Parents: 1584dc4
Author: Dave George <de...@gmail.com>
Authored: Fri Apr 6 17:12:58 2018 +0000
Committer: Dave George <de...@gmail.com>
Committed: Fri Apr 6 17:12:58 2018 +0000

----------------------------------------------------------------------
 core/sqf/monitor/linux/nscommacceptmon.cxx | 2 ++
 core/sqf/monitor/linux/process.cxx         | 5 +++++
 2 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/47b3793a/core/sqf/monitor/linux/nscommacceptmon.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nscommacceptmon.cxx b/core/sqf/monitor/linux/nscommacceptmon.cxx
index 3e02e62..763d324 100644
--- a/core/sqf/monitor/linux/nscommacceptmon.cxx
+++ b/core/sqf/monitor/linux/nscommacceptmon.cxx
@@ -313,6 +313,7 @@ void CCommAcceptMon::monReqNewProcess( struct message_def* msg, int sockFd )
                       "        msg.new_process_ns.pathStrId=%d:%d\n"
                       "        msg.new_process_ns.ldpathStrId=%d:%d\n"
                       "        msg.new_process_ns.programStrId=%d:%d\n"
+                      "        msg.new_process_ns.process_name=%s\n"
                       "        msg.new_process_ns.port=%s\n"
                       "        msg.new_process_ns.argc=%d\n"
                       //"        msg.new_process_ns.argv=%s\n"
@@ -347,6 +348,7 @@ void CCommAcceptMon::monReqNewProcess( struct message_def* msg, int sockFd )
                     , msg->u.request.u.new_process_ns.ldpathStrId.id
                     , msg->u.request.u.new_process_ns.programStrId.nid
                     , msg->u.request.u.new_process_ns.programStrId.id
+                    , msg->u.request.u.new_process_ns.process_name
                     , msg->u.request.u.new_process_ns.port_name
                     , msg->u.request.u.new_process_ns.argc
                     //, msg->u.request.u.new_process_ns.argv

http://git-wip-us.apache.org/repos/asf/trafodion/blob/47b3793a/core/sqf/monitor/linux/process.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/process.cxx b/core/sqf/monitor/linux/process.cxx
index b599840..26535d3 100644
--- a/core/sqf/monitor/linux/process.cxx
+++ b/core/sqf/monitor/linux/process.cxx
@@ -1609,6 +1609,7 @@ bool CProcess::Create (CProcess *parent, int & result)
     char nsCommPort[10];
     char nsSyncPort[10];
     char nsMon2NsPort[10];
+    char nsConfigDb[MAX_PROCESS_PATH];
     MON_Props xprops(true);
     MON_Props xprops_exe(true);
     char *xprops_exe_file;
@@ -1684,6 +1685,8 @@ bool CProcess::Create (CProcess *parent, int & result)
         STRCPY (nsSyncPort, (env?env:""));
         env = getenv ("NS_M2N_COMM_PORT");
         STRCPY (nsMon2NsPort, (env?env:""));
+        env = getenv ("SQ_CONFIGDB");
+        STRCPY (nsConfigDb, (env?env:""));
     }
     if ( Type == ProcessType_Watchdog )
     {
@@ -1866,6 +1869,8 @@ bool CProcess::Create (CProcess *parent, int & result)
             setEnvStrVal ( childEnv, nextEnv, "NS_SYNC_PORT", nsSyncPort );
         if ( nsMon2NsPort[0] )
             setEnvStrVal ( childEnv, nextEnv, "NS_M2N_COMM_PORT", nsMon2NsPort );
+        if (nsConfigDb[0] )
+            setEnvStrVal ( childEnv, nextEnv, "SQ_CONFIGDB", nsConfigDb );
     }
     if ( Type == ProcessType_Watchdog )
     {


[11/50] [abbrv] trafodion git commit: Update.

Posted by su...@apache.org.
http://git-wip-us.apache.org/repos/asf/trafodion/blob/8b025eae/core/sqf/monitor/linux/reqqueue.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqqueue.cxx b/core/sqf/monitor/linux/reqqueue.cxx
index 12e1f8e..a6b22a3 100644
--- a/core/sqf/monitor/linux/reqqueue.cxx
+++ b/core/sqf/monitor/linux/reqqueue.cxx
@@ -269,7 +269,7 @@ CRequest::ReqStatus_t CRequest::okToExecute()
     }
 
     bool ownershipFailure;
-    if ( !isExclusive() 
+    if ( !isExclusive()
       && !takeOwnership( ownershipFailure ) )
     {   // Can't get ownership of needed objects
 
@@ -293,7 +293,7 @@ CRequest::ReqStatus_t CRequest::okToExecute()
             struct timespec now;
             struct timespec tDiff;
             clock_gettime(CLOCK_REALTIME, &now);
-        
+
             CReqQueue::timeDiff ( reqArrival_, now, tDiff );
 
             if ( tDiff.tv_sec > CReqQueue::REQ_MAX_DEFER)
@@ -316,7 +316,7 @@ CRequest::ReqStatus_t CRequest::okToExecute()
                 if ( trace_settings & TRACE_REQUEST )
                     trace_printf("%s@%d cannot take ownership for request "
                                  "#%ld\n", method_name, __LINE__, getId());
-                
+
                 reqStatus = WaitToExec;
             }
         }
@@ -416,7 +416,7 @@ void CRequest::lioreply(struct message_def *msg, int Pid, int *error)
                          method_name, __LINE__, msg, Pid,
                          ((SharedMsgDef*)msg)->trailer.index );
 
-        SQ_theLocalIOToClient->sendCtlMsg ( Pid, 
+        SQ_theLocalIOToClient->sendCtlMsg ( Pid,
                                             MC_SReady,
                                             ((SharedMsgDef*)msg)->trailer.index,
                                             error
@@ -665,7 +665,7 @@ void CIntCloneProcReq::performRequest()
             {
                 trace_printf("%s@%d - For restarted persistent process "
                              " altering (%d, %d) to (%d, %d)\n",
-                             method_name, __LINE__, 
+                             method_name, __LINE__,
                              nid_,
                              priorPid_,
                              nid_,
@@ -692,7 +692,7 @@ void CIntCloneProcReq::performRequest()
             {
                 trace_printf("%s@%d - Unexpectedly could not locate "
                              " restarted persistent process (%d , %d)\n",
-                             method_name, __LINE__, 
+                             method_name, __LINE__,
                              nid_,
                              priorPid_);
             }
@@ -757,7 +757,7 @@ void CIntCloneProcReq::performRequest()
         }
         else
         {
-            // This is a new clone process that needs to be created 
+            // This is a new clone process that needs to be created
             // mirroring another node
             CNode * node = Nodes->GetLNode (nid_)->GetNode();
             CProcess * process;
@@ -893,7 +893,7 @@ void CIntExitReq::performRequest()
 
         if ( ! process )
         {
-            // Could not locate process by process id.  If the exit 
+            // Could not locate process by process id.  If the exit
             // occurred due to an early process termination on another
             // node we won't have the process id.  Try the look up by
             // name instead.
@@ -914,8 +914,8 @@ void CIntExitReq::performRequest()
                             pid_,
                             verifier_,
                             process->GetVerifier());
-            }            
-        } 
+            }
+        }
         else
         {
             lnode->GetNode()->DelFromNameMap ( process );
@@ -926,19 +926,19 @@ void CIntExitReq::performRequest()
 #endif
         }
     }
-    else 
+    else
     {
         char buf[MON_STRING_BUF_SIZE];
         sprintf(buf, "[%s], Can't find process %s (%d, %d) for processing "
                 "exit.\n", method_name, name_, nid_, pid_);
-        mon_log_write(MON_CLUSTER_HANDLEOTHERNODE_5, SQ_LOG_ERR, buf); 
+        mon_log_write(MON_CLUSTER_HANDLEOTHERNODE_5, SQ_LOG_ERR, buf);
     }
 
     TRACE_EXIT;
 }
 
 #ifndef NAMESERVER_PROCESS
-CIntKillReq::CIntKillReq( struct kill_def *killDef ) 
+CIntKillReq::CIntKillReq( struct kill_def *killDef )
             : CInternalReq()
             , nid_( killDef->nid )
             , pid_( killDef->pid )
@@ -983,14 +983,14 @@ void CIntKillReq::performRequest()
                             pid_,
                             verifier_,
                             process->GetVerifier());
-            }            
-        } 
+            }
+        }
         else
         {
             CLNode   *lnode = Nodes->GetLNode( nid_ );
             if ( lnode && process->GetPid() == pid_ )
             {
-        
+
                 // Remove mapping of name to process object.
                 lnode->GetNode()->DelFromNameMap ( process );
             }
@@ -1005,7 +1005,7 @@ void CIntKillReq::performRequest()
             process->SetAbort( abort_ );
 
             if ( !process->IsClone() )
-            {   
+            {
                 // Indicate thate process is down and abended
                 lnode->GetNode()->SetProcessState( process, State_Down, true );
 
@@ -1017,7 +1017,7 @@ void CIntKillReq::performRequest()
                 kill( pid_, Monitor->GetProcTermSig() );
                 if (trace_settings & (TRACE_SYNC | TRACE_REQUEST | TRACE_PROCESS))
                     trace_printf("%s@%d - Completed kill(%d) for (%d, %d:%d)\n",
-                                 method_name, __LINE__, Monitor->GetProcTermSig(), 
+                                 method_name, __LINE__, Monitor->GetProcTermSig(),
                                  nid_, pid_, verifier_);
             }
             else
@@ -1029,7 +1029,7 @@ void CIntKillReq::performRequest()
                                  process->GetState() );
             }
 
-            CProcess *parent = Nodes->GetProcess( process->GetParentNid(), 
+            CProcess *parent = Nodes->GetProcess( process->GetParentNid(),
                                                   process->GetParentPid() );
             process->Switch(parent); // switch process pair roles if needed
         }
@@ -1149,11 +1149,11 @@ void CIntNewProcReq::performRequest()
         parentProcess = Nodes->GetProcess( parentNid_, parentPid_ );
         if ( parentProcess )
         {
-            if ( (parentVerifier_ == -1) || 
+            if ( (parentVerifier_ == -1) ||
                  (parentVerifier_ == parentProcess->GetVerifier()) )
             {
-                if ( backup_ && 
-                    (parentProcess->GetPairParentNid() == -1 && 
+                if ( backup_ &&
+                    (parentProcess->GetPairParentNid() == -1 &&
                      parentProcess->GetPairParentPid() == -1))
                 {
                     parentProcess->SetPairParentNid( pairParentNid_ );
@@ -1168,7 +1168,7 @@ void CIntNewProcReq::performRequest()
     {
         CLNode *lnode = Nodes->GetLNode(nid_);
 
-        if ( lnode && 
+        if ( lnode &&
             (lnode->GetState() == State_Up ||
              lnode->GetState() == State_Shutdown ) )
         {   // Create the CProcess object and store the various
@@ -1199,7 +1199,7 @@ void CIntNewProcReq::performRequest()
             if ( newProcess != NULL )
             {
                 newProcess->userArgs ( argc_, argvLen_,
-                                       &stringData_[nameLen_ + infileLen_ 
+                                       &stringData_[nameLen_ + infileLen_
                                                     + outfileLen_] );
 
                 // Create the new process (fork/exec)
@@ -1210,14 +1210,14 @@ void CIntNewProcReq::performRequest()
 
                     // Successfully forked process.  Replicate actual process
                     // id and process name.
-                    
-//TRK-TODO 
+
+//TRK-TODO
               /*      if (NameServerEnabled)
                     {
                         PtpClient->ProcessInit(newProcess, reqTag_, 0, parentNid_, lnode->GetNode()->GetName());
                     }
                     else
-             */       {                    
+             */       {
                         CReplProcInit *repl
                             = new CReplProcInit(newProcess, reqTag_, 0, parentNid_);
                         Replicator.addItem(repl);
@@ -1232,7 +1232,7 @@ void CIntNewProcReq::performRequest()
 
 //TRK-TODO
             if (  newProcess == NULL )
-            {  
+            {
                 // Process creation failure, relay error code to node
                 // that requested process creation.
                 CReplProcInit *repl = new CReplProcInit(newProcess, reqTag_,
@@ -1246,16 +1246,16 @@ void CIntNewProcReq::performRequest()
     {
         char buf[MON_STRING_BUF_SIZE];
         sprintf(buf, "[%s], Can't find parent process nid=%d, pid=%d "
-                "for process create.\n", method_name, 
+                "for process create.\n", method_name,
                 parentNid_, parentPid_ );
-        mon_log_write(MON_CLUSTER_HANDLEOTHERNODE_10, SQ_LOG_ERR, buf); 
+        mon_log_write(MON_CLUSTER_HANDLEOTHERNODE_10, SQ_LOG_ERR, buf);
     }
 
     TRACE_EXIT;
 }
 
 #ifndef NAMESERVER_PROCESS
-CIntOpenReq::CIntOpenReq( struct open_def *openDef ) 
+CIntOpenReq::CIntOpenReq( struct open_def *openDef )
             : CInternalReq()
             , openerNid_( openDef->nid )
             , openerPid_( openDef->pid )
@@ -1309,7 +1309,7 @@ void CIntOpenReq::performRequest()
                             openedVerifier_,
                             process->GetVerifier());
             }
-        } 
+        }
         else
         {
             Nodes->GetLNode (openerNid_)->
@@ -1325,14 +1325,14 @@ void CIntOpenReq::performRequest()
         char buf[MON_STRING_BUF_SIZE];
         sprintf(buf, "[%s], Can't find process nid=%d, pid=%d for "
                 "processing open.\n", method_name, openedNid_, openedPid_ );
-        mon_log_write(MON_CLUSTER_HANDLEOTHERNODE_11, SQ_LOG_ERR, buf); 
+        mon_log_write(MON_CLUSTER_HANDLEOTHERNODE_11, SQ_LOG_ERR, buf);
     }
 
     TRACE_EXIT;
 }
 #endif
 
-CIntProcInitReq::CIntProcInitReq( struct process_init_def *procInitDef ) 
+CIntProcInitReq::CIntProcInitReq( struct process_init_def *procInitDef )
                 : CInternalReq()
                 , nid_( procInitDef->nid )
                 , pid_( procInitDef->pid )
@@ -1408,7 +1408,7 @@ void CIntProcInitReq::performRequest()
                                  "parent's Parent_Nid/Parent_Pid="
                                  "(%d, %d).\n",
                                  method_name, __LINE__,  process_->GetNid(),
-                                 process_->GetPid(), parent->GetNid(), 
+                                 process_->GetPid(), parent->GetNid(),
                                  parent->GetPid(),
                                  process_->GetNid(), process_->GetPid());
                 }
@@ -1422,7 +1422,7 @@ void CIntProcInitReq::performRequest()
 // Following allows reply to a "waited" new process request before we
 // get the "startup" message from the process.   This make the process
 // creation appear to complete more quickly.   However there are potential
-// problems if the requester immediately tries to open the new process 
+// problems if the requester immediately tries to open the new process
 // because it is not ready yet.   So need to handle quick "open" of this
 // type before re-enabling this code section.
                 if (!process->IsNowait())
@@ -1439,13 +1439,13 @@ void CIntProcInitReq::performRequest()
                     }
 
                     if (parent)
-                    {   
+                    {
                         reply_msg = process->parentContext();
                         if ( reply_msg )
                         {
                             // the parent gets a new_process reply
                             parent->ReplyNewProcess ( reply_msg, process );
-                            
+
                             process->parentContext (NULL);
                         }
                     }
@@ -1568,7 +1568,7 @@ void CIntChildDeathReq::performRequest()
     const char method_name[] = "CIntChildDeathReq::performRequest";
 
     // process could have been deleted by a previous child death
-    // request. This could happen if child death signal did not arrive 
+    // request. This could happen if child death signal did not arrive
     // in hangupTime + PROCESS_DEATH_MARGIN. So get process ptr again.
     process_ = MyNode->GetProcess( pid_ );
 
@@ -1594,7 +1594,7 @@ void CIntChildDeathReq::performRequest()
         // if state is still Up, then process has not called exit.
         bool abended = (process_->GetState() == State_Up);
         MyNode->SetProcessState(process_, State_Stopped, abended);
-        
+
     }
 }
 
@@ -1667,8 +1667,8 @@ void CIntShutdownReq::performRequest()
     MyNode->SetShutdownLevel( (ShutdownLevel) level_ );
 
     // only abrupt case is supported through this mechanism at present.
-    // modify this assert as more shutdown levels are supported here. 
-    assert(level_ == ShutdownLevel_Abrupt); 
+    // modify this assert as more shutdown levels are supported here.
+    assert(level_ == ShutdownLevel_Abrupt);
 
     if( !getenv("SQ_VIRTUAL_NODES") )
     {
@@ -1720,7 +1720,7 @@ CIntNameServerAddReq::~CIntNameServerAddReq()
 void CIntNameServerAddReq::populateRequestString( void )
 {
     char strBuf[MON_STRING_BUF_SIZE/2];
-    snprintf( strBuf, sizeof(strBuf), 
+    snprintf( strBuf, sizeof(strBuf),
               "IntReq(%s) req #=%ld "
               "(node_name=%s)"
             , CReqQueue::intReqType[InternalType_NodeAdd]
@@ -1772,7 +1772,7 @@ void CIntNameServerAddReq::performRequest()
 CIntNameServerDeleteReq::CIntNameServerDeleteReq( int req_nid
                                                 , int req_pid
                                                 , Verifier_t req_verifier
-                                                , const char *nodeName ) 
+                                                , const char *nodeName )
                  : CInternalReq()
                  , req_nid_(req_nid)
                  , req_pid_(req_pid)
@@ -1792,7 +1792,7 @@ CIntNameServerDeleteReq::~CIntNameServerDeleteReq()
 void CIntNameServerDeleteReq::populateRequestString( void )
 {
     char strBuf[MON_STRING_BUF_SIZE/2];
-    snprintf( strBuf, sizeof(strBuf), 
+    snprintf( strBuf, sizeof(strBuf),
               "IntReq(%s) req #=%ld "
               "(node=%s)"
             , CReqQueue::intReqType[InternalType_NameServerDelete]
@@ -1848,7 +1848,7 @@ CIntNodeNameReq::CIntNodeNameReq( int req_nid
                                 , int req_pid
                                 , Verifier_t req_verifier
                                 , const char *current_name
-                                , const char *new_name  ) 
+                                , const char *new_name  )
                 : CInternalReq()
                 , req_nid_(req_nid)
                 , req_pid_(req_pid)
@@ -1883,9 +1883,9 @@ void CIntNodeNameReq::performRequest()
     int rc = MPI_SUCCESS;
     char current_n[MPI_MAX_PROCESSOR_NAME];
     char new_n[MPI_MAX_PROCESSOR_NAME];
-    CPNodeConfig   *pnodeConfig = NULL; 
+    CPNodeConfig   *pnodeConfig = NULL;
     CProcess *requester = NULL;
-    
+
     strcpy (current_n, current_name_.c_str());
     strcpy (new_n, new_name_.c_str());
 
@@ -1908,13 +1908,13 @@ void CIntNodeNameReq::performRequest()
                 {
                     Monitor->EnterSyncCycle();
                 }
-        
+
                 // Change node name in monitor's view of cluster
-                CNode    *node = Nodes->GetNode(current_n); 
+                CNode    *node = Nodes->GetNode(current_n);
                 if (node)
                 {
                     node->SetName( new_n );
-                    Nodes->ChangedNode( node ); 
+                    Nodes->ChangedNode( node );
                 }
                 else
                 {
@@ -1926,7 +1926,7 @@ void CIntNodeNameReq::performRequest()
 
                     rc = MPI_ERR_INTERN;
                 }
-            
+
                 // unlock sync thread
                 if ( !Emulate_Down )
                 {
@@ -1945,7 +1945,7 @@ void CIntNodeNameReq::performRequest()
                    , "[%s], Failed to retrieve pnodeConfig object for node %s!\n"
                    ,  method_name, current_n);
             mon_log_write(MON_INTREQ_NODE_NAME_2, SQ_LOG_ERR, buf);
-    
+
             rc = MPI_ERR_INTERN;
         }
     }
@@ -2005,7 +2005,7 @@ CIntNodeAddReq::~CIntNodeAddReq()
 void CIntNodeAddReq::populateRequestString( void )
 {
     char strBuf[MON_STRING_BUF_SIZE/2];
-    snprintf( strBuf, sizeof(strBuf), 
+    snprintf( strBuf, sizeof(strBuf),
               "IntReq(%s) req #=%ld "
               "(node_name=%s/first_core=%d/last_core=%d/processors=%d/roles=%d)"
             , CReqQueue::intReqType[InternalType_NodeAdd]
@@ -2048,7 +2048,7 @@ void CIntNodeAddReq::performRequest()
     nid  = clusterConfig->GetNextNid();
     pnid = clusterConfig->GetNextPNid();
 
-    // Insert node in configuration database and 
+    // Insert node in configuration database and
     // add to configuration object in monitor
     if (clusterConfig->SaveNodeConfig( nodeName_
                                      , nid
@@ -2072,7 +2072,7 @@ void CIntNodeAddReq::performRequest()
         {
             rc = MPI_ERR_INTERN;
         }
-    
+
         // unlock sync thread
         if ( !Emulate_Down )
         {
@@ -2099,7 +2099,7 @@ void CIntNodeAddReq::performRequest()
 CIntNodeDeleteReq::CIntNodeDeleteReq( int req_nid
                                     , int req_pid
                                     , Verifier_t req_verifier
-                                    , int pnid ) 
+                                    , int pnid )
                  : CInternalReq()
                  , req_nid_(req_nid)
                  , req_pid_(req_pid)
@@ -2119,7 +2119,7 @@ CIntNodeDeleteReq::~CIntNodeDeleteReq()
 void CIntNodeDeleteReq::populateRequestString( void )
 {
     char strBuf[MON_STRING_BUF_SIZE/2];
-    snprintf( strBuf, sizeof(strBuf), 
+    snprintf( strBuf, sizeof(strBuf),
               "IntReq(%s) req #=%ld "
               "(pnid=%d)"
             , CReqQueue::intReqType[InternalType_NodeDelete]
@@ -2184,7 +2184,7 @@ void CIntNodeDeleteReq::performRequest()
     TRACE_EXIT;
 }
 
-CIntDownReq::CIntDownReq( int pnid ) 
+CIntDownReq::CIntDownReq( int pnid )
     : CInternalReq(),
       pnid_ ( pnid )
 {
@@ -2311,7 +2311,7 @@ void CIntSoftNodeUpReq::performRequest()
     TRACE_EXIT;
 }
 
-CIntUpReq::CIntUpReq( int pnid, char *node_name, int merge_lead ) 
+CIntUpReq::CIntUpReq( int pnid, char *node_name, int merge_lead )
     : CInternalReq(),
       nodeName_ ( node_name?node_name:"" ),
       mergeLead_ ( merge_lead ),
@@ -2351,8 +2351,8 @@ void CIntUpReq::performRequest()
     TRACE_EXIT;
 }
 
-CIntActivateSpareReq::CIntActivateSpareReq(CNode *spareNode, CNode *downNode, bool checkHealth) 
-    : CInternalReq(), 
+CIntActivateSpareReq::CIntActivateSpareReq(CNode *spareNode, CNode *downNode, bool checkHealth)
+    : CInternalReq(),
     spareNode_(spareNode),
     downNode_(downNode),
     checkHealth_(checkHealth)
@@ -2396,7 +2396,7 @@ void CIntActivateSpareReq::performRequest()
     return;
 }
 
-CIntReviveReq::CIntReviveReq() 
+CIntReviveReq::CIntReviveReq()
     : CInternalReq()
 {
     // Add eyecatcher sequence as a debugging aid
@@ -2425,14 +2425,14 @@ void CIntReviveReq::performRequest()
     const char method_name[] = "CIntReviveReq::performRequest";
     TRACE_ENTRY;
 
-    int error; 
+    int error;
 
     if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
         trace_printf("%s@%d - Revive request\n", method_name, __LINE__);
 
     mem_log_write(MON_REQQUEUE_REVIVE_1);
 
-    CCluster::snapShotHeader_t header; 
+    CCluster::snapShotHeader_t header;
 
     switch( CommType )
     {
@@ -2468,20 +2468,20 @@ void CIntReviveReq::performRequest()
         return;
     }
 
-    if (header.compressedSize_ == -1) 
+    if (header.compressedSize_ == -1)
     {   // creator monitor ran into compression error, abort.
         if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
-            trace_printf("%s@%d - Creator monitor compression error. Exiting.", method_name, __LINE__);  
+            trace_printf("%s@%d - Creator monitor compression error. Exiting.", method_name, __LINE__);
 
         char buf[MON_STRING_BUF_SIZE];
         sprintf(buf, "Creator monitor had compression error. Aborting node reintegration.\n");
-        mon_log_write(MON_REQQUEUE_REVIVE_2, SQ_LOG_CRIT, buf);   
-        
-        // exit call below runs desctructors. Stop healthcheck thread so that its lock can be destructed. 
+        mon_log_write(MON_REQQUEUE_REVIVE_2, SQ_LOG_CRIT, buf);
+
+        // exit call below runs desctructors. Stop healthcheck thread so that its lock can be destructed.
         HealthCheck.shutdownWork();
 
         TRACE_EXIT;
-        exit(0); // this will cause other monitors to disconnect from the new monitor.       
+        exit(0); // this will cause other monitors to disconnect from the new monitor.
     }
 
     char *compBuf = (char *) malloc ( header.compressedSize_ );
@@ -2489,7 +2489,7 @@ void CIntReviveReq::performRequest()
     if (!compBuf)
     {
         if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
-            trace_printf("%s@%d - Unable to allocate buffer of size = %ld\n", 
+            trace_printf("%s@%d - Unable to allocate buffer of size = %ld\n",
                           method_name, __LINE__, header.compressedSize_);
         TRACE_EXIT;
         return;
@@ -2536,7 +2536,7 @@ void CIntReviveReq::performRequest()
     if (!buf)
     {
         if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
-            trace_printf("%s@%d - Unable to allocate buffer of size = %ld\n", 
+            trace_printf("%s@%d - Unable to allocate buffer of size = %ld\n",
                           method_name, __LINE__, header.fullSize_);
 
         free( compBuf );
@@ -2553,7 +2553,7 @@ void CIntReviveReq::performRequest()
         trace_printf("%s@%d - compSize = %ld, fullsize = %ld, uncompress error = %d\n",
                      method_name, __LINE__, header.compressedSize_, header.fullSize_, error);
 
-    free( compBuf ); // don't need anymore. Will work on uncompressed buffer from this point. 
+    free( compBuf ); // don't need anymore. Will work on uncompressed buffer from this point.
 
     char *buffer = buf;
 
@@ -2617,7 +2617,7 @@ void CIntReviveReq::performRequest()
     return;
 }
 
-CIntSnapshotReq::CIntSnapshotReq( unsigned long long seqNum ) 
+CIntSnapshotReq::CIntSnapshotReq( unsigned long long seqNum )
     : CInternalReq(),
       seqNum_( seqNum )
 {
@@ -2657,7 +2657,7 @@ void CIntSnapshotReq::performRequest()
         trace_printf("%s@%d - Snapshot request\n", method_name, __LINE__);
 
     mem_log_write(MON_REQQUEUE_SNAPSHOT_1);
-    
+
     // abort this request if join communication is not setup
     switch( CommType )
     {
@@ -2665,11 +2665,11 @@ void CIntSnapshotReq::performRequest()
             if (Monitor->getJoinComm() == MPI_COMM_NULL)
             {
                 mem_log_write(MON_REQQUEUE_SNAPSHOT_2);
-        
+
                 char buf[MON_STRING_BUF_SIZE];
                 sprintf(buf, "[%s], Join communicator is null, aborting snapshot req.\n", method_name);
                 mon_log_write(MON_REQQUEUE_SNAPSHOT_2, SQ_LOG_ERR, buf);
-              
+
                 TRACE_EXIT;
                 return;
             }
@@ -2678,11 +2678,11 @@ void CIntSnapshotReq::performRequest()
             if (Monitor->getJoinSock() == -1)
             {
                 mem_log_write(MON_REQQUEUE_SNAPSHOT_2);
-        
+
                 char buf[MON_STRING_BUF_SIZE];
                 sprintf(buf, "[%s], Join socket is -1, aborting snapshot req.\n", method_name);
                 mon_log_write(MON_REQQUEUE_SNAPSHOT_2, SQ_LOG_ERR, buf);
-              
+
                 TRACE_EXIT;
                 return;
             }
@@ -2707,7 +2707,7 @@ void CIntSnapshotReq::performRequest()
 
     snapshotBuf = (char *) malloc (procSize + idsSize);
 
-    if (!snapshotBuf) 
+    if (!snapshotBuf)
     {
         if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
             trace_printf("%s@%d - Unable to allocate snapshot buffer, size = %ld\n",
@@ -2732,7 +2732,7 @@ void CIntSnapshotReq::performRequest()
 #endif
 
     // pack spareNodes pnids
-    header.spareNodesCount_ = Nodes->PackSpareNodesList( (intBuffPtr_t&)buf ); 
+    header.spareNodesCount_ = Nodes->PackSpareNodesList( (intBuffPtr_t&)buf );
 
     // pack logical-to-physical nid mappings
     header.nodeMapCount_ = Nodes->PackNodeMappings( (intBuffPtr_t&)buf );
@@ -2753,17 +2753,17 @@ void CIntSnapshotReq::performRequest()
     header.seqNum_ = seqNum_; // copy the one stored in this request
 
     if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
-        trace_printf("%s@%d - procCount = %ld, fullSize = %ld\n", 
+        trace_printf("%s@%d - procCount = %ld, fullSize = %ld\n",
              method_name, __LINE__, header.procCount_, header.fullSize_);
 
     clock_gettime(CLOCK_REALTIME, &snapShotTime);
 
-    // compress call requires the compression buffer to be little more than the input buffer. 
+    // compress call requires the compression buffer to be little more than the input buffer.
     compSize = compressBound(header.fullSize_);
 
-    compBuf = (char *)malloc(compSize); 
+    compBuf = (char *)malloc(compSize);
 
-    if (!compBuf) 
+    if (!compBuf)
     {
         if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
             trace_printf("%s@%d - Unable to allocate compression buffer, size = %ld\n",
@@ -2776,18 +2776,18 @@ void CIntSnapshotReq::performRequest()
         TRACE_EXIT;
         return;
     }
-        
+
     memset( compBuf, 0, compSize ); // TODO: WHY?
-    z_result = compress((Bytef *)compBuf, (unsigned long *)&compSize, 
+    z_result = compress((Bytef *)compBuf, (unsigned long *)&compSize,
                         (Bytef *)snapshotBuf, header.fullSize_);
- 
+
     mem_log_write(MON_REQQUEUE_SNAPSHOT_9, z_result, compSize);
-        
+
     if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
-        trace_printf("%s@%d - compression result = %d, orig size = %ld, comp size = %ld\n", 
+        trace_printf("%s@%d - compression result = %d, orig size = %ld, comp size = %ld\n",
                      method_name, __LINE__, z_result, header.fullSize_, compSize);
 
-    if (z_result != Z_OK) 
+    if (z_result != Z_OK)
     {
         char buf[MON_STRING_BUF_SIZE];
         sprintf(buf, "Snapshot buffer compression error = %d, aborting node reintegration.\n", z_result);
@@ -2834,8 +2834,8 @@ void CIntSnapshotReq::performRequest()
     clock_gettime(CLOCK_REALTIME, &compressTime);
 
     if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
-        trace_printf("%s@%d - snapshot times, start = %ld.%ld, end = %ld.%ld compressed = %ld.%ld\n", 
-                    method_name, __LINE__, startTime.tv_sec, startTime.tv_nsec, 
+        trace_printf("%s@%d - snapshot times, start = %ld.%ld, end = %ld.%ld compressed = %ld.%ld\n",
+                    method_name, __LINE__, startTime.tv_sec, startTime.tv_nsec,
                     snapShotTime.tv_sec, snapShotTime.tv_nsec, compressTime.tv_sec, compressTime.tv_nsec);
 
     free( snapshotBuf ); // don't need anymore. Will work on compressed buffer from this point.
@@ -2922,7 +2922,7 @@ void CIntSnapshotReq::performRequest()
     return;
 }
 
-CQuiesceReq::CQuiesceReq( ) 
+CQuiesceReq::CQuiesceReq( )
     : CInternalReq()
 {
     // Add eyecatcher sequence as a debugging aid
@@ -2966,11 +2966,11 @@ void CQuiesceReq::performRequest()
     sprintf(buf, "[%s], Quiesce notices sent.\n", method_name);
     mon_log_write(MON_REQQUEUE_QUIESCE_1, SQ_LOG_WARNING, buf);
 
-    // if nothing in exit list, schedule a node down. 
+    // if nothing in exit list, schedule a node down.
     // if not, node down will be scheduled when exit list becomes empty.
 #ifndef NAMESERVER_PROCESS
     if (MyNode->getNumQuiesceExitPids() == 0)
-    {   
+    {
 #endif
         if (trace_settings & (TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
             trace_printf("%s@%d - Scheduling node down\n", method_name, __LINE__);
@@ -2982,7 +2982,7 @@ void CQuiesceReq::performRequest()
     TRACE_EXIT;
 }
 
-CPostQuiesceReq::CPostQuiesceReq( ) 
+CPostQuiesceReq::CPostQuiesceReq( )
     : CInternalReq()
 {
     // Add eyecatcher sequence as a debugging aid
@@ -3038,7 +3038,7 @@ void CPostQuiesceReq::performRequest()
 }
 
 #ifndef NAMESERVER_PROCESS
-CIntCreatePrimitiveReq::CIntCreatePrimitiveReq( int pnid ) 
+CIntCreatePrimitiveReq::CIntCreatePrimitiveReq( int pnid )
                        :CInternalReq()
                        ,pnid_ ( pnid )
 {
@@ -3105,7 +3105,7 @@ void CIntCreatePrimitiveReq::performRequest()
 #endif
 
 #ifndef NAMESERVER_PROCESS
-CIntTmReadyReq::CIntTmReadyReq( int nid ) 
+CIntTmReadyReq::CIntTmReadyReq( int nid )
                :CInternalReq()
                ,nid_ ( nid )
 {
@@ -3144,7 +3144,7 @@ void CIntTmReadyReq::performRequest()
 #endif
 
 //
-CReqQueue::CReqQueue(): busyExclusive_(false), busyWorkers_(0), syncDependentRequests_(0), maxQueueSize_(0), 
+CReqQueue::CReqQueue(): busyExclusive_(false), busyWorkers_(0), syncDependentRequests_(0), maxQueueSize_(0),
                         maxBusyWorkers_(0), numRequests_(0), execTimeMax_(0)
 {
     // Add eyecatcher sequence as a debugging aid
@@ -3353,7 +3353,7 @@ CExternalReq *CReqQueue::prepExternalReq(CExternalReq::reqQueueMsg_t msgType,
             request = new CExtNodeNameReq(msgType, pid, msg);
             request->setConcurrent(reqConcurrent[msg->u.request.type]);
             break;
-   
+
         case ReqType_NodeUp:
             request = new CExtNodeUpReq(msgType, pid, msg);
             request->setConcurrent(reqConcurrent[msg->u.request.type]);
@@ -3409,7 +3409,7 @@ CExternalReq *CReqQueue::prepExternalReq(CExternalReq::reqQueueMsg_t msgType,
             request->errorReply( MPI_ERR_REQUEST );
             delete request;
             request = NULL;
-        }        
+        }
     }
 #ifndef NAMESERVER_PROCESS
     else if (msg && msg->type == MsgType_UnsolicitedMessage)
@@ -3555,7 +3555,7 @@ void CReqQueue::enqueueSnapshotReq (unsigned long long seqnum)
 
     request = new CIntSnapshotReq ( seqnum );
 
-    enqueueReq ( request ); 
+    enqueueReq ( request );
 }
 
 void CReqQueue::enqueueQuiesceReq ()
@@ -3586,7 +3586,7 @@ void CReqQueue::enqueueDeviceReq ( char *ldevName )
     CInternalReq * request;
 
     request = new CIntDeviceReq ( ldevName );
-    
+
     enqueueReq ( request );
 }
 #endif
@@ -3908,14 +3908,14 @@ void CReqQueue::processReviveRequests(unsigned long long minSeqNum)
 
         unsigned long long reqSeqNum = request->getSeqNum();
 
-        // move requests whose seq num is above the minSeqNum, discard others. 
+        // move requests whose seq num is above the minSeqNum, discard others.
         if (reqSeqNum > minSeqNum)
         {
             enqueueReq( request, true );
 
             if ( trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY) )
-                 trace_printf("%s@%d Req moved from revive to regular queue. " 
-                              "Req seq num = %llu, Min seq num = %llu\n", 
+                 trace_printf("%s@%d Req moved from revive to regular queue. "
+                              "Req seq num = %llu, Min seq num = %llu\n",
                               method_name, __LINE__, reqSeqNum, minSeqNum);
         }
         else
@@ -3923,8 +3923,8 @@ void CReqQueue::processReviveRequests(unsigned long long minSeqNum)
             delete request;
 
             if ( trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY) )
-                 trace_printf("%s@%d Req discarded from revive queue. " 
-                              "Req seq num = %llu, Min seq num = %llu\n", 
+                 trace_printf("%s@%d Req discarded from revive queue. "
+                              "Req seq num = %llu, Min seq num = %llu\n",
                               method_name, __LINE__, reqSeqNum, minSeqNum);
         }
     }
@@ -3938,12 +3938,12 @@ bool CReqQueue::addToReqReviveQueue( CInternalReq *req )
     const char method_name[] = "CReqQueue::addToReqReviveQueue";
     TRACE_ENTRY;
 
-    bool result = false; // request not added yet. 
+    bool result = false; // request not added yet.
 
     if ( IAmIntegrating )
     {
         reqReviveQueueLock_.lock();
-  
+
         if ( IAmIntegrating ) // check again because it could have gotten turned off while waiting on lock.
         {
             reqReviveQueue_.push_back(req);
@@ -3951,20 +3951,20 @@ bool CReqQueue::addToReqReviveQueue( CInternalReq *req )
             int qsize = reqReviveQueue_.size();
 
             if ( trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY) )
-                 trace_printf("%s@%d Req added to revive queue. Revive queue size = %d\n", 
+                 trace_printf("%s@%d Req added to revive queue. Revive queue size = %d\n",
                       method_name, __LINE__, qsize);
-            
+
             if ( qsize > MAX_REVIVE_QUEUE_SIZE )
             {
                 // remove a request set from the front of the queue.
-                // the set is a group of all requests with the same seq num. 
+                // the set is a group of all requests with the same seq num.
                 unsigned long long seqnum = reqReviveQueue_.front()->getSeqNum();
                 while (seqnum == reqReviveQueue_.front()->getSeqNum())
                 {
                     reqReviveQueue_.pop_front(); // calls destructor
-                    
+
                     if ( trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY) )
-                        trace_printf("%s@%d Req removed from revive queue. Revive queue size = %d\n", 
+                        trace_printf("%s@%d Req removed from revive queue. Revive queue size = %d\n",
                              method_name, __LINE__, qsize);
                 }
             }
@@ -3991,10 +3991,10 @@ void CReqQueue::enqueueReq( CInternalReq *req, bool reviveOper )
 
         if ( IAmIntegrating && !req->GetReviveFlag() )
         {
-            if ( addToReqReviveQueue(req) ) 
+            if ( addToReqReviveQueue(req) )
             {
                 TRACE_EXIT;
-                return; 
+                return;
             }
         }
     }
@@ -4154,7 +4154,7 @@ CRequest* CReqQueue::getRequest()
                        MonStats->ReqQueueDecr();
                 }
                 else
-                {   
+                {
                     // Take request out of request list.  "it" then
                     // points to next element in the queue.
                     it = reqQueue_.erase (it);
@@ -4176,7 +4176,7 @@ CRequest* CReqQueue::getRequest()
             }
         }
         else
-        {   // Wait for a new request to be queued or a currently 
+        {   // Wait for a new request to be queued or a currently
             // executing request to complete.
             if ( trace_settings & TRACE_REQUEST )
                 trace_printf("%s@%d waiting for request\n", method_name,
@@ -4243,7 +4243,7 @@ CRequest* CReqQueue::getRequest()
     }
 
     reqQueueLock_.unlock();
-        
+
     TRACE_EXIT;
 
     return request;
@@ -4270,7 +4270,7 @@ void CReqQueue::finishRequest(CRequest *request)
         if ( trace_settings & TRACE_REQUEST )
             trace_printf("%s@%d busyWorkers now=%d\n", method_name, __LINE__, busyWorkers_);
     }
-    
+
     workerStatusLock_.unlock();
 
     reqQueueLock_.lock();
@@ -4354,7 +4354,7 @@ const bool CReqQueue::reqConcurrent[] = {
    false,    // ReqType_NodeDelete
    false,    // ReqType_NodeDown
    false,    // ReqType_NodeInfo
-   false,    // ReqType_NodeName 
+   false,    // ReqType_NodeName
    false,    // ReqType_NodeUp
    false,    // ReqType_Notice -- not an actual request
    false,    // ReqType_Notify
@@ -4423,7 +4423,7 @@ const char * CReqQueue::svcReqType[] = {
     "ZoneInfo"
 };
 
-// Must match internal.h:InternalType 
+// Must match internal.h:InternalType
 const char * CReqQueue::intReqType[] = {
       ""
     , "ActivateSpare"

http://git-wip-us.apache.org/repos/asf/trafodion/blob/8b025eae/core/sqf/src/seabed/test/Makefile
----------------------------------------------------------------------
diff --git a/core/sqf/src/seabed/test/Makefile b/core/sqf/src/seabed/test/Makefile
index 113444b..0b5e13b 100644
--- a/core/sqf/src/seabed/test/Makefile
+++ b/core/sqf/src/seabed/test/Makefile
@@ -48,7 +48,7 @@ PROGS		= t2 t3 t4 t5 t6 t9 t14 t15 t16 t17 t18 t19 \
 		       t261 t262                t266           \
 		                                     t277      t279 \
 		  t280 t281 t282      t284      t286 \
-		  tcheck tsock ttee
+		  tcheck tdelta tmerge tsock ttee
 PROGSI		= t2fs t3ms t4ms \
 		  t5ms t6ms t9thread t14ms \
 		  t15ms t16ms t17cli t17srv t17svc t18cli t18srv t19ms \
@@ -1000,6 +1000,16 @@ testfiles:
 		./gocleandb; \
 	fi
 
+tmerge: tmerge.o
+	$(LINKITCXX) $(INCLUDESX) -o $@ $<
+$(OUTDIR)/tmerge.o: tmerge.cpp
+	$(RCXXINCLUDES)
+
+tdelta: tdelta.o
+	$(LINKITCXX) $(INCLUDESX) -o $@ $<
+$(OUTDIR)/tdelta.o: tdelta.cpp
+	$(RCXXINCLUDES)
+
 tsock: tsock.cpp
 	$(LINKITCXX) -DMAIN $(INCLUDESX) -o $@ $<
 $(OUTDIR)/tsock.o: tsock.cpp

http://git-wip-us.apache.org/repos/asf/trafodion/blob/8b025eae/core/sqf/src/seabed/test/tdelta.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/seabed/test/tdelta.cpp b/core/sqf/src/seabed/test/tdelta.cpp
new file mode 100644
index 0000000..c6155a8
--- /dev/null
+++ b/core/sqf/src/seabed/test/tdelta.cpp
@@ -0,0 +1,269 @@
+//------------------------------------------------------------------
+//
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+
+#include <ctype.h>
+#include <stdio.h>
+
+#include "tversbin.h"
+
+VERS_BIN(seabed_test_tdelta)
+
+DEFINE_COMP_DOVERS(seabed_test_tdelta)
+
+bool verbose = false;
+
+class CFile {
+public:
+    CFile(char *file_str, int indent_col);
+    virtual ~CFile();
+
+    long  get_delta_ts(CFile &f);
+    long  get_ts();
+    bool  lt(CFile &f);
+    bool  is_ok();
+    long  peek_ts();
+    void  print_line();
+    void  print_line_ts(long delta_ts);
+    void  read_line();
+
+private:
+    void  set_ok(bool ok_in);
+    bool  ts_ok();
+    void  ts_set(char *line, long *ts_ret);
+
+    FILE *fp;
+    char *indent;
+    char *lp;
+    bool  ok;
+    char *peekp;
+    long  ts;
+};
+
+CFile::CFile(char *file_str, int indent_col) {
+    fp = fopen(file_str, "r");
+    lp = NULL;
+    ok = (fp != NULL);
+    peekp = NULL;
+    indent = new char[indent_col+1];
+    for (int inx = 0; inx < indent_col; inx++)
+        indent[inx] = ' ';
+    indent[indent_col] = '\0';
+}
+
+CFile::~CFile() {
+    if (lp != NULL)
+        free(lp);
+    if (peekp != NULL)
+        free(peekp);
+    if (fp != NULL)
+        fclose(fp);
+    delete [] indent;
+}
+
+long CFile::get_delta_ts(CFile &f) {
+    long delta_ts = f.get_ts() - get_ts();
+    long next_ts = peek_ts() - get_ts();
+    if (next_ts > 0) {
+        if (next_ts < delta_ts)
+            delta_ts = next_ts;
+        else if (delta_ts < 0)
+            delta_ts = next_ts;
+    }
+    return delta_ts;
+}
+
+long CFile::get_ts() {
+    return ts;
+}
+
+bool CFile::is_ok() {
+    return ok;
+}
+
+bool CFile::lt(CFile &f) {
+    bool ret;
+
+    ret = false;
+    if (is_ok() && f.is_ok()) {
+        if (ts_ok()) {
+            ret = (ts < f.ts);
+        }
+    }
+    if (verbose)
+        printf("lt=%d, ts1=%ld, t2s=%ld\n",
+               ret, ts, f.ts);
+    return ret;
+}
+
+long CFile::peek_ts() {
+    long ret = 0;
+    size_t len = 0;
+    ssize_t gl_ret = getline(&peekp, &len, fp);
+    if (gl_ret != -1) {
+        if (gl_ret > 0) {
+            if (peekp[gl_ret - 1] == '\n')
+                peekp[gl_ret - 1] = '\0';
+        }
+        ts_set(peekp, &ret);
+    } else
+        set_ok(false);
+    return ret;
+}
+
+void CFile::print_line() {
+    if (lp != NULL)
+        printf("%s%s\n", indent, lp);
+}
+
+void CFile::print_line_ts(long delta_ts) {
+    if ((lp != NULL) && ts_ok()) {
+        // 0123456789012345
+        // 21:14:59.019.699
+        lp[16] = '\0';
+        char delta[20];
+        if (delta_ts < 0)
+            strcpy(delta, "           ");
+        else
+            sprintf(delta, "(>%8ld)", delta_ts);
+        printf("%s%s%s %s\n", indent, lp, delta, &lp[17]);
+    }
+}
+
+void CFile::read_line() {
+    if (peekp == NULL) {
+        if (lp != NULL) {
+            free(lp);
+            lp = NULL;
+        }
+        size_t len = 0;
+        ssize_t gl_ret = getline(&lp, &len, fp);
+        if (gl_ret != -1) {
+            if (gl_ret > 0) {
+                if (lp[gl_ret - 1] == '\n')
+                    lp[gl_ret - 1] = '\0';
+            }
+            ts_set(lp, NULL);
+        } else
+            set_ok(false);
+    } else {
+        lp = peekp;
+        peekp = NULL;
+        ts_set(lp, NULL);
+    }
+}
+
+void CFile::set_ok(bool ok_in) {
+    ok = ok_in;
+}
+
+bool CFile::ts_ok() {
+    bool ret;
+    ret = (ts > 0);
+    return ret;
+}
+
+void CFile::ts_set(char *line, long *ts_ret) {
+    long lts;
+    // 0123456789012345
+    // 21:14:59.019.699
+    if ((line[2] == ':') && 
+        (line[5] == ':') && 
+        (line[8] == '.') && 
+        (line[12] == '.') &&
+        ((line[0] >= '0') && (line[0] <= '2')) &&
+        isdigit(line[1]) &&
+        ((line[3] >= '0') && (line[3] <= '5')) &&
+        isdigit(line[4]) &&
+        ((line[6] >= '0') && (line[6] <= '5')) &&
+        isdigit(line[7]) &&
+        isdigit(line[9]) &&
+        isdigit(line[10]) &&
+        isdigit(line[11]) &&
+        isdigit(line[13]) &&
+        isdigit(line[14]) &&
+        isdigit(line[15])) {
+        long hrs = atoi(&line[0]);
+        long min = atoi(&line[3]);
+        long sec = atoi(&line[6]);
+        long ms = atoi(&line[9]);
+        long us = atoi(&line[13]);
+        lts = hrs * 3600L * 1000000L +
+              min * 60L * 1000000L +
+              sec * 1000000L +
+              ms * 1000L +
+              us;
+    } else {
+         lts = 0;
+    }
+    if (ts_ret == NULL)
+        ts = lts;
+    else
+        *ts_ret = lts;
+}
+
+void do_delta(char *fstr) {
+    CFile f(fstr, 0);
+
+    do {    
+        f.read_line();
+        long next_ts = f.peek_ts();
+        long delta_ts = next_ts - f.get_ts();
+        f.print_line_ts(delta_ts);
+    } while (f.is_ok());
+}
+
+void print_usage(char *argv[]) {
+    printf("usage: %s [-v] file...\n", argv[0]);
+}
+
+int main(int argc, char *argv[]) {
+    CALL_COMP_DOVERS(seabed_test_tdelta, argc, argv);
+    int cnt = 0;
+    for (int arg = 1; arg < argc; arg++) {
+        char *p = argv[arg];
+        if (*p == '-') {
+            if (strcmp(p, "-v") == 0)
+                verbose = true;
+            else {
+                printf("invalid option\n");
+                print_usage(argv);
+                return 1;
+            }
+        } else
+            cnt++;
+    }
+    if (cnt == 0) {
+        printf("one file needed\n");
+        print_usage(argv);
+        return 1;
+    }
+
+    for (int arg = 1; arg < argc; arg++) {
+        char *p = argv[arg];
+        if (*p != '-')
+            do_delta(p);
+    }
+
+    return 0;
+}
+

http://git-wip-us.apache.org/repos/asf/trafodion/blob/8b025eae/core/sqf/src/seabed/test/tmerge.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/seabed/test/tmerge.cpp b/core/sqf/src/seabed/test/tmerge.cpp
new file mode 100644
index 0000000..6b7e3ba
--- /dev/null
+++ b/core/sqf/src/seabed/test/tmerge.cpp
@@ -0,0 +1,294 @@
+//------------------------------------------------------------------
+//
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+
+#include <ctype.h>
+#include <stdio.h>
+
+#include "tversbin.h"
+
+VERS_BIN(seabed_test_tmerge)
+
+DEFINE_COMP_DOVERS(seabed_test_tmerge)
+
+bool delta = false;
+bool verbose = false;
+
+class CFile {
+public:
+    CFile(char *file_str, int indent_col);
+    virtual ~CFile();
+
+    long  get_delta_ts(CFile &f);
+    long  get_ts();
+    bool  lt(CFile &f);
+    bool  is_ok();
+    long  peek_ts();
+    void  print_line();
+    void  print_line_ts(long delta_ts);
+    void  read_line();
+
+private:
+    void  set_ok(bool ok_in);
+    bool  ts_ok();
+    void  ts_set(char *line, long *ts_ret);
+
+    FILE *fp;
+    char *indent;
+    char *lp;
+    bool  ok;
+    char *peekp;
+    long  ts;
+};
+
+CFile::CFile(char *file_str, int indent_col) {
+    fp = fopen(file_str, "r");
+    lp = NULL;
+    ok = (fp != NULL);
+    peekp = NULL;
+    indent = new char[indent_col+1];
+    for (int inx = 0; inx < indent_col; inx++)
+        indent[inx] = ' ';
+    indent[indent_col] = '\0';
+}
+
+CFile::~CFile() {
+    if (lp != NULL)
+        free(lp);
+    if (peekp != NULL)
+        free(peekp);
+    if (fp != NULL)
+        fclose(fp);
+    delete [] indent;
+}
+
+long CFile::get_delta_ts(CFile &f) {
+    long delta_ts = f.get_ts() - get_ts();
+    long next_ts = peek_ts() - get_ts();
+    if (next_ts > 0) {
+        if (next_ts < delta_ts)
+            delta_ts = next_ts;
+        else if (delta_ts < 0)
+            delta_ts = next_ts;
+    }
+    return delta_ts;
+}
+
+long CFile::get_ts() {
+    return ts;
+}
+
+bool CFile::is_ok() {
+    return ok;
+}
+
+bool CFile::lt(CFile &f) {
+    bool ret;
+
+    ret = false;
+    if (is_ok() && f.is_ok()) {
+        if (ts_ok()) {
+            ret = (ts < f.ts);
+        }
+    }
+    if (verbose)
+        printf("lt=%d, ts1=%ld, t2s=%ld\n",
+               ret, ts, f.ts);
+    return ret;
+}
+
+long CFile::peek_ts() {
+    long ret = 0;
+    size_t len = 0;
+    ssize_t gl_ret = getline(&peekp, &len, fp);
+    if (gl_ret != -1) {
+        if (gl_ret > 0) {
+            if (peekp[gl_ret - 1] == '\n')
+                peekp[gl_ret - 1] = '\0';
+        }
+        ts_set(peekp, &ret);
+    } else
+        set_ok(false);
+    return ret;
+}
+
+void CFile::print_line() {
+    if (lp != NULL)
+        printf("%s%s\n", indent, lp);
+}
+
+void CFile::print_line_ts(long delta_ts) {
+    if ((lp != NULL) && ts_ok()) {
+        // 0123456789012345
+        // 21:14:59.019.699
+        lp[16] = '\0';
+        char delta[20];
+        if (delta_ts < 0)
+            strcpy(delta, "           ");
+        else
+            sprintf(delta, "(>%8ld)", delta_ts);
+        printf("%s%s%s %s\n", indent, lp, delta, &lp[17]);
+    }
+}
+
+void CFile::read_line() {
+    if (peekp == NULL) {
+        if (lp != NULL) {
+            free(lp);
+            lp = NULL;
+        }
+        size_t len = 0;
+        ssize_t gl_ret = getline(&lp, &len, fp);
+        if (gl_ret != -1) {
+            if (gl_ret > 0) {
+                if (lp[gl_ret - 1] == '\n')
+                    lp[gl_ret - 1] = '\0';
+            }
+            ts_set(lp, NULL);
+        } else
+            set_ok(false);
+    } else {
+        lp = peekp;
+        peekp = NULL;
+        ts_set(lp, NULL);
+    }
+}
+
+void CFile::set_ok(bool ok_in) {
+    ok = ok_in;
+}
+
+bool CFile::ts_ok() {
+    bool ret;
+    ret = (ts > 0);
+    return ret;
+}
+
+void CFile::ts_set(char *line, long *ts_ret) {
+    long lts;
+    // 0123456789012345
+    // 21:14:59.019.699
+    if ((line[2] == ':') && 
+        (line[5] == ':') && 
+        (line[8] == '.') && 
+        (line[12] == '.') &&
+        ((line[0] >= '0') && (line[0] <= '2')) &&
+        isdigit(line[1]) &&
+        ((line[3] >= '0') && (line[3] <= '5')) &&
+        isdigit(line[4]) &&
+        ((line[6] >= '0') && (line[6] <= '5')) &&
+        isdigit(line[7]) &&
+        isdigit(line[9]) &&
+        isdigit(line[10]) &&
+        isdigit(line[11]) &&
+        isdigit(line[13]) &&
+        isdigit(line[14]) &&
+        isdigit(line[15])) {
+        long hrs = atoi(&line[0]);
+        long min = atoi(&line[3]);
+        long sec = atoi(&line[6]);
+        long ms = atoi(&line[9]);
+        long us = atoi(&line[13]);
+        lts = hrs * 3600L * 1000000L +
+              min * 60L * 1000000L +
+              sec * 1000000L +
+              ms * 1000L +
+              us;
+    } else {
+         lts = 0;
+    }
+    if (ts_ret == NULL)
+        ts = lts;
+    else
+        *ts_ret = lts;
+}
+
+void do_merge(char *flstr, char *frstr) {
+    CFile fl(flstr, 0);
+    CFile fr(frstr, 17);
+    long delta_ts;
+
+    fl.read_line();
+    fr.read_line();
+
+    do {    
+        while (fl.lt(fr) || (fl.is_ok() && !fr.is_ok())) {
+            if (delta) {
+                delta_ts = fl.get_delta_ts(fr);
+                fl.print_line_ts(delta_ts);
+            } else
+                fl.print_line();
+            fl.read_line();
+        }
+        if (delta) {
+            delta_ts = fr.get_delta_ts(fl);
+            fr.print_line_ts(delta_ts);
+        } else
+            fr.print_line();
+        fr.read_line();
+    } while (fl.is_ok() || fr.is_ok());
+}
+
+void print_usage(char *argv[]) {
+    printf("usage: %s [-d] [-v] fileL fileR\n", argv[0]);
+}
+
+int main(int argc, char *argv[]) {
+    char *flstr = NULL;
+    char *frstr = NULL;
+
+    CALL_COMP_DOVERS(seabed_test_tmerge, argc, argv);
+    for (int arg = 1; arg < argc; arg++) {
+        char *p = argv[arg];
+        if (*p == '-') {
+            if (strcmp(p, "-d") == 0)
+                delta = true;
+            else if (strcmp(p, "-v") == 0)
+                verbose = true;
+            else {
+                printf("invalid option\n");
+                print_usage(argv);
+                return 1;
+            }
+        } else {
+            if (flstr == NULL)
+                flstr = p;
+            else if (frstr == NULL)
+                frstr = p;
+            else {
+                printf("too many files\n");
+                print_usage(argv);
+                return 1;
+            }
+        }
+    }
+    if ((flstr == NULL) || (frstr == NULL)) {
+        printf("two files needed\n");
+        print_usage(argv);
+        return 1;
+    }
+
+    do_merge(flstr, frstr);
+
+    return 0;
+}
+


[28/50] [abbrv] trafodion git commit: Set NS delay to 10ms (instead of 100ms for monitor).

Posted by su...@apache.org.
Set NS delay to 10ms (instead of 100ms for monitor).


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

Branch: refs/heads/master
Commit: 7d50e33c8822316116b476c59e639c955b49bbe3
Parents: 4fc4ad3
Author: Dave George <de...@gmail.com>
Authored: Thu Apr 12 20:43:07 2018 +0000
Committer: Dave George <de...@gmail.com>
Committed: Thu Apr 12 20:43:07 2018 +0000

----------------------------------------------------------------------
 core/sqf/monitor/linux/monitor.cxx | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/7d50e33c/core/sqf/monitor/linux/monitor.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/monitor.cxx b/core/sqf/monitor/linux/monitor.cxx
index 578d158..933dee5 100755
--- a/core/sqf/monitor/linux/monitor.cxx
+++ b/core/sqf/monitor/linux/monitor.cxx
@@ -116,7 +116,11 @@ char MyPtPPort[MPI_MAX_PORT_NAME] = {'\0'};
 char Node_name[MPI_MAX_PROCESSOR_NAME] = {'\0'};
 sigset_t SigSet;
 bool Emulate_Down = false;
+#ifdef NAMESERVER_PROCESS
+long next_test_delay = 10000; // in usec. (default 10 msec)
+#else
 long next_test_delay = 100000; // in usec. (default 100 msec)
+#endif
 CClusterConfig *ClusterConfig = NULL;
 bool IAmIntegrating = false;
 bool IAmIntegrated = false;


[43/50] [abbrv] trafodion git commit: Added trace file to monitor test.

Posted by su...@apache.org.
Added trace file to monitor test.


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

Branch: refs/heads/master
Commit: c870630de22bb900b7d89c4ffce96688b4901977
Parents: cd4f700
Author: Zalo Correa <za...@esgyn.com>
Authored: Mon Jun 4 07:36:26 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Mon Jun 4 07:36:26 2018 -0700

----------------------------------------------------------------------
 core/sqf/monitor/test/nameserver.env | 61 +++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/c870630d/core/sqf/monitor/test/nameserver.env
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/test/nameserver.env b/core/sqf/monitor/test/nameserver.env
new file mode 100644
index 0000000..25029ce
--- /dev/null
+++ b/core/sqf/monitor/test/nameserver.env
@@ -0,0 +1,61 @@
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+
+# Uncomment MON_TRACE_ENABLE and specific tracing level to enable 
+# Trafodion monitor process tracing
+#MON_TRACE_ENABLE=1
+#MON_TRACE_EVLOG_MSG=1
+#MON_TRACE_INIT=1
+#MON_TRACE_RECOVERY=1
+#MON_TRACE_REQUEST=1
+#MON_TRACE_PROCESS=1
+#MON_TRACE_NOTICE=1
+#MON_TRACE_NS=1
+#MON_TRACE_SYNC=1
+# Enable TC_TRACE_* along with MON_TRACE_TRAFCONFIG for more detail
+#MON_TRACE_TRAFCONFIG=1
+#MON_TRACE_MLIO=1
+
+#MON_TRACE_REQUEST_DETAIL=1
+#MON_TRACE_PROCESS_DETAIL=1
+#MON_TRACE_NOTICE_DETAIL=1
+#MON_TRACE_SYNC_DETAIL=1
+#MON_TRACE_MLIO_DETAIL=1
+
+#MON_TRACE_MEAS=1
+#MON_TRACE_TMSYNC=1
+#MON_TRACE_STATS=1
+#MON_TRACE_ENTRY_EXIT=1
+#MON_TRACE_REDIRECTION=1
+#MON_TRACE_HEALTH=1
+#MON_TRACE_SIG_HANDLER=1
+
+# Uncomment TC_TRACE_ENABLE and specific tracing level to enable 
+# Trafodion Configuration library tracing
+# TC_TRACE_ENABLE requires MON_TRACE_TRAFCONFIG above
+#TC_TRACE_ENABLE=1
+#TC_TRACE_REQUEST=1
+#TC_TRACE_NODE=1
+#TC_TRACE_PERSIST=1
+#TC_TRACE_REGISTRY=1
+#TC_TRACE_INIT=1
+#TC_TRACE_LOG_MSG=1
+#TC_TRACE_ENTRY_EXIT=1


[29/50] [abbrv] trafodion git commit: Modify monConnCount and choose NS random.

Posted by su...@apache.org.
Modify monConnCount and choose NS random.


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

Branch: refs/heads/master
Commit: c1be6d0b815f4b15c58adb80cea0a9af49bc1f97
Parents: 7d50e33
Author: Dave George <de...@gmail.com>
Authored: Thu Apr 12 20:53:20 2018 +0000
Committer: Dave George <de...@gmail.com>
Committed: Thu Apr 12 20:53:20 2018 +0000

----------------------------------------------------------------------
 core/sqf/monitor/linux/cluster.cxx         | 9 +++++----
 core/sqf/monitor/linux/nameserver.cxx      | 6 ++++++
 core/sqf/monitor/linux/nscommacceptmon.cxx | 2 +-
 3 files changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/c1be6d0b/core/sqf/monitor/linux/cluster.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/cluster.cxx b/core/sqf/monitor/linux/cluster.cxx
index 514771d..e2f7dbf 100644
--- a/core/sqf/monitor/linux/cluster.cxx
+++ b/core/sqf/monitor/linux/cluster.cxx
@@ -6810,7 +6810,7 @@ void CCluster::UpdateClusterState( bool &doShutdown,
                 nodestate[index].nodeMask.upNodes[i] = 0;
             }
 #ifdef NAMESERVER_PROCESS
-            nodestate[index].monConnCount = 0;
+            nodestate[index].monConnCount = -1;
 #endif
 
             continue;
@@ -7017,7 +7017,7 @@ void CCluster::UpdateClusterState( bool &doShutdown,
                     nodestate[index].nodeMask.upNodes[i] = 0;
                 }
 #ifdef NAMESERVER_PROCESS
-                nodestate[index].monConnCount = 0;
+                nodestate[index].monConnCount = -1;
 #endif
 
                 if ( validateNodeDown_ )
@@ -7211,10 +7211,11 @@ void CCluster::UpdateClusterState( bool &doShutdown,
     int minConnPnid = -1;
     for (int index = 0; index < GetConfigPNodesMax(); index++)
     {
-        if ( nodestate[index].monConnCount < minConnCount )
+        int connCount = nodestate[index].monConnCount;
+        if ( ( connCount >= 0 ) && ( connCount < minConnCount ) )
         {
             minConnPnid = index;
-            minConnCount = nodestate[index].monConnCount;
+            minConnCount = connCount;
         }
     }
     myMonConnCount_ = nodestate[MyPNID].monConnCount;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/c1be6d0b/core/sqf/monitor/linux/nameserver.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nameserver.cxx b/core/sqf/monitor/linux/nameserver.cxx
index 93f99b3..ef67562 100644
--- a/core/sqf/monitor/linux/nameserver.cxx
+++ b/core/sqf/monitor/linux/nameserver.cxx
@@ -88,6 +88,12 @@ void CNameServer::ChooseNextNs( void )
     TRACE_ENTRY;
 
     static unsigned int seed = 1;
+    static bool fix_seed = true;
+    if ( fix_seed )
+    {
+        seed += MyNode->GetPNid();
+        fix_seed = false;
+    }
     int cnt = NameServerConfig->GetCount();
     int rnd = (int) ((float) (cnt) * (rand_r(&seed) / (RAND_MAX + 1.0)));
     CNameServerConfig *config = NameServerConfig->GetFirstConfig();

http://git-wip-us.apache.org/repos/asf/trafodion/blob/c1be6d0b/core/sqf/monitor/linux/nscommacceptmon.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nscommacceptmon.cxx b/core/sqf/monitor/linux/nscommacceptmon.cxx
index 3482608..cc91eba 100644
--- a/core/sqf/monitor/linux/nscommacceptmon.cxx
+++ b/core/sqf/monitor/linux/nscommacceptmon.cxx
@@ -635,7 +635,7 @@ int CCommAcceptMon::processMonReqsGetBestNs( void )
     TRACE_ENTRY;
     int pnid;
 
-    int myCount = Monitor->GetMyMonConnCount();
+    int myCount = MyNode->GetMonConnCount();
     int minCount = Monitor->GetMinMonConnCount();
     if ( myCount <= (minCount + HEURISTIC_COUNT) )
     {


[18/50] [abbrv] trafodion git commit: Merge branch 'TRAFODION-2884' of github.com:zcorrea/trafodion into TRAFODION-2884

Posted by su...@apache.org.
Merge branch 'TRAFODION-2884' of github.com:zcorrea/trafodion into TRAFODION-2884


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

Branch: refs/heads/master
Commit: 71d6a1b24cd705ed2176aef64c753c4e32a960c2
Parents: 5d982b8 f9d5b2c
Author: Zalo Correa <za...@esgyn.com>
Authored: Thu Apr 5 08:46:31 2018 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Thu Apr 5 08:46:31 2018 -0700

----------------------------------------------------------------------
 core/sqf/src/seabed/test/godb.pl | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------