1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

add more checks around the getsystems

This commit is contained in:
David Hill
2016-12-05 22:35:01 +00:00
parent 857e1f9d69
commit 9283635460
8 changed files with 47 additions and 27 deletions

View File

@ -81,7 +81,7 @@ start() {
exit 0
fi
(sudo mkdir -p /var/lock/subsys && touch /var/lock/subsys/columnstore) >/dev/null 2>&1
(sudo mkdir -p /var/lock/subsys && sudo chmod 777 /var/lock/subsys && sudo touch /var/lock/subsys/columnstore) >/dev/null 2>&1
if [ -x $InstallDir/bin/columnstore.pre-start ]; then
$InstallDir/bin/columnstore.pre-start

View File

@ -7,11 +7,11 @@
prefix=/usr/local
installdir=$prefix/mariadb/columnstore
rpmmode=install
user=$USER
sudo=sudo
if [ -z "$user" ]; then
user=root
sudo=" "
if [ $USER != "root"]; then
user=$USER
sudo="sudo "
fi
quiet=0

View File

@ -7,12 +7,12 @@
prefix=/usr/local
installdir=$prefix/mariadb/columnstore
rpmmode=install
user=$USER
sudo=sudo
if [ -z "$user" ]; then
user=root
sudo=" "
if [ $USER != "root"]; then
user=$USER
sudo="sudo "
fi
quiet=0
for arg in "$@"; do

View File

@ -9271,7 +9271,7 @@ namespace oam
catch(...)
{
processor.shutdown();
throw std::runtime_error("error");
throw std::runtime_error("write error");
}
@ -9282,7 +9282,7 @@ namespace oam
catch(...)
{
processor.shutdown();
throw std::runtime_error("error");
throw std::runtime_error("read error");
}
ByteStream::byte returnRequestType;
@ -9649,6 +9649,8 @@ namespace oam
return true;
}
}
writeLog("checkSystemRunning - system reported down", LOG_TYPE_DEBUG );
return false;
}
} //namespace oam

View File

