1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-10-31 18:30:33 +03:00
This commit is contained in:
david hill
2017-06-21 16:21:59 -05:00
parent 98a9a09f67
commit 743fec5c5e
11 changed files with 268 additions and 85 deletions

View File

@@ -552,6 +552,72 @@ static void startMgrProcessThread()
log.writeLog(__LINE__, "EXCEPTION ERROR on getSystemConfig: Caught unknown exception!", LOG_TYPE_ERROR);
}
//get Distributed Install
string DistributedInstall = "y";
try
{
oam.getSystemConfig("DistributedInstall", DistributedInstall);
}
catch (...)
{
log.writeLog(__LINE__, "addModule - ERROR: get DistributedInstall", LOG_TYPE_ERROR);
}
//send out moduleName to remote nodes on non-distrubuted install
if ( DistributedInstall == "n" )
{
int status = API_SUCCESS;
int k = 0;
for( ; k < 1200 ; k++ )
{
if ( startsystemthreadStop ) {
processManager.setSystemState(oam::MAN_OFFLINE);
// exit thread
log.writeLog(__LINE__, "startMgrProcessThread Exit with a stop system flag", LOG_TYPE_DEBUG);
pthread_exit(0);
}
status = API_SUCCESS;
for( unsigned int i = 0 ; i < systemmoduletypeconfig.moduletypeconfig.size(); i++)
{
int moduleCount = systemmoduletypeconfig.moduletypeconfig[i].ModuleCount;
if( moduleCount == 0)
continue;
DeviceNetworkList::iterator pt = systemmoduletypeconfig.moduletypeconfig[i].ModuleNetworkList.begin();
for ( ; pt != systemmoduletypeconfig.moduletypeconfig[i].ModuleNetworkList.end(); pt++)
{
string moduleName = (*pt).DeviceName;
if ( (*pt).DisableState == oam::MANDISABLEDSTATE ||
(*pt).DisableState == oam::AUTODISABLEDSTATE )
continue;
int ret = processManager.configureModule(moduleName);
if ( ret != API_SUCCESS )
status = ret;
}
}
//get out of loop if all modules updated
if( status == API_SUCCESS )
break;
//retry after sleeping for a bit
sleep(1);
}
if ( k == 1200 || status == API_FAILURE) {
// system didn't successfull restart
processManager.setSystemState(oam::FAILED);
// exit thread
log.writeLog(__LINE__, "startMgrProcessThread Exit with a failure, not all ProcMons running", LOG_TYPE_CRITICAL);
log.writeLog(__LINE__, "startMgrProcessThread Exit - failure", LOG_TYPE_DEBUG);
pthread_exit(0);
}
}
//wait until all modules are up after a system reboot
int i = 0;
for( ; i < 100 ; i++ )