From beb126d8bfedb3cdf7c3963bb6914ef6b66f0001 Mon Sep 17 00:00:00 2001 From: david hill Date: Tue, 12 Sep 2017 15:28:20 -0500 Subject: [PATCH] nonglobaled procmgr dbstorage and fix package install, missing bracket --- oam/install_scripts/package_installer.sh | 1 + procmgr/main.cpp | 12 ++++++++++-- procmgr/processmanager.cpp | 22 ++++++++++++++++++---- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/oam/install_scripts/package_installer.sh b/oam/install_scripts/package_installer.sh index 498df9a4b..9080d2095 100644 --- a/oam/install_scripts/package_installer.sh +++ b/oam/install_scripts/package_installer.sh @@ -340,6 +340,7 @@ set timeout 60 expect { "No such file" { send_user "ERROR: $INSTALLDIR/bin/columnstore Not Found\n" ; exit 1 } "Exit status 0" { send_user "DONE" } +} send_user "\n" diff --git a/procmgr/main.cpp b/procmgr/main.cpp index 9c8e6a69d..e489eefa8 100644 --- a/procmgr/main.cpp +++ b/procmgr/main.cpp @@ -58,7 +58,6 @@ bool HDFS = false; string localHostName; string PMwithUM = "n"; string MySQLRep = "n"; -string DBRootStorageType = "internal"; // pushing the ACTIVE_ALARMS_FILE to all nodes every 10 seconds. const int ACTIVE_ALARMS_PUSHING_INTERVAL = 10; @@ -170,7 +169,7 @@ int main(int argc, char **argv) if ( DBRootStorageType == "hdfs" ) HDFS = true; - log.writeLog(__LINE__, "DBRootStorageType = " + DBRootStorageType, LOG_TYPE_DEBUG); + log.writeLog(__LINE__, "Main: DBRootStorageType = " + DBRootStorageType, LOG_TYPE_DEBUG); //PMwithUM config try { @@ -1016,6 +1015,15 @@ void pingDeviceThread() extDeviceInfoList.insert(extDeviceList::value_type(name, 0)); } + //storage config + string DBRootStorageType; + try { + oam.getSystemConfig( "DBRootStorageType", DBRootStorageType); + } + catch(...) {} + + log.writeLog(__LINE__, "pingDeviceThread: DBRootStorageType = " + DBRootStorageType, LOG_TYPE_DEBUG); + int rtnCode = 0; Configuration configData; SystemStatus systemstatus; diff --git a/procmgr/processmanager.cpp b/procmgr/processmanager.cpp index 4c721f2b8..a487fc93f 100644 --- a/procmgr/processmanager.cpp +++ b/procmgr/processmanager.cpp @@ -72,7 +72,6 @@ bool startsystemthreadRunning = false; string gdownActiveOAMModule; vector downModuleList; bool startFailOver = false; -extern string DBRootStorageType; string masterLogFile = oam::UnassignedName; string masterLogPos = oam::UnassignedName; @@ -8625,6 +8624,15 @@ int ProcessManager::switchParentOAMModule(std::string newActiveModuleName) log.writeLog(__LINE__, "switchParentOAMModule Function Started", LOG_TYPE_DEBUG); + //storage config + string DBRootStorageType; + try { + oam.getSystemConfig( "DBRootStorageType", DBRootStorageType); + } + catch(...) {} + + log.writeLog(__LINE__, "switchParentOAMModule: DBRootStorageType = " + DBRootStorageType, LOG_TYPE_DEBUG); + if ( DBRootStorageType == "internal" && DataRedundancyConfig == "n") { log.writeLog(__LINE__, "ERROR: DBRootStorageType = internal", LOG_TYPE_ERROR); pthread_mutex_unlock(&THREAD_LOCK); @@ -9224,6 +9232,15 @@ int ProcessManager::OAMParentModuleChange() } + //storage config + string DBRootStorageType; + try { + oam.getSystemConfig( "DBRootStorageType", DBRootStorageType); + } + catch(...) {} + + log.writeLog(__LINE__, "OAMParentModuleChange: DBRootStorageType = " + DBRootStorageType, LOG_TYPE_DEBUG); + if ( DBRootStorageType == "internal" && failover && DataRedundancyConfig == "n") { log.writeLog(__LINE__, "DBRoot Storage configured for internal, don't do standby-active failover", LOG_TYPE_DEBUG); @@ -9240,9 +9257,6 @@ int ProcessManager::OAMParentModuleChange() //run save.brm script processManager.saveBRM(true, false); - //set query system state not ready - processManager.setQuerySystemState(false); - gdownActiveOAMModule = downOAMParentName; // update Columnstore.xml entries