@ -4683,7 +4683,7 @@ int processCommand(string* arguments)
}
cout << " ";
cout.width(20);
cout << "---------------";
//cout << "---------------";
if ( AmazonElasticIPCount > 0 )
{
cout.width(20);

View File

@ -2631,8 +2631,7 @@ void processMSG(messageqcpp::IOSocket* cfIos)
case PROCESSALARM:
{
string dbroot;
msg >> dbroot;
log.writeLog(__LINE__, "MSG RECEIVED: Process Alarm Message");
ByteStream::byte alarmID;
std::string componentID;
@ -2839,6 +2838,18 @@ void processMSG(messageqcpp::IOSocket* cfIos)
processManager.restartProcessType("DDLProc");
processManager.restartProcessType("DMLProc");
sleep(1);
string DMLmodule = config.OAMParentName();
if ( config.ServerInstallType() != oam::INSTALL_COMBINE_DM_UM_PM ) {
string PrimaryUMModuleName;
try {
oam.getSystemConfig("PrimaryUMModuleName", PrimaryUMModuleName);
}
catch(...) {}
if ( !PrimaryUMModuleName.empty() )
DMLmodule = PrimaryUMModuleName;
}
// Wait for DMLProc to be ACTIVE
BRM::DBRM dbrm;
state = AUTO_OFFLINE;
@ -2848,7 +2859,7 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|| state == oam::AUTO_INIT
|| state == oam::ROLLBACK_INIT)
{
oam.getProcessStatus("DMLProc", config.OAMParentName(), procstat);
oam.getProcessStatus("DMLProc", DMLmodule, procstat);
state = procstat.ProcessOpState;
if ( procstat.ProcessOpState == oam::ACTIVE)
break;

View File

@ -138,7 +138,9 @@ int main(int argc, char **argv)
if ( cloud == "amazon-ec2" ) {
if(!aMonitor.amazonIPCheck()) {
string cmd = startup::StartUp::installDir() + "/bin/infinidb stop > /dev/null 2>&1";
log.writeLog(__LINE__, "ERROR: amazonIPCheck failed, exiting", LOG_TYPE_CRITICAL);
sleep(2);
string cmd = startup::StartUp::installDir() + "/bin/columnstore stop > /dev/null 2>&1";
system(cmd.c_str());
exit(1);
}
@ -377,7 +379,7 @@ int main(int argc, char **argv)
if ( config.OAMParentName() == oam::UnassignedName ) {
cerr << endl << "OAMParentModuleName == oam::UnassignedName, exiting " << endl;
log.writeLog(__LINE__, "OAMParentModuleName == oam::UnassignedName, exiting", LOG_TYPE_CRITICAL);
exit (-1);
exit (1);
}
//check if module is in a DISABLED state
@ -562,8 +564,8 @@ int main(int argc, char **argv)
}
catch(...)
{
log.writeLog(__LINE__, "Problem getting the ParentOAMModuleName key from the Calpont System Configuration file", LOG_TYPE_ERROR);
exit(-1);
log.writeLog(__LINE__, "Problem getting the ParentOAMModuleName key from the Columnstore System Configuration file", LOG_TYPE_CRITICAL);
exit(1);
}
}
@ -1673,7 +1675,7 @@ static void statusControlThread()
fProcStatMapreg.swap(region);
fShmProcessStatus = static_cast<shmProcessStatus*>(fProcStatMapreg.get_address());
if (fShmProcessStatus == 0) {
log.writeLog(__LINE__, "*****ProcessStatusTable shmat failed.", LOG_TYPE_ERROR);
log.writeLog(__LINE__, "*****ProcessStatusTable shmat failed.", LOG_TYPE_CRITICAL);
exit(1);
}
@ -1735,7 +1737,7 @@ static void statusControlThread()
fSysStatMapreg.swap(region2);
fShmSystemStatus = static_cast<shmDeviceStatus*>(fSysStatMapreg.get_address());
if (fShmSystemStatus == 0) {
log.writeLog(__LINE__, "*****SystemStatusTable shmat failed.", LOG_TYPE_ERROR);
log.writeLog(__LINE__, "*****SystemStatusTable shmat failed.", LOG_TYPE_CRITICAL);
exit(1);
}
@ -1839,7 +1841,7 @@ static void statusControlThread()
fShmNICStatus = static_cast<shmDeviceStatus*>(fNICStatMapreg.get_address());
if (fShmNICStatus == 0) {
log.writeLog(__LINE__, "*****NICStatusTable shmat failed.", LOG_TYPE_ERROR);
log.writeLog(__LINE__, "*****NICStatusTable shmat failed.", LOG_TYPE_CRITICAL);
exit(1);
}
@ -1925,7 +1927,7 @@ static void statusControlThread()
fShmExtDeviceStatus = static_cast<shmDeviceStatus*>(fExtStatMapreg.get_address());
if (fShmExtDeviceStatus == 0) {
log.writeLog(__LINE__, "*****ExtDeviceStatusTable shmat failed.", LOG_TYPE_ERROR);
log.writeLog(__LINE__, "*****ExtDeviceStatusTable shmat failed.", LOG_TYPE_CRITICAL);
exit(1);
}
@ -2003,7 +2005,7 @@ static void statusControlThread()
fShmDbrootStatus = static_cast<shmDeviceStatus*>(fdDbrootStatMapreg.get_address());
if (fShmDbrootStatus == 0) {
log.writeLog(__LINE__, "*****DbrootStatusTable shmat failed.", LOG_TYPE_ERROR);
log.writeLog(__LINE__, "*****DbrootStatusTable shmat failed.", LOG_TYPE_CRITICAL);
exit(1);
}

View File

@ -2597,7 +2597,7 @@ pid_t ProcessMonitor::startProcess(string processModuleType, string processName,
//Update Process Status: Mark Process INIT state
updateProcessInfo(processName, FAILED, newProcessID);
exit(oam::API_FAILURE);
return (oam::API_FAILURE);
}
return newProcessID;
@ -2812,6 +2812,11 @@ void sendProcessThread(sendProcessInfo_t* t)
try {
oam.setProcessStatus(processName, config.moduleName(), state, PID);
}
catch (exception& ex)
{
string error = ex.what();
log.writeLog(__LINE__, "EXCEPTION ERROR on setProcessStatus: " + error, LOG_TYPE_ERROR);
}
catch(...)
{
log.writeLog(__LINE__, "EXCEPTION ERROR on setProcessStatus: Caught unknown exception!", LOG_TYPE_ERROR );