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 2017/06/22 17:08:44 UTC
[6/7] incubator-trafodion git commit: [TRAFODION-2648] Added support
for _PROGRAM_ARGS [TRAFODION-2650] Preliminary code
restructing to support multiple Trafodion Configuration storage methods
[TRAFODION-2648] Added support for <persist-process-prefix>_PROGRAM_ARGS
[TRAFODION-2650] Preliminary code restructing to support multiple Trafodion Configuration storage methods
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/47d54af4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/47d54af4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/47d54af4
Branch: refs/heads/master
Commit: 47d54af4f6b9e5aebbb1e92764eb6edd1c2bb34c
Parents: 53148a7
Author: Zalo Correa <za...@esgyn.com>
Authored: Tue Jun 20 21:15:15 2017 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Tue Jun 20 21:15:15 2017 -0700
----------------------------------------------------------------------
.../export/include/common/evl_sqlog_eventnum.h | 47 +-
core/sqf/monitor/linux/clusterconf.cxx | 14 +-
core/sqf/monitor/linux/clusterconf.h | 49 +-
core/sqf/monitor/linux/makefile | 49 +-
core/sqf/monitor/linux/montrace.cxx | 92 +-
core/sqf/monitor/linux/montrace.h | 30 +-
core/sqf/monitor/linux/persistconfig.cxx | 69 +
core/sqf/monitor/linux/persistconfig.h | 11 +
core/sqf/monitor/linux/pnode.cxx | 5 +-
core/sqf/monitor/linux/pnode.h | 2 +-
core/sqf/monitor/linux/pstartd.cxx | 51 +-
core/sqf/monitor/linux/pstartd.h | 2 +-
core/sqf/monitor/linux/reqqueue.cxx | 15 -
core/sqf/monitor/linux/shell.cxx | 126 +-
core/sqf/monitor/linux/sqliteconfig.cxx | 3383 -----------------
core/sqf/monitor/linux/sqliteconfig.h | 133 -
core/sqf/monitor/linux/tcdb.cxx | 478 +++
core/sqf/monitor/linux/tcdb.h | 117 +
core/sqf/monitor/linux/tcdbsqlite.cxx | 3398 ++++++++++++++++++
core/sqf/monitor/linux/tcdbsqlite.h | 130 +
core/sqf/monitor/linux/tcdbstore.cxx | 55 +
core/sqf/monitor/linux/tcdbstore.h | 113 +
core/sqf/monitor/linux/tcdbzstore.cxx | 2192 +++++++++++
core/sqf/monitor/linux/tcdbzstore.h | 130 +
core/sqf/monitor/linux/tclog.cxx | 121 +
core/sqf/monitor/linux/tclog.h | 46 +
core/sqf/monitor/linux/tctrace.cxx | 360 ++
core/sqf/monitor/linux/tctrace.h | 103 +
core/sqf/monitor/linux/testconf.cxx | 8 +-
core/sqf/monitor/linux/trafconf.cxx | 31 +-
core/sqf/monitor/linux/trafconfig.cxx | 218 +-
core/sqf/monitor/linux/trafconfig.h | 23 +-
core/sqf/monitor/linux/trafconfiglog.cxx | 121 -
core/sqf/monitor/linux/trafconfiglog.h | 44 -
core/sqf/monitor/linux/trafconfigtrace.cxx | 349 --
core/sqf/monitor/linux/trafconfigtrace.h | 103 -
core/sqf/monitor/linux/type2str.cxx | 63 +
core/sqf/monitor/linux/type2str.h | 34 +
core/sqf/monitor/linux/watchdog.cxx | 2 +-
core/sqf/monitor/linux/zclient.cxx | 114 +-
core/sqf/sqenvcom.sh | 6 +
core/sqf/sql/scripts/createConfigDb | 4 +-
core/sqf/sql/scripts/sqconfig.persist | 8 +
core/sqf/sql/scripts/sqpersist.pm | 30 +-
44 files changed, 8024 insertions(+), 4455 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/47d54af4/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 3b8954b..dbf8d92 100644
--- a/core/sqf/export/include/common/evl_sqlog_eventnum.h
+++ b/core/sqf/export/include/common/evl_sqlog_eventnum.h
@@ -810,7 +810,7 @@
/* Module: persistconfig.cxx = 36 */
#define MON_PERSISTCONFIG_ADDCONFIG_1 101360101
-/* Module: zoonode.cxx = 37 */
+/* Module: zclient.cxx = 37 */
#define MON_ZCLIENT_ZCLIENT_1 101370101
#define MON_ZCLIENT_ZCLIENT_2 101370102
#define MON_ZCLIENT_ZCLIENT_3 101370103
@@ -846,8 +846,49 @@
#define MON_ZCLIENT_CHECKMYZNODE_1 101371901
#define MON_ZCLIENT_CHECKMYZNODE_2 101371902
-/* Module: sqliteconfig.cxx = 90 */
-#define MON_DATABASE_ERROR 101900101
+/* Module: zconfig.cxx = 38 */
+#define ZCONFIG_ZCONFIG_1 101380101
+#define ZCONFIG_ZCONFIG_2 101380102
+#define ZCONFIG_ZCONFIG_3 101380103
+#define ZCONFIG_ZCONFIG_4 101380104
+#define ZCONFIG_CHECKCONFIG_1 101380201
+#define ZCONFIG_CHECKCONFIG_2 101380202
+#define ZCONFIG_GETCONFIGZNODESCHILDREN_1 101380301
+#define ZCONFIG_GETZNODEDATA_1 101380401
+#define ZCONFIG_GETZNODEDATA_2 101380402
+#define ZCONFIG_ISZNODEEXISTENT_1 101380501
+#define ZCONFIG_ISZNODEEXISTENT_2 101380502
+#define ZCONFIG_MAKECONFIGZNODE_1 101380601
+#define ZCONFIG_REGISTERZNODE_1 101380701
+#define ZCONFIG_SETZNODEWATCH_1 101380801
+#define ZCONFIG_SETZNODEWATCH_2 101380802
+#define ZCONFIG_WATCHCONFIG_1 101380901
+#define ZCONFIG_WATCHCONFIG_2 101380902
+#define ZCONFIG_WATCHCONFIG_2 101380902
+#define ZCONFIG_WATCHCONFIGZNODE_1 101381001
+#define ZCONFIG_DELETECONFIGZNODE_1 101381001
+#define ZCONFIG_DELETECONFIGZNODE_2 101381002
+#define ZCONFIG_DELETECONFIGZNODE_3 101381003
+
+/* Module: tcdb.cxx = 90 */
+#define TCDB_TCDB_1 101900101
+#define TCDB_TCDB_2 101900102
+#define TCDB_TCDB_3 101900103
+
+/* Module: tcdbzstore.cxx = 91 */
+#define TCDB_ZSTORE_SESSIONWATCHER_1 101910101
+#define TCDB_ZSTORE_SESSIONWATCHER_2 101910102
+#define TCDB_ZSTORE_ZSTORE_1 101910201
+#define TCDB_ZSTORE_ZSTORE_2 101910202
+#define TCDB_ZSTORE_ZSTORE_3 101910203
+#define TCDB_ZSTORE_ZSTORE_4 101910204
+#define TCDB_ZSTORE_MAKECLUSTERZNODES_1 101910301
+#define TCDB_ZSTORE_MAKECLUSTERZNODES_2 101910302
+#define TCDB_ZSTORE_MAKECLUSTERZNODES_3 101910303
+
+/* Module: tcdbsqlite.cxx = 92 */
+#define SQLITE_DB_ACCESS_ERROR 101920101
+
/**********************************************/
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/47d54af4/core/sqf/monitor/linux/clusterconf.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/clusterconf.cxx b/core/sqf/monitor/linux/clusterconf.cxx
index 1316b02..205bf36 100644
--- a/core/sqf/monitor/linux/clusterconf.cxx
+++ b/core/sqf/monitor/linux/clusterconf.cxx
@@ -60,8 +60,10 @@ CClusterConfig::CClusterConfig( void )
, persistReady_(false)
, newPNodeConfig_(true)
, trafConfigInitialized_(false)
+ , trafConfigStorageType_(TCDBSTOREUNDEFINED)
, prevPNodeConfig_(NULL)
, prevLNodeConfig_(NULL)
+ , prevPersistConfig_(NULL)
{
const char method_name[] = "CClusterConfig::CClusterConfig";
TRACE_ENTRY;
@@ -297,6 +299,11 @@ PROCESSTYPE CClusterConfig::GetProcessType( const char *processtype )
bool CClusterConfig::Initialize( void )
{
+ return( Initialize( NULL ) );
+}
+
+bool CClusterConfig::Initialize( const char *traceFile )
+{
const char method_name[] = "CClusterConfig::Initialize";
TRACE_ENTRY;
@@ -307,7 +314,7 @@ bool CClusterConfig::Initialize( void )
}
bool trafConfigTrace = (trace_settings & TRACE_TRAFCONFIG);
- int rc = tc_initialize( trafConfigTrace );
+ int rc = tc_initialize( trafConfigTrace, traceFile );
if ( rc )
{
char la_buf[MON_STRING_BUF_SIZE];
@@ -319,6 +326,7 @@ bool CClusterConfig::Initialize( void )
}
trafConfigInitialized_ = true;
+ trafConfigStorageType_ = tc_get_storage_type();
TRACE_EXIT;
return( true );
@@ -654,6 +662,10 @@ void CClusterConfig::ProcessPersistInfo( persist_configuration_t &persistConfig
, persistConfig.program_name
, sizeof(persistConfigInfo.programName) );
+ strncpy( persistConfigInfo.programArgs
+ , persistConfig.program_args
+ , sizeof(persistConfigInfo.programArgs) );
+
persistConfigInfo.requiresDTM = persistConfig.requires_DTM;
strncpy( workValue, persistConfig.std_out, sizeof(workValue) );
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/47d54af4/core/sqf/monitor/linux/clusterconf.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/clusterconf.h b/core/sqf/monitor/linux/clusterconf.h
index 00ace06..d9a1b79 100644
--- a/core/sqf/monitor/linux/clusterconf.h
+++ b/core/sqf/monitor/linux/clusterconf.h
@@ -44,10 +44,12 @@ public:
void Clear( void );
bool DeleteNodeConfig( int pnid );
bool Initialize( void );
+ bool Initialize( const char *traceFile );
void InitCoreMask( cpu_set_t &coreMask );
inline bool IsConfigReady( void ) { return( nodeReady_ && persistReady_ ); }
inline bool IsNodeReady( void ) { return( nodeReady_ ); }
inline bool IsPersistReady( void ) { return( persistReady_ ); }
+ inline TC_STORAGE_TYPE GetStorageType( void ) { return(trafConfigStorageType_); }
bool LoadConfig( void );
bool LoadNodeConfig( void );
bool LoadPersistConfig( void );
@@ -75,55 +77,10 @@ private:
bool persistReady_; // true when persist configuration loaded
bool newPNodeConfig_;
bool trafConfigInitialized_;
+ TC_STORAGE_TYPE trafConfigStorageType_;
CPNodeConfig *prevPNodeConfig_;
CLNodeConfig *prevLNodeConfig_;
CPersistConfig *prevPersistConfig_;
-#if 0
- bool excludedCores_;
- bool newPNodeConfig_;
- bool newLNodeConfig_;
- int currNid_;
- int currPNid_;
- int currSPNid_;
- char currNodename_[MPI_MAX_PROCESSOR_NAME];
- cpu_set_t currExcludedCoreMask_;
- cpu_set_t currCoreMask_;
- int currExcludedFirstCore_;
- int currExcludedLastCore_;
- int currFirstCore_;
- int currLastCore_;
- int currProcessor_;
- ZoneType currZoneType_;
- CPNodeConfig *currPNodeConfig_;
- int prevNid_;
- int prevPNid_;
- int prevSPNid_;
- char prevNodename_[MPI_MAX_PROCESSOR_NAME];
- cpu_set_t prevExcludedCoreMask_;
- cpu_set_t prevCoreMask_;
- int prevExcludedFirstCore_;
- int prevExcludedLastCore_;
- int prevFirstCore_;
- int prevLastCore_;
- int prevProcessor_;
- ZoneType prevZoneType_;
- int sparePNid_[MAX_NODES];
- int spareIndex_;
- CPNodeConfig *prevPNodeConfig_;
- CLNodeConfig *lnodeConfig_;
- char persistPrefix_[PERSIST_KEY_MAX];
- char processNamePrefix_[PERSIST_VALUE_MAX];
- char processNameFormat_[PERSIST_VALUE_MAX];
- char stdoutPrefix_[PERSIST_VALUE_MAX];
- char stdoutFormat_[PERSIST_VALUE_MAX];
- char programName_[PERSIST_VALUE_MAX];
- char zoneFormat_[PERSIST_VALUE_MAX];
- PROCESSTYPE processType_;
- bool requiresDTM_;
- int persistRetries_;
- int persistWindow_;
- CPersistConfig *persistConfig_;
-#endif
void AddNodeConfiguration( pnodeConfigInfo_t &pnodeConfigInfo
, lnodeConfigInfo_t &lnodeConfigInfo );
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/47d54af4/core/sqf/monitor/linux/makefile
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/makefile b/core/sqf/monitor/linux/makefile
index b8c034a..8f77157 100644
--- a/core/sqf/monitor/linux/makefile
+++ b/core/sqf/monitor/linux/makefile
@@ -220,6 +220,7 @@ MONITOROBJS += $(OUTDIR)/gentrap.o
MONITOROBJS += $(OUTDIR)/monrobsem.o
MONITOROBJS += $(OUTDIR)/CommonLogger.o
MONITOROBJS += $(OUTDIR)/zclient.o
+MONITOROBJS += $(OUTDIR)/type2str.o
SHELLOBJS = $(OUTDIR)/shell.o
SHELLOBJS += $(OUTDIR)/monclio.o
@@ -301,18 +302,30 @@ TRAFCONFOBJS += $(OUTDIR)/lnodeconfig.o
TRAFCONFOBJS += $(OUTDIR)/pnodeconfig.o
TRAFCONFOBJS += $(OUTDIR)/persistconfig.o
-SQLITECONFIG_SRC = sqliteconfig.cxx
-SQLITECONFIG_OBJS = $(OUTDIR)/sqliteconfig.o
+TCDB_SRC = tcdb.cxx
+TCDB_OBJS = $(OUTDIR)/tcdb.o
-TRAFCONFIGLOG_SRC = trafconfiglog.cxx
-TRAFCONFIGLOG_OBJS = $(OUTDIR)/trafconfiglog.o
+TCDBSQLITE_SRC = tcdbsqlite.cxx
+TCDBSQLITE_OBJS = $(OUTDIR)/tcdbsqlite.o
-TRAFCONFIGTRACE_SRC = trafconfigtrace.cxx
-TRAFCONFIGTRACE_OBJS = $(OUTDIR)/trafconfigtrace.o
+TCDBSTORE_SRC = tcdbstore.cxx
+TCDBSTORE_OBJS = $(OUTDIR)/tcdbstore.o
+
+TCDBZSTORE_SRC = tcdbzstore.cxx
+TCDBZSTORE_OBJS = $(OUTDIR)/tcdbzstore.o
+
+TCLOG_SRC = tclog.cxx
+TCLOG_OBJS = $(OUTDIR)/tclog.o
+
+TCTRACE_SRC = tctrace.cxx
+TCTRACE_OBJS = $(OUTDIR)/tctrace.o
TRAFCONFIG_SRC = trafconfig.cxx
TRAFCONFIG_OBJS = $(OUTDIR)/trafconfig.o
+TYPE2STR_SRC = type2str.cxx
+TYPE2STR_OBJS = $(OUTDIR)/type2str.o
+
ALLOBJS = $(MONITOROBJS)
ALLOBJS += $(SHELLOBJS)
ALLOBJS += $(CLIENTOBJS)
@@ -326,10 +339,14 @@ ALLOBJS += $(MEMLOGOBJS)
ALLOBJS += $(RTSIGBLOCK_OBJS)
ALLOBJS += $(ZOOMONOBJS)
ALLOBJS += $(TRAFCONFOBJS)
-ALLOBJS += $(SQLITECONFIG_OBJS)
+ALLOBJS += $(TCDB_OBJS)
+ALLOBJS += $(TCDBSQLITE_OBJS)
+ALLOBJS += $(TCDBSTORE_OBJS)
+#ALLOBJS += $(TCDBZSTORE_OBJS)
+ALLOBJS += $(TCLOG_OBJS)
+ALLOBJS += $(TCTRACE_OBJS)
ALLOBJS += $(TRAFCONFIG_OBJS)
-ALLOBJS += $(TRAFCONFIGLOG_OBJS)
-ALLOBJS += $(TRAFCONFIGTRACE_OBJS)
+ALLOBJS += $(TYPE2STR_OBJS)
SHAREDLIBS = $(LIBEXPDIR)/libtrafconfig.so
SHAREDLIBS += $(LIBEXPDIR)/libseabasesig.so
@@ -532,11 +549,19 @@ $(LIBEXPDIR)/libseabasesig.so: $(RTSIGBLOCK_OBJS)
@echo 'Finished building target: $@'
@echo ' '
-$(LIBEXPDIR)/libtrafconfig.so: $(TRAFCONFIG_OBJS) $(SQLITECONFIG_OBJS) $(TRACE_LOG_OBJS) $(TRAFCONFIGLOG_OBJS) $(TRAFCONFIGTRACE_OBJS)
+#$(LIBEXPDIR)/libtrafconfig.so: $(TRAFCONFIG_OBJS) $(TCDB_OBJS) $(TCDBSTORE_OBJS) $(TCDBSQLITE_OBJS) $(TCDBZSTORE_OBJS) $(TRACE_LOG_OBJS) $(TCLOG_OBJS) $(TCTRACE_OBJS) $(TYPE2STR_OBJS)
+# @echo 'Building target: $@'
+# @echo 'Invoking: Linker'
+# @echo $(CXX) $(LNK_FLGS) -shared -o $@ $(TRAFCONFIG_OBJS) $(TCDB_OBJS) $(TCDBSTORE_OBJS) $(TCDBSQLITE_OBJS) $(TCDBZSTORE_OBJS) $(TRACE_LOG_OBJS) $(TCLOG_OBJS) $(TCTRACE_OBJS) $(TYPE2STR_OBJS)
+# @$(CXX) $(LNK_FLGS) -shared -o $@ $(TRAFCONFIG_OBJS) $(TCDB_OBJS) $(TCDBSTORE_OBJS) $(TCDBSQLITE_OBJS) $(TCDBZSTORE_OBJS) $(TRACE_LOG_OBJS) $(TCLOG_OBJS) $(TCTRACE_OBJS) $(TYPE2STR_OBJS)
+# @echo 'Finished building target: $@'
+# @echo ' '
+
+$(LIBEXPDIR)/libtrafconfig.so: $(TRAFCONFIG_OBJS) $(TCDB_OBJS) $(TCDBSTORE_OBJS) $(TCDBSQLITE_OBJS) $(TRACE_LOG_OBJS) $(TCLOG_OBJS) $(TCTRACE_OBJS) $(TYPE2STR_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: Linker'
- @echo $(CXX) $(LNK_FLGS) -shared -o $@ $(TRAFCONFIG_OBJS) $(SQLITECONFIG_OBJS) $(TRACE_LOG_OBJS) $(TRAFCONFIGLOG_OBJS) $(TRAFCONFIGTRACE_OBJS)
- @$(CXX) $(LNK_FLGS) -shared -o $@ $(TRAFCONFIG_OBJS) $(SQLITECONFIG_OBJS) $(TRACE_LOG_OBJS) $(TRAFCONFIGLOG_OBJS) $(TRAFCONFIGTRACE_OBJS)
+ @echo $(CXX) $(LNK_FLGS) -shared -o $@ $(TRAFCONFIG_OBJS) $(TCDB_OBJS) $(TCDBSTORE_OBJS) $(TCDBSQLITE_OBJS) $(TRACE_LOG_OBJS) $(TCLOG_OBJS) $(TCTRACE_OBJS) $(TYPE2STR_OBJS)
+ @$(CXX) $(LNK_FLGS) -shared -o $@ $(TRAFCONFIG_OBJS) $(TCDB_OBJS) $(TCDBSTORE_OBJS) $(TCDBSQLITE_OBJS) $(TRACE_LOG_OBJS) $(TCLOG_OBJS) $(TCTRACE_OBJS) $(TYPE2STR_OBJS)
@echo 'Finished building target: $@'
@echo ' '
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/47d54af4/core/sqf/monitor/linux/montrace.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/montrace.cxx b/core/sqf/monitor/linux/montrace.cxx
index 9f2a391..a4ee502 100644
--- a/core/sqf/monitor/linux/montrace.cxx
+++ b/core/sqf/monitor/linux/montrace.cxx
@@ -37,11 +37,11 @@ using namespace std;
extern int MyPNID;
extern char Node_name[MPI_MAX_PROCESSOR_NAME];
-const char *CMonTrace::str_trace_enable = "MON_TRACE_ENABLE";
-const char *CMonTrace::str_trace_file = "MON_TRACE_FILE";
-const char *CMonTrace::str_trace_file_fb = "MON_TRACE_FILE_FB";
+const char *CMonTrace::traceEnableStr_ = "MON_TRACE_ENABLE";
+const char *CMonTrace::traceFileStr_ = "MON_TRACE_FILE";
+const char *CMonTrace::traceFileFbStr_ = "MON_TRACE_FILE_FB";
-const CMonTrace::traceArea CMonTrace::traceAreaList[] =
+const CMonTrace::TraceArea_t CMonTrace::traceAreaList_[] =
{ {"MON_TRACE_REQUEST", TRACE_REQUEST},
{"MON_TRACE_REQUEST_DETAIL", TRACE_REQUEST_DETAIL},
{"MON_TRACE_PROCESS", TRACE_PROCESS},
@@ -69,9 +69,15 @@ long trace_settings = 0;
CMonTrace *MonTrace = new CMonTrace ();
-CMonTrace::CMonTrace() : tracingEnabled(false), trace_settings_saved(0), trace_file_fb(0), trace_file_base(NULL)
+CMonTrace::CMonTrace()
+ : tracingEnabled_(false)
+ , numTraceAreas_(0)
+ , traceSettingsSaved_(0)
+ , traceFileFB_(0)
+ , traceFileBase_(NULL)
+ , traceFileName_("")
{
- numTraceAreas = sizeof(traceAreaList)/sizeof(traceArea);
+ numTraceAreas_ = sizeof(traceAreaList_)/sizeof(TraceArea_t);
}
const char *CMonTrace::getenv_str(const char *key)
@@ -120,15 +126,15 @@ void CMonTrace::mon_trace_init(const char * traceLevel, const char *pfname)
if (pfname == NULL)
{ // Caller did not specify a trace file name, get name from
// environment variable if specified.
- pfname = getenv_str(str_trace_file);
+ pfname = getenv_str(traceFileStr_);
}
if (pfname != NULL)
{ // User specified trace file name
// Save the base trace file name for possible use later
- trace_file_base = new char[strlen(pfname) + 1];
- strcpy(trace_file_base, pfname);
+ traceFileBase_ = new char[strlen(pfname) + 1];
+ strcpy(traceFileBase_, pfname);
if ((strcmp(pfname, "STDOUT") == 0)
|| strcmp(pfname, "STDERR") == 0)
@@ -142,24 +148,26 @@ void CMonTrace::mon_trace_init(const char * traceLevel, const char *pfname)
}
}
+ traceFileName_ = trace_file_name;
+
// Get any trace settings that were specified via environment variables
const char *value;
- for (int i=0; i<numTraceAreas; i++)
+ for (int i=0; i<numTraceAreas_; i++)
{
- value = getenv(traceAreaList[i].id);
+ value = getenv(traceAreaList_[i].id);
if (value != NULL)
{
if (atoi(value) != 0)
// set the enabled flag for this trace area
- trace_settings |= traceAreaList[i].bitFlag;
+ trace_settings |= traceAreaList_[i].bitFlag;
}
}
// Get environment variable specifying whether tracing is enabled
- tracingEnabled = getenv_bool(str_trace_enable);
+ tracingEnabled_ = getenv_bool(traceEnableStr_);
// Get environment variable value for trace buffer size if specified
- getenv_int (str_trace_file_fb, trace_file_fb);
+ getenv_int (traceFileFbStr_, traceFileFB_);
// Convert the user specified trace level string to a number. The
// number can be specified as a decimal, octal or hexadecimal
@@ -173,18 +181,18 @@ void CMonTrace::mon_trace_init(const char * traceLevel, const char *pfname)
}
// If any trace settings were specified initialize the trace file
- if (trace_settings != 0 || tracingEnabled)
+ if (trace_settings != 0 || tracingEnabled_)
{
- tracingEnabled = true;
- trace_settings_saved = trace_settings;
+ tracingEnabled_ = true;
+ traceSettingsSaved_ = trace_settings;
trace_init(trace_file_name,
false, // don't append pid to file name
Node_name, // prefix
false);
- if (trace_file_fb > 0)
+ if (traceFileFB_ > 0)
{
- trace_set_mem(trace_file_fb);
+ trace_set_mem(traceFileFB_);
}
}
}
@@ -214,68 +222,68 @@ const char *CMonTrace::mon_help_str(const char *key, const char *value,
void CMonTrace::mon_trace_change(const char *key, const char *value)
{
- bool trace_was_enabled = tracingEnabled;
+ bool trace_was_enabled = tracingEnabled_;
const char *pfname;
- int old_fb = trace_file_fb;
+ int old_fb = traceFileFB_;
if (key == NULL)
return;
// Restore saved trace settings in case trace flags get modified
- trace_settings = trace_settings_saved;
+ trace_settings = traceSettingsSaved_;
// Compare the key with each of the trace flag strings. When
// there is an equal compare, assign the value to the appropriate flag.
- for (int i=0; i<numTraceAreas; i++)
+ for (int i=0; i<numTraceAreas_; i++)
{
- if (strcasecmp(key, traceAreaList[i].id) == 0)
+ if (strcasecmp(key, traceAreaList_[i].id) == 0)
{
if (atoi(value) != 0)
{
// set the enabled flag for this trace area
- trace_settings |= traceAreaList[i].bitFlag;
+ trace_settings |= traceAreaList_[i].bitFlag;
}
else // clear the enabled flag for this trace area
{
- trace_settings &= ~traceAreaList[i].bitFlag;
+ trace_settings &= ~traceAreaList_[i].bitFlag;
}
break;
}
}
// Save current trace settings
- trace_settings_saved = trace_settings;
+ traceSettingsSaved_ = trace_settings;
// Check if tracing is being enabled/disabled
- mon_help_bool(key, value, str_trace_enable, tracingEnabled);
+ mon_help_bool(key, value, traceEnableStr_, tracingEnabled_);
// Check if trace file buffer size is being specified
- mon_help_int (key, value, str_trace_file_fb, trace_file_fb);
+ mon_help_int (key, value, traceFileFbStr_, traceFileFB_);
// Check if trace file base name is being specified
- pfname = mon_help_str(key, value, str_trace_file);
+ pfname = mon_help_str(key, value, traceFileStr_);
if (pfname != NULL)
{ // Save trace file base name
- delete [] trace_file_base;
- trace_file_base = new char[strlen(pfname) + 1];
- strcpy(trace_file_base, pfname);
+ delete [] traceFileBase_;
+ traceFileBase_ = new char[strlen(pfname) + 1];
+ strcpy(traceFileBase_, pfname);
}
- if (!trace_was_enabled && tracingEnabled)
+ if (!trace_was_enabled && tracingEnabled_)
{
char fname[MAX_PROCESS_PATH];
// Formulate trace file name
- if (trace_file_base != NULL)
+ if (traceFileBase_ != NULL)
{ // User specified trace file name
- if ((strcmp(trace_file_base, "STDOUT") == 0)
- || strcmp(trace_file_base, "STDERR") == 0)
+ if ((strcmp(traceFileBase_, "STDOUT") == 0)
+ || strcmp(traceFileBase_, "STDERR") == 0)
{
- strcpy(fname, trace_file_base);
+ strcpy(fname, traceFileBase_);
}
else
{ // Make user specified file name unique per node
sprintf(fname,"%s/%s.%d.%s",getenv("MPI_TMPDIR"),
- trace_file_base,MyPNID,Node_name);
+ traceFileBase_,MyPNID,Node_name);
}
}
else
@@ -298,7 +306,7 @@ void CMonTrace::mon_trace_change(const char *key, const char *value)
Node_name, // prefix
false);
}
- if (trace_was_enabled && !tracingEnabled)
+ if (trace_was_enabled && !tracingEnabled_)
{
// Tracing was enabled and now is disabled, flush trace. Save
// current trace settings.
@@ -308,6 +316,6 @@ void CMonTrace::mon_trace_change(const char *key, const char *value)
}
// If a new trace file buffer size was specified, set it
- if ((trace_file_fb > 0) && (old_fb != trace_file_fb))
- trace_set_mem(trace_file_fb);
+ if ((traceFileFB_ > 0) && (old_fb != traceFileFB_))
+ trace_set_mem(traceFileFB_);
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/47d54af4/core/sqf/monitor/linux/montrace.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/montrace.h b/core/sqf/monitor/linux/montrace.h
index dce911a..8a78359 100644
--- a/core/sqf/monitor/linux/montrace.h
+++ b/core/sqf/monitor/linux/montrace.h
@@ -26,6 +26,9 @@
#ifndef MONTRACE_H_
#define MONTRACE_H_
+using namespace std;
+
+#include <string>
#include "seabed/trace.h"
// Monitor request processing
@@ -82,6 +85,8 @@ public:
void mon_trace_change(const char *key, const char *value);
+ inline const char *getTraceFileName(void) { return( traceFileName_.c_str() ); };
+
private:
const char *getenv_str(const char *key);
@@ -97,29 +102,28 @@ private:
const char *mon_help_str(const char *key, const char *value,
const char *key_cmp);
- // The number of trace areas held in "traceAreaList"
- int numTraceAreas;
+ bool tracingEnabled_;
- bool tracingEnabled;
+ // The number of trace areas held in "traceAreaList"
+ int numTraceAreas_;
// Save area for retaining prior trace settings if tracing is
// disabled. These are used to restore the values when tracing
// is re-enabled.
- long trace_settings_saved;
-
- // Optional size of trace file buffer.
- int trace_file_fb;
+ long traceSettingsSaved_;
- char *trace_file_base;
+ int traceFileFB_; // Optional size of trace file buffer.
+ char *traceFileBase_;
+ string traceFileName_;
// Array of strings defining various trace areas and the
// trace bit flag associated with that area
- typedef struct {const char *id; long bitFlag;} traceArea;
- static const traceArea traceAreaList[];
+ typedef struct {const char *id; long bitFlag;} TraceArea_t;
+ static const TraceArea_t traceAreaList_[];
- static const char *str_trace_enable;
- static const char *str_trace_file;
- static const char *str_trace_file_fb;
+ static const char *traceEnableStr_;
+ static const char *traceFileStr_;
+ static const char *traceFileFbStr_;
};
#endif
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/47d54af4/core/sqf/monitor/linux/persistconfig.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/persistconfig.cxx b/core/sqf/monitor/linux/persistconfig.cxx
index c7572c3..b2e4526 100644
--- a/core/sqf/monitor/linux/persistconfig.cxx
+++ b/core/sqf/monitor/linux/persistconfig.cxx
@@ -198,6 +198,7 @@ CPersistConfig::CPersistConfig( persistConfigInfo_t &persistConfigInfo )
, stdoutPrefix_(persistConfigInfo.stdoutPrefix)
, stdoutFormat_(persistConfigInfo.stdoutFormat)
, programName_(persistConfigInfo.programName)
+ , programArgs_(persistConfigInfo.programArgs)
, zoneFormat_(persistConfigInfo.zoneFormat)
, processType_(persistConfigInfo.processType)
, processNameNidFormat_(Nid_Undefined)
@@ -206,6 +207,9 @@ CPersistConfig::CPersistConfig( persistConfigInfo_t &persistConfigInfo )
, requiresDTM_(persistConfigInfo.requiresDTM)
, persistRetries_(persistConfigInfo.persistRetries)
, persistWindow_(persistConfigInfo.persistWindow)
+ , programArgc_(0)
+ , programArgv_(NULL)
+ , programArgvLen_(0)
, next_(NULL)
, prev_(NULL)
{
@@ -246,6 +250,69 @@ CPersistConfig::CPersistConfig( persistConfigInfo_t &persistConfigInfo )
}
}
+ char *token, *programArgs = NULL;
+ static const char *delim = " ";
+ stringVector_t argvVector;
+
+ if (programArgs_.size())
+ {
+ programArgs = new char [programArgs_.size()+100];
+ memset(programArgs, 0, programArgs_.size()+100);
+ memcpy(programArgs, programArgs_.c_str(), programArgs_.size());
+
+ token = strtok( programArgs, delim );
+ while (token != NULL)
+ {
+ if ( trace_settings & TRACE_INIT )
+ {
+ trace_printf("%s@%d Setting argvVector=%s\n",
+ method_name, __LINE__, token);
+ }
+ argvVector.push_back( token );
+ token = strtok( NULL, delim );
+ }
+
+ programArgc_ = argvVector.size();
+
+ // Compute amount of space need to store argument strings
+ stringVector_t::iterator avit;
+ for (avit = argvVector.begin(); avit < argvVector.end(); avit++ )
+ {
+ programArgvLen_ += strlen(avit->c_str()) + 1;
+ }
+
+ if ( trace_settings & TRACE_INIT )
+ {
+ trace_printf( "%s@%d - Copying arguments "
+ "programArgc_=%d, programArgvLen_=%d\n"
+ , method_name, __LINE__
+ , programArgc_, programArgvLen_);
+ }
+
+ if (programArgvLen_ != 0)
+ {
+ programArgv_ = new char[programArgvLen_];
+ if (programArgv_)
+ {
+ memset(programArgv_, 0, programArgvLen_);
+ char *pProgramArgv = programArgv_;
+ for (avit = argvVector.begin(); avit < argvVector.end(); avit++ )
+ {
+ if ( trace_settings & TRACE_INIT )
+ {
+ trace_printf("%s@%d - prefix=%s, Copying argvVector='%s'\n"
+ , method_name, __LINE__
+ , persistPrefix_.c_str(), avit->c_str());
+ }
+ strcpy (pProgramArgv, avit->c_str());
+ pProgramArgv += strlen(avit->c_str()) + 1;
+ }
+ }
+ }
+ }
+
+ if (programArgs) delete [] programArgs;
+
TRACE_EXIT;
}
@@ -254,6 +321,8 @@ CPersistConfig::~CPersistConfig( void )
const char method_name[] = "CPersistConfig::~CPersistConfig";
TRACE_ENTRY;
+ if (programArgv_) delete [] programArgv_;
+
TRACE_EXIT;
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/47d54af4/core/sqf/monitor/linux/persistconfig.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/persistconfig.h b/core/sqf/monitor/linux/persistconfig.h
index 1a5ac43..12c3322 100644
--- a/core/sqf/monitor/linux/persistconfig.h
+++ b/core/sqf/monitor/linux/persistconfig.h
@@ -52,6 +52,7 @@ typedef enum
} FormatZid_t;
typedef vector<string> pkeysVector_t;
+typedef vector<string> stringVector_t;
typedef struct persistConfigInfo_s
{
@@ -61,6 +62,7 @@ typedef struct persistConfigInfo_s
char stdoutPrefix[TC_PERSIST_VALUE_MAX];
char stdoutFormat[TC_PERSIST_VALUE_MAX];
char programName[TC_PERSIST_VALUE_MAX];
+ char programArgs[TC_PERSIST_VALUE_MAX];
char zoneFormat[TC_PERSIST_VALUE_MAX];
PROCESSTYPE processType;
bool requiresDTM;
@@ -119,6 +121,10 @@ public:
inline const char *GetStdoutFormat( void ) { return( stdoutFormat_.c_str() ); }
inline FormatNid_t GetStdoutNidFormat( void ) { return( stdoutNidFormat_ ); }
inline const char *GetProgramName( void ) { return( programName_.c_str() ); }
+ inline const char *GetProgramArgs( void ) { return( programArgs_.c_str() ); }
+ inline int GetProgramArgc( void ) { return( programArgc_ ); }
+ inline const char *GetProgramArgv( void ) { return( programArgv_ ); }
+ inline int GetProgramArgvLen( void ) { return( programArgvLen_ ); }
inline const char *GetZoneFormat( void ) { return( zoneFormat_.c_str() ); }
inline FormatZid_t GetZoneZidFormat( void ) { return( zoneZidFormat_ ); }
inline PROCESSTYPE GetProcessType( void ) { return ( processType_ ); }
@@ -138,6 +144,7 @@ private:
string stdoutPrefix_;
string stdoutFormat_;
string programName_;
+ string programArgs_;
string zoneFormat_;
PROCESSTYPE processType_;
FormatNid_t processNameNidFormat_;
@@ -147,6 +154,10 @@ private:
int persistRetries_;
int persistWindow_;
+ int programArgc_;
+ char *programArgv_;
+ int programArgvLen_;
+
CPersistConfig *next_; // next PersistConfig in CPersistConfigContainer list
CPersistConfig *prev_; // previous PersistConfig in CPersistConfigContainer list
};
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/47d54af4/core/sqf/monitor/linux/pnode.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnode.cxx b/core/sqf/monitor/linux/pnode.cxx
index 4fc35e6..19d36f6 100644
--- a/core/sqf/monitor/linux/pnode.cxx
+++ b/core/sqf/monitor/linux/pnode.cxx
@@ -64,6 +64,7 @@ extern CNode *MyNode;
extern CMonStats *MonStats;
extern CRedirector Redirector;
extern CReplicate Replicator;
+extern CMonTrace *MonTrace;
extern bool IAmIntegrating;
@@ -1425,7 +1426,7 @@ CNodeContainer::CNodeContainer( void )
SyncBuffer = new struct sync_buffer_def;
- // Load cluster configuration from 'sqconfig.db'
+ // Load cluster configuration
LoadConfig();
// Allocate logical and physical node arrays
@@ -3142,7 +3143,7 @@ void CNodeContainer::LoadConfig( void )
}
if ( clusterConfig_ )
{
- if ( clusterConfig_->Initialize() )
+ if ( clusterConfig_->Initialize( MonTrace->getTraceFileName() ) )
{
if ( ! clusterConfig_->LoadConfig() )
{
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/47d54af4/core/sqf/monitor/linux/pnode.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnode.h b/core/sqf/monitor/linux/pnode.h
index d484b6a..97b02db 100644
--- a/core/sqf/monitor/linux/pnode.h
+++ b/core/sqf/monitor/linux/pnode.h
@@ -149,7 +149,7 @@ protected:
private:
int pnodeCount_; // # of physical node objects in array
int *indexToPnid_; // map of configuration entries to Node[pnid]
- CClusterConfig *clusterConfig_; // 'sqconfig.db' objects
+ CClusterConfig *clusterConfig_; // configuration objects
NodesList spareNodesList_; // current spare physical nodes list
NodesList spareNodesConfigList_; // configured spare physical nodes list
CNode *head_; // head of physical nodes linked list
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/47d54af4/core/sqf/monitor/linux/pstartd.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pstartd.cxx b/core/sqf/monitor/linux/pstartd.cxx
index f3388d8..f57b550 100644
--- a/core/sqf/monitor/linux/pstartd.cxx
+++ b/core/sqf/monitor/linux/pstartd.cxx
@@ -487,8 +487,8 @@ bool CMonUtil::requestNewProcess (int nid, PROCESSTYPE type,
const char *processName,
const char *progName, const char *inFile,
const char *outFile,
- int progArgC, const char *progArgs,
- int argBegin[], int argLen[],
+ int progArgc, const char *progArgs,
+// int argBegin[], int argLen[],
int& newNid, int& newPid,
char *newProcName)
{
@@ -533,11 +533,28 @@ bool CMonUtil::requestNewProcess (int nid, PROCESSTYPE type,
strcpy (msg->u.request.u.new_process.program, progName);
STRCPY (msg->u.request.u.new_process.infile, inFile);
STRCPY (msg->u.request.u.new_process.outfile, outFile);
- msg->u.request.u.new_process.argc = progArgC;
- for (int i=0; i<progArgC; i++)
+ msg->u.request.u.new_process.argc = progArgc;
+
+ char *token, *programArgs = NULL;
+ int argi = 0;
+ static const char *delim = " ";
+
+ programArgs = new char [MAX_ARG_SIZE*MAX_ARGS];
+ memset(programArgs, 0, MAX_ARG_SIZE*MAX_ARGS);
+ memcpy(programArgs, progArgs, strlen(progArgs)+1);
+ token = strtok( programArgs, delim );
+ while (token != NULL)
{
- strncpy (msg->u.request.u.new_process.argv[i], &progArgs[argBegin[i]],
- argLen[i]);
+ if ( trace_ )
+ {
+ trace_printf( "%s@%d Setting progArgc=%d, argv[%d]=%s\n"
+ , method_name, __LINE__, progArgc, argi, token);
+ }
+ strncpy( msg->u.request.u.new_process.argv[argi]
+ , token
+ , strlen(token));
+ argi++;
+ token = strtok( NULL, delim );
}
gp_local_mon_io->send_recv( msg );
@@ -910,7 +927,7 @@ void CPStartD::startProcess( CPersistConfig *persistConfig )
const char method_name[] = "CPStartD::startProcess";
PROCESSTYPE procType = ProcessType_Undefined;
- int progArgC = 0;
+ int progArgc = 0;
string procName;
string progArgs;
string progStdout;
@@ -919,13 +936,15 @@ void CPStartD::startProcess( CPersistConfig *persistConfig )
bool result;
int newNid;
int newPid;
- int argBegin[MAX_ARGS];
- int argLen[MAX_ARGS];
+// int argBegin[MAX_ARGS];
+// int argLen[MAX_ARGS];
procName = persistConfig->GetProcessName( MyNid );
procType = persistConfig->GetProcessType();
progStdout = persistConfig->GetStdoutFile( MyNid );
progProgram = persistConfig->GetProgramName();
+ progArgs = persistConfig->GetProgramArgs();
+ progArgc = persistConfig->GetProgramArgc();
if ( tracing )
{
@@ -934,7 +953,7 @@ void CPStartD::startProcess( CPersistConfig *persistConfig )
, method_name, __LINE__, MyNid
, ProcessTypeString(procType), procName.c_str()
, progProgram.c_str(), progStdout.c_str()
- , progArgC, progArgs.c_str());
+ , progArgc, progArgs.c_str());
}
char buf[MON_STRING_BUF_SIZE];
@@ -950,10 +969,10 @@ void CPStartD::startProcess( CPersistConfig *persistConfig )
, progProgram.c_str()
, ""
, progStdout.c_str()
- , progArgC
+ , progArgc
, progArgs.c_str()
- , argBegin
- , argLen
+ // , argBegin
+ // , argLen
, newNid
, newPid
, newProcName);
@@ -996,6 +1015,8 @@ void CPStartD::startProcs ( bool requiresDTM )
"\t\tPersist Retries = %d\n"
"\t\tPersist Window = %d\n"
"\t\tPersist Zones = %s\n"
+ "\t\tProgram Args = %s\n"
+ "\t\tProgram Argc = %d\n"
, method_name, __LINE__
, persistConfig->GetPersistPrefix()
, persistConfig->GetProcessName( MyNid )
@@ -1005,7 +1026,9 @@ void CPStartD::startProcs ( bool requiresDTM )
, persistConfig->GetRequiresDTM() ? "Y" : "N"
, persistConfig->GetPersistRetries()
, persistConfig->GetPersistWindow()
- , persistConfig->GetZoneFormat() );
+ , persistConfig->GetZoneFormat()
+ , persistConfig->GetProgramArgs()
+ , persistConfig->GetProgramArgc() );
}
switch (persistConfig->GetProcessType())
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/47d54af4/core/sqf/monitor/linux/pstartd.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pstartd.h b/core/sqf/monitor/linux/pstartd.h
index e697638..9c2f0e2 100644
--- a/core/sqf/monitor/linux/pstartd.h
+++ b/core/sqf/monitor/linux/pstartd.h
@@ -69,7 +69,7 @@ class CMonUtil
const char *progName, const char *inFile,
const char *outFile,
int progArgC, const char *progArgV,
- int argBegin[], int argEnd[],
+// int argBegin[], int argEnd[],
int& newNid, int& newPid,
char *newProcName);
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/47d54af4/core/sqf/monitor/linux/reqqueue.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqqueue.cxx b/core/sqf/monitor/linux/reqqueue.cxx
index 19b8313..f095345 100644
--- a/core/sqf/monitor/linux/reqqueue.cxx
+++ b/core/sqf/monitor/linux/reqqueue.cxx
@@ -2340,7 +2340,6 @@ void CIntReviveReq::performRequest()
mem_log_write(MON_REQQUEUE_REVIVE_4);
- // the creator monitor copied sqconfig.db before the above handshake.
Config->Init();
if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
@@ -2464,20 +2463,6 @@ void CIntSnapshotReq::performRequest()
abort();
}
-#if 0
- // copy sqconfig.db
- char cmd[256];
- sprintf(cmd, "pdcp -p -w %s %s/sql/scripts/sqconfig.db %s/sql/scripts/.", Monitor->GetIntegratingNode()->GetName(),
- getenv("TRAF_HOME"), getenv("TRAF_HOME") );
-
- error = system(cmd);
-
- if (trace_settings & TRACE_REQUEST)
- trace_printf("%s@%d - Copied config.db (%s) Error = %d\n", method_name, __LINE__, cmd, error);
-
- mem_log_write(MON_REQQUEUE_SNAPSHOT_3, error);
-#endif
-
// estimate size of snapshot buffer
// about 100 bytes per process, 1.5 times total
int procSize = Nodes->ProcessCount() * 1.75 * 100;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/47d54af4/core/sqf/monitor/linux/shell.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/shell.cxx b/core/sqf/monitor/linux/shell.cxx
index 4705c9e..b80d2a1 100644
--- a/core/sqf/monitor/linux/shell.cxx
+++ b/core/sqf/monitor/linux/shell.cxx
@@ -108,7 +108,7 @@ char nodePendingName[MPI_MAX_PROCESSOR_NAME];
int nodePendingPnid;
CLock nodePendingLock;
-CClusterConfig ClusterConfig; // 'sqconfig.db' objects
+CClusterConfig ClusterConfig; // Configuration objects
char PNode[MAX_NODES][MPI_MAX_PROCESSOR_NAME];
char Node[MAX_NODES][MPI_MAX_PROCESSOR_NAME];
@@ -616,7 +616,7 @@ void TraceOpen ( void )
// Initialize tracing
trace_init(traceFileName,
false, // don't append pid to file name
- "shell", // prefix
+ (char *)"shell", // prefix
false);
if (traceFileFb > 0)
{
@@ -1824,9 +1824,12 @@ void get_persist_process_attributes( CPersistConfig *persistConfig
, int nid
, PROCESSTYPE &processType
, char *processName
+ , int &programArgc
+ , char *programArgs
, char *outfile
, char *persistRetries
- , char *persistZones )
+ , char *persistZones
+ )
{
const char method_name[] = "get_persist_process_attributes";
char zoneStr[MAX_PERSIST_VALUE_STR];
@@ -1875,6 +1878,14 @@ void get_persist_process_attributes( CPersistConfig *persistConfig
, persistConfig->GetStdoutPrefix()
, nid );
}
+
+ programArgc = persistConfig->GetProgramArgc();
+ if (programArgc)
+ {
+ sprintf( programArgs, "%s"
+ , persistConfig->GetProgramArgs() );
+ }
+
sprintf( persistRetries, "%d,%d"
, persistConfig->GetPersistRetries()
, persistConfig->GetPersistWindow() );
@@ -2981,7 +2992,7 @@ bool load_configuration( void )
// It was previously loaded, remove the current configuration
ClusterConfig.Clear();
}
- if ( ClusterConfig.Initialize() )
+ if ( ClusterConfig.Initialize( traceFileName ) )
{
if ( ! ClusterConfig.LoadConfig() )
{
@@ -3043,7 +3054,7 @@ bool load_configuration( void )
}
else
{
- printf( "[%s] Warning: No sqconfig.db found\n",MyName);
+ printf( "[%s] Error: Could not initialize Trafodion Configuration database\n",MyName);
return false;
}
@@ -3916,14 +3927,15 @@ int node_up( int nid, char *node_name, bool nowait )
void persist_config( char *prefix )
{
bool foundConfig = false;
- char persist_config_buf[MAX_VALUE_SIZE_INT];
- char process_name_str[MAX_TOKEN];
- char process_type_str[MAX_TOKEN];
- char program_name_str[MAX_TOKEN];
- char requires_dtm_str[MAX_TOKEN];
- char stdout_str[MAX_TOKEN];
- char persist_retries_str[MAX_TOKEN];
- char persist_zones_str[MAX_TOKEN];
+ char persist_config_buf[TC_PERSIST_VALUE_MAX*2];
+ char process_name_str[TC_PERSIST_VALUE_MAX];
+ char process_type_str[TC_PERSIST_VALUE_MAX];
+ char program_name_str[TC_PERSIST_VALUE_MAX];
+ char program_args_str[TC_PERSIST_VALUE_MAX];
+ char requires_dtm_str[TC_PERSIST_VALUE_MAX];
+ char stdout_str[TC_PERSIST_VALUE_MAX];
+ char persist_retries_str[TC_PERSIST_VALUE_MAX];
+ char persist_zones_str[TC_PERSIST_VALUE_MAX];
CPersistConfig *persistConfig;
persistConfig = ClusterConfig.GetFirstPersistConfig();
@@ -3936,55 +3948,62 @@ void persist_config( char *prefix )
{
foundConfig = true;
snprintf( process_name_str, sizeof(process_name_str)
- , "%s_%s=%s%s"
+ , "%s_%s = %s%s"
, persistConfig->GetPersistPrefix()
, PERSIST_PROCESS_NAME_KEY
, persistConfig->GetProcessNamePrefix()
, persistConfig->GetProcessNameFormat()
);
snprintf( process_type_str, sizeof(process_type_str)
- , "%s_%s=%s"
+ , "%s_%s = %s"
, persistConfig->GetPersistPrefix()
, PERSIST_PROCESS_TYPE_KEY
, PersistProcessTypeString(persistConfig->GetProcessType())
);
snprintf( program_name_str, sizeof(program_name_str)
- , "%s_%s=%s"
+ , "%s_%s = %s"
, persistConfig->GetPersistPrefix()
, PERSIST_PROGRAM_NAME_KEY
, persistConfig->GetProgramName()
);
+ snprintf( program_args_str, sizeof(program_args_str)
+ , "%s_%s = %s"
+ , persistConfig->GetPersistPrefix()
+ , PERSIST_PROGRAM_ARGS_KEY
+ , persistConfig->GetProgramArgs()
+ );
snprintf( requires_dtm_str, sizeof(requires_dtm_str)
- , "%s_%s=%s"
+ , "%s_%s = %s"
, persistConfig->GetPersistPrefix()
, PERSIST_REQUIRES_DTM
, persistConfig->GetRequiresDTM()?"Y":"N"
);
snprintf( stdout_str, sizeof(stdout_str)
- , "%s_%s=%s%s"
+ , "%s_%s = %s%s"
, persistConfig->GetPersistPrefix()
, PERSIST_STDOUT_KEY
, persistConfig->GetStdoutPrefix()
, persistConfig->GetStdoutFormat()
);
snprintf( persist_retries_str, sizeof(persist_retries_str)
- , "%s_%s=%d,%d"
+ , "%s_%s = %d,%d"
, persistConfig->GetPersistPrefix()
, PERSIST_RETRIES_KEY
, persistConfig->GetPersistRetries()
, persistConfig->GetPersistWindow()
);
snprintf( persist_zones_str, sizeof(persist_zones_str)
- , "%s_%s=%s"
+ , "%s_%s = %s"
, persistConfig->GetPersistPrefix()
, PERSIST_ZONES_KEY
, persistConfig->GetZoneFormat()
);
snprintf( persist_config_buf, sizeof(persist_config_buf)
- , "%s\n%s\n%s\n%s\n%s\n%s\n%s\n"
+ , "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n"
, process_name_str
, process_type_str
, program_name_str
+ , program_args_str
, requires_dtm_str
, stdout_str
, persist_retries_str
@@ -4101,6 +4120,8 @@ bool persist_process_kill( CPersistConfig *persistConfig )
char outfile[MAX_PROCESS_PATH];
char persistRetries[MAX_PERSIST_VALUE_STR];
char persistZones[MAX_VALUE_SIZE_INT];
+ char programArgs[MAX_VALUE_SIZE_INT];
+ int programArgc = 0;
int nid;
int pnid;
int lnodesCount = 0;
@@ -4133,6 +4154,8 @@ bool persist_process_kill( CPersistConfig *persistConfig )
, i
, process_type
, processName
+ , programArgc
+ , programArgs
, outfile
, persistRetries
, persistZones );
@@ -4152,6 +4175,8 @@ bool persist_process_kill( CPersistConfig *persistConfig )
, nid
, process_type
, processName
+ , programArgc
+ , programArgs
, outfile
, persistRetries
, persistZones );
@@ -4168,6 +4193,8 @@ bool persist_process_kill( CPersistConfig *persistConfig )
, -1
, process_type
, processName
+ , programArgc
+ , programArgs
, outfile
, persistRetries
, persistZones );
@@ -4192,6 +4219,8 @@ bool persist_process_start( CPersistConfig *persistConfig )
bool debug = false;
bool nowait = false;
char processName[MAX_PROCESS_NAME];
+ char programArgs[MAX_VALUE_SIZE_INT];
+ char programNameAndArgs[MAX_PROCESS_PATH+MAX_VALUE_SIZE_INT];
char infile[MAX_PROCESS_PATH];
char outfile[MAX_PROCESS_PATH];
char persistRetries[MAX_PERSIST_VALUE_STR];
@@ -4199,6 +4228,7 @@ bool persist_process_start( CPersistConfig *persistConfig )
int nid;
int pid;
int pnid;
+ int programArgc = 0;
int lnodesCount = 0;
PROCESSTYPE process_type;
int priority;
@@ -4207,6 +4237,7 @@ bool persist_process_start( CPersistConfig *persistConfig )
nid = -1;
priority = 0;
processName[0] = '\0'; // The monitor will assign name if null
+ programArgs[0] = '\0';
infile[0] = '\0'; // The monitor's default infile is used
outfile[0] = '\0'; // The monitor's default outfile is used
process_type = ProcessType_Undefined;
@@ -4233,6 +4264,8 @@ bool persist_process_start( CPersistConfig *persistConfig )
, i
, process_type
, processName
+ , programArgc
+ , programArgs
, outfile
, persistRetries
, persistZones );
@@ -4241,6 +4274,17 @@ bool persist_process_start( CPersistConfig *persistConfig )
printf( "Persistent process %s already exists\n", processName);
continue;
}
+ if (programArgc)
+ {
+ sprintf( programNameAndArgs, "%s %s"
+ , persistConfig->GetProgramName()
+ , programArgs );
+ }
+ else
+ {
+ sprintf( programNameAndArgs, "%s"
+ , persistConfig->GetProgramName() );
+ }
pid = start_process( &i
, process_type
, processName
@@ -4249,7 +4293,8 @@ bool persist_process_start( CPersistConfig *persistConfig )
, nowait
, infile
, outfile
- , (char *)persistConfig->GetProgramName() );
+ , programNameAndArgs );
+ //, (char *)persistConfig->GetProgramName() );
if (pid > 0)
{
printf( "Persistent process %s created\n", processName);
@@ -4273,6 +4318,8 @@ bool persist_process_start( CPersistConfig *persistConfig )
, nid
, process_type
, processName
+ , programArgc
+ , programArgs
, outfile
, persistRetries
, persistZones );
@@ -4281,6 +4328,17 @@ bool persist_process_start( CPersistConfig *persistConfig )
printf( "Persistent process %s already exists\n", processName);
break;
}
+ if (programArgc)
+ {
+ sprintf( programNameAndArgs, "%s %s"
+ , persistConfig->GetProgramName()
+ , programArgs );
+ }
+ else
+ {
+ sprintf( programNameAndArgs, "%s"
+ , persistConfig->GetProgramName() );
+ }
pid = start_process( &nid
, process_type
, processName
@@ -4289,7 +4347,7 @@ bool persist_process_start( CPersistConfig *persistConfig )
, nowait
, infile
, outfile
- , (char *)persistConfig->GetProgramName() );
+ , programNameAndArgs );
if (pid > 0)
{
printf( "Persistent process %s created\n", processName);
@@ -4311,6 +4369,8 @@ bool persist_process_start( CPersistConfig *persistConfig )
, -1
, process_type
, processName
+ , programArgc
+ , programArgs
, outfile
, persistRetries
, persistZones );
@@ -4319,6 +4379,17 @@ bool persist_process_start( CPersistConfig *persistConfig )
printf( "Persistent process %s already exists\n", processName);
break;
}
+ if (programArgc)
+ {
+ sprintf( programNameAndArgs, "%s %s"
+ , persistConfig->GetProgramName()
+ , programArgs );
+ }
+ else
+ {
+ sprintf( programNameAndArgs, "%s"
+ , persistConfig->GetProgramName() );
+ }
pid = start_process( &nid
, process_type
, processName
@@ -4327,7 +4398,7 @@ bool persist_process_start( CPersistConfig *persistConfig )
, nowait
, infile
, outfile
- , (char *)persistConfig->GetProgramName() );
+ , programNameAndArgs );
if (pid > 0)
{
printf( "Persistent process %s created\n", processName);
@@ -6930,9 +7001,12 @@ void node_up_cmd( char *cmd, char delimiter )
{
if ( get_node_name( cmd_tail ) == 0 )
{
- if ( copy_config_db( cmd_tail ) == 0 )
+ if ( ClusterConfig.GetStorageType() == TCDBSQLITE)
{
- node_up( -1, cmd_tail, nowait );
+ if ( copy_config_db( cmd_tail ) == 0 )
+ {
+ node_up( -1, cmd_tail, nowait );
+ }
}
}
else