From cc7191f75fd6c96a678f810e45fda50fbde28936 Mon Sep 17 00:00:00 2001 From: benthompson15 Date: Fri, 3 Apr 2020 12:07:23 -0500 Subject: [PATCH] MCOL-3842: logging cleanup --- oam/oamcpp/liboamcpp.cpp | 14 ++++++------- procmgr/processmanager.cpp | 42 ++++---------------------------------- procmon/processmonitor.cpp | 20 ------------------ 3 files changed, 11 insertions(+), 65 deletions(-) diff --git a/oam/oamcpp/liboamcpp.cpp b/oam/oamcpp/liboamcpp.cpp index a23039f61..8b3454f33 100644 --- a/oam/oamcpp/liboamcpp.cpp +++ b/oam/oamcpp/liboamcpp.cpp @@ -5996,12 +5996,12 @@ bool Oam::autoMovePmDbroot(std::string residePM) if ( ret != 0 ) { - writeLog("FAILURE: Error assigning gluster dbroot# " + itoa(dbrootID), LOG_TYPE_ERROR ); + writeLog("FAILURE: Error assigning gluster dbroot# " + itoa(dbrootID) +" ret: " + itoa(ret), LOG_TYPE_ERROR ); } } catch (...) { - writeLog("FAILURE: Error assigning gluster dbroot# " + itoa(dbrootID), LOG_TYPE_ERROR ); + writeLog("EXCEPTION FAILURE: Error assigning gluster dbroot# " + itoa(dbrootID), LOG_TYPE_ERROR ); } // check if a copy is available when residePM returns @@ -7448,15 +7448,15 @@ void Oam::removeDbroot(DBRootConfigList& dbrootlist) catch (exception& e) { cout << endl << "**** glusterctl API exception: " << e.what() << endl; - cerr << "FAILURE: Error assigning gluster dbroot# " + itoa(dbrootID) << endl; - writeLog("FAILURE: Error assigning gluster dbroot# " + itoa(dbrootID), LOG_TYPE_ERROR ); + cerr << "FAILURE: Error deleting gluster dbroot# " + itoa(dbrootID) << endl; + writeLog("FAILURE: Error deleting gluster dbroot# " + itoa(dbrootID), LOG_TYPE_ERROR ); exceptionControl("removeDbroot", API_FAILURE); } catch (...) { cout << endl << "**** glusterctl API exception: UNKNOWN" << endl; - cerr << "FAILURE: Error assigning gluster dbroot# " + itoa(dbrootID) << endl; - writeLog("FAILURE: Error assigning gluster dbroot# " + itoa(dbrootID), LOG_TYPE_ERROR ); + cerr << "FAILURE: Error deleting gluster dbroot# " + itoa(dbrootID) << endl; + writeLog("FAILURE: Error deleting gluster dbroot# " + itoa(dbrootID), LOG_TYPE_ERROR ); exceptionControl("removeDbroot", API_FAILURE); } } @@ -9151,7 +9151,7 @@ int Oam::glusterctl(GLUSTER_COMMANDS command, std::string argument1, std::string string dbr = sysConfig->getConfig("SystemModuleConfig", ModuleDBRootID); string command = "" + DataRedundancyConfigs[pm].pmIpAddr + ":/dbroot" + dbr + " /var/lib/columnstore/data" + dbr + - " glusterfs defaults,direct-io-mode=enable 00"; + " glusterfs defaults,direct-io-mode=enable 0 0"; string toPM = "pm" + itoa(pm + 1); distributeFstabUpdates(command, toPM); } diff --git a/procmgr/processmanager.cpp b/procmgr/processmanager.cpp index faffb62fd..73bdd8d66 100644 --- a/procmgr/processmanager.cpp +++ b/procmgr/processmanager.cpp @@ -3806,8 +3806,6 @@ int ProcessManager::disableModule(string target, bool manualFlag) //set Columnstore.xml enable state setEnableState( target, SnewState); - log.writeLog(__LINE__, "disableModule - setEnableState", LOG_TYPE_DEBUG); - //sleep a bit to give time for the state change to apply sleep(1); @@ -3816,8 +3814,6 @@ int ProcessManager::disableModule(string target, bool manualFlag) { if ( updatePMSconfig() != API_SUCCESS ) return API_FAILURE; - - log.writeLog(__LINE__, "disableModule - Updated PM server Count", LOG_TYPE_DEBUG); } //Update DBRM section of Columnstore.xml @@ -6514,12 +6510,12 @@ int ProcessManager::sendMsgProcMon( std::string module, ByteStream msg, int requ catch (SocketClosed& ex) { string error = ex.what(); -// log.writeLog(__LINE__, "EXCEPTION ERROR on mqRequest.read, module " + module + " : " + error, LOG_TYPE_ERROR); + log.writeLog(__LINE__, "EXCEPTION ERROR on mqRequest.read, module " + module + " : " + error, LOG_TYPE_ERROR); return returnStatus; } catch (...) { -// log.writeLog(__LINE__, "EXCEPTION ERROR on mqRequest.read: Caught unknown exception! module " + module, LOG_TYPE_ERROR); + log.writeLog(__LINE__, "EXCEPTION ERROR on mqRequest.read: Caught unknown exception! module " + module, LOG_TYPE_ERROR); return returnStatus; } @@ -6567,11 +6563,11 @@ int ProcessManager::sendMsgProcMon( std::string module, ByteStream msg, int requ catch (exception& ex) { string error = ex.what(); -// log.writeLog(__LINE__, "EXCEPTION ERROR on MessageQueueClient: " + error, LOG_TYPE_ERROR); + log.writeLog(__LINE__, "EXCEPTION ERROR on MessageQueueClient: " + error, LOG_TYPE_ERROR); } catch (...) { -// log.writeLog(__LINE__, "EXCEPTION ERROR on MessageQueueClient: Caught unknown exception!", LOG_TYPE_ERROR); + log.writeLog(__LINE__, "EXCEPTION ERROR on MessageQueueClient: Caught unknown exception!", LOG_TYPE_ERROR); } return returnStatus; @@ -8005,8 +8001,6 @@ int ProcessManager::updatePMSconfig( bool check ) vector IpAddrs; vector nicIDs; - log.writeLog(__LINE__, "updatePMSconfig Started", LOG_TYPE_DEBUG); - pthread_mutex_lock(&THREAD_LOCK); ModuleTypeConfig moduletypeconfig; @@ -8195,8 +8189,6 @@ int ProcessManager::updateWorkerNodeconfig() vector module; vector ipadr; - log.writeLog(__LINE__, "updateWorkerNodeconfig Started", LOG_TYPE_DEBUG); - pthread_mutex_lock(&THREAD_LOCK); //setup current module as work-node #1 by entering it in first @@ -8309,8 +8301,6 @@ int ProcessManager::updateWorkerNodeconfig() sysConfig3->write(); pthread_mutex_unlock(&THREAD_LOCK); - log.writeLog(__LINE__, "updateWorkerNodeconfig completed", LOG_TYPE_DEBUG); - return API_SUCCESS; } @@ -8817,7 +8807,6 @@ int ProcessManager::getDBRMData(messageqcpp::IOSocket fIos, std::string moduleNa // StorageManager: Need to make these existence checks use an idbfilesystem op if we // decide to put the BRM-managed files in cloud storage string currentDbrmFile; - log.writeLog(__LINE__, "I declare that I am ProcMgr, and I am running getDBRMData!", LOG_TYPE_DEBUG); IDBFileSystem &fs = IDBPolicy::getFs(currentFileName.c_str()); boost::scoped_ptr oldFile(IDBDataFile::open(IDBPolicy::getType(currentFileName.c_str(), IDBPolicy::WRITEENG), @@ -10098,12 +10087,6 @@ int ProcessManager::OAMParentModuleChange() } else { -// processManager.restartProcessType("mysql", localModule); -// processManager.restartProcessType("ExeMgr", localModule); -// processManager.restartProcessType("WriteEngineServer", localModule); - -// processManager.reinitProcessType("DBRMWorkerNode"); - //send message to start new Standby Process-Manager, if needed newStandbyModule = getStandbyModule(); @@ -10184,15 +10167,6 @@ int ProcessManager::OAMParentModuleChange() } } - //restart DDLProc/DMLProc to perform any rollbacks, if needed - //dont rollback in amazon, wait until down pm recovers -// if ( ( config.ServerInstallType() != oam::INSTALL_COMBINE_DM_UM_PM ) -// && !amazon ) { -// processManager.restartProcessType("DDLProc", config.moduleName()); -// sleep(1); -// processManager.restartProcessType("DMLProc", config.moduleName()); -// } - if ( config.ServerInstallType() == oam::INSTALL_COMBINE_DM_UM_PM ) { //change master MySQL Replication setup @@ -10301,8 +10275,6 @@ std::string ProcessManager::getStandbyModule() string backupStandbyModule = "NONE"; string newStandbyModule = "NONE"; - log.writeLog(__LINE__, "getStandbyModule called", LOG_TYPE_DEBUG); - //check if gluster, if so then find PMs that have copies of DBROOT #1 string pmList = ""; @@ -10431,8 +10403,6 @@ bool ProcessManager::setStandbyModule(std::string newStandbyModule, bool send) { Oam oam; - log.writeLog(__LINE__, "setStandbyModule called", LOG_TYPE_DEBUG); - if ( newStandbyModule.empty() ) return true; @@ -10502,8 +10472,6 @@ bool ProcessManager::clearStandbyModule() { Oam oam; - log.writeLog(__LINE__, "clearStandbyModule called", LOG_TYPE_DEBUG); - pthread_mutex_lock(&THREAD_LOCK); Configuration config; @@ -10793,8 +10761,6 @@ int ProcessManager::setMySQLReplication(oam::DeviceNetworkList devicenetworklist { Oam oam; - log.writeLog(__LINE__, "setMySQLReplication called", LOG_TYPE_DEBUG); - string MySQLRep; try diff --git a/procmon/processmonitor.cpp b/procmon/processmonitor.cpp index e2da321ee..b07ab1c27 100644 --- a/procmon/processmonitor.cpp +++ b/procmon/processmonitor.cpp @@ -4117,8 +4117,6 @@ int ProcessMonitor::createDataDirs(std::string cloud) MonitorLog log; Oam oam; - log.writeLog(__LINE__, "createDataDirs called", LOG_TYPE_DEBUG); - if ( config.moduleType() == "um" && ( cloud == "amazon-ec2" || cloud == "amazon-vpc") ) { @@ -4278,8 +4276,6 @@ int ProcessMonitor::getDBRMdata(string *path) Oam oam; ByteStream msg; - log.writeLog(__LINE__, "getDBRMdata called", LOG_TYPE_DEBUG); - int returnStatus = API_FAILURE; msg << (ByteStream::byte) GETDBRMDATA; @@ -4964,8 +4960,6 @@ int ProcessMonitor::runMasterRep(std::string& masterLogFile, std::string& master { Oam oam; - log.writeLog(__LINE__, "runMasterRep function called", LOG_TYPE_DEBUG); - SystemModuleTypeConfig systemModuleTypeConfig; try @@ -5140,8 +5134,6 @@ int ProcessMonitor::runSlaveRep(std::string& masterLogFile, std::string& masterL { Oam oam; - log.writeLog(__LINE__, "runSlaveRep function called", LOG_TYPE_DEBUG); - // get master replicaion module IP Address string PrimaryUMModuleName; oam.getSystemConfig("PrimaryUMModuleName", PrimaryUMModuleName); @@ -5224,8 +5216,6 @@ int ProcessMonitor::runDisableRep() { Oam oam; - log.writeLog(__LINE__, "runDisableRep function called", LOG_TYPE_DEBUG); - // mysql port number string MySQLPort; @@ -5279,8 +5269,6 @@ int ProcessMonitor::runMasterDist(std::string& password, std::string& slaveModul { Oam oam; - log.writeLog(__LINE__, "runMasterDist function called", LOG_TYPE_DEBUG); - SystemModuleTypeConfig systemModuleTypeConfig; try @@ -5405,8 +5393,6 @@ bool ProcessMonitor::amazonIPCheck() MonitorLog log; Oam oam; - log.writeLog(__LINE__, "amazonIPCheck function called", LOG_TYPE_DEBUG); - // delete description file so it will create a new one string tmpLog = tmpLogDir + "/describeInstance.log"; unlink(tmpLog.c_str()); @@ -5700,8 +5686,6 @@ void ProcessMonitor::unmountExtraDBroots() ModuleConfig moduleconfig; Oam oam; - log.writeLog(__LINE__, "unmountExtraDBroots called ", LOG_TYPE_DEBUG); - string DBRootStorageType = "internal"; try @@ -5797,8 +5781,6 @@ int ProcessMonitor::checkDataMount() //check/update the pmMount files - log.writeLog(__LINE__, "checkDataMount called ", LOG_TYPE_DEBUG); - string DBRootStorageType = "internal"; vector dbrootList; @@ -6031,8 +6013,6 @@ void ProcessMonitor::calTotalUmMemory() //check/update the pmMount files - log.writeLog(__LINE__, "calTotalUmMemory called ", LOG_TYPE_DEBUG); - try { sysinfo(&myinfo);