You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-1523
This commit is contained in:
@ -7036,17 +7036,8 @@ int processCommand(string* arguments)
|
|||||||
if (systemstatus.SystemOpState == oam::ACTIVE ) {
|
if (systemstatus.SystemOpState == oam::ACTIVE ) {
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// cout << endl << " Starting Modules" << endl;
|
|
||||||
// oam.startModule(devicenetworklist, ackTemp);
|
|
||||||
|
|
||||||
//reload DBRM with new configuration, needs to be done here after startModule
|
|
||||||
// cmd = startup::StartUp::installDir() + "/bin/dbrmctl reload > /dev/null 2>&1";
|
|
||||||
// system(cmd.c_str());
|
|
||||||
// sleep(15);
|
|
||||||
|
|
||||||
// cout << " Successful start of Modules " << endl;
|
|
||||||
|
|
||||||
cout << endl << " Restarting System ";
|
cout << endl << " Restarting System ";
|
||||||
|
gracefulTemp = oam::FORCEFUL;
|
||||||
int returnStatus = oam.restartSystem(gracefulTemp, ackTemp);
|
int returnStatus = oam.restartSystem(gracefulTemp, ackTemp);
|
||||||
switch (returnStatus)
|
switch (returnStatus)
|
||||||
{
|
{
|
||||||
|
@ -3172,7 +3172,7 @@ int main(int argc, char *argv[])
|
|||||||
//skip interface with remote servers and perform install
|
//skip interface with remote servers and perform install
|
||||||
if ( !nonDistribute )
|
if ( !nonDistribute )
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// perform remote install of other servers in the system
|
// perform remote install of other servers in the system
|
||||||
//
|
//
|
||||||
cout << endl << "===== System Installation =====" << endl << endl;
|
cout << endl << "===== System Installation =====" << endl << endl;
|
||||||
|
@ -1489,7 +1489,7 @@ void pingDeviceThread()
|
|||||||
if (moduleInfoList[moduleName] >= ModuleHeartbeatCount ||
|
if (moduleInfoList[moduleName] >= ModuleHeartbeatCount ||
|
||||||
opState == oam::DOWN || opState == oam::AUTO_DISABLED)
|
opState == oam::DOWN || opState == oam::AUTO_DISABLED)
|
||||||
{
|
{
|
||||||
log.writeLog(__LINE__, "Module alive, bring it back online: " + moduleName, LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "*** Module alive, bring it back online: " + moduleName, LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
string PrimaryUMModuleName = config.moduleName();
|
string PrimaryUMModuleName = config.moduleName();
|
||||||
try {
|
try {
|
||||||
@ -1927,7 +1927,7 @@ void pingDeviceThread()
|
|||||||
{
|
{
|
||||||
//Log failure, issue alarm, set moduleOpState
|
//Log failure, issue alarm, set moduleOpState
|
||||||
Configuration config;
|
Configuration config;
|
||||||
log.writeLog(__LINE__, "module is down: " + moduleName, LOG_TYPE_CRITICAL);
|
log.writeLog(__LINE__, "*** module is down: " + moduleName, LOG_TYPE_CRITICAL);
|
||||||
|
|
||||||
//set query system state not ready
|
//set query system state not ready
|
||||||
BRM::DBRM dbrm;
|
BRM::DBRM dbrm;
|
||||||
@ -2013,9 +2013,6 @@ void pingDeviceThread()
|
|||||||
// resume the dbrm
|
// resume the dbrm
|
||||||
oam.dbrmctl("resume");
|
oam.dbrmctl("resume");
|
||||||
log.writeLog(__LINE__, "'dbrmctl resume' done", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "'dbrmctl resume' done", LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
//set recycle process
|
|
||||||
processManager.recycleProcess(moduleName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// return values = 'ip address' for running or rebooting, stopped or terminated
|
// return values = 'ip address' for running or rebooting, stopped or terminated
|
||||||
@ -2234,9 +2231,6 @@ void pingDeviceThread()
|
|||||||
oam.dbrmctl("resume");
|
oam.dbrmctl("resume");
|
||||||
log.writeLog(__LINE__, "'dbrmctl resume' done", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "'dbrmctl resume' done", LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
//set recycle process
|
|
||||||
processManager.recycleProcess(moduleName);
|
|
||||||
|
|
||||||
//enable query stats
|
//enable query stats
|
||||||
dbrm.setSystemQueryReady(true);
|
dbrm.setSystemQueryReady(true);
|
||||||
|
|
||||||
|
@ -619,21 +619,11 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
//distribute config file
|
//distribute config file
|
||||||
processManager.distributeConfigFile("system");
|
processManager.distributeConfigFile("system");
|
||||||
|
|
||||||
processManager.setSystemState(oam::ACTIVE);
|
|
||||||
|
|
||||||
//set query system state ready
|
//set query system state ready
|
||||||
processManager.setQuerySystemState(true);
|
processManager.setQuerySystemState(true);
|
||||||
|
|
||||||
//call dbrm control
|
processManager.setSystemState(oam::ACTIVE);
|
||||||
/* oam.dbrmctl("halt");
|
}
|
||||||
log.writeLog(__LINE__, "'dbrmctl halt' done", LOG_TYPE_DEBUG);
|
|
||||||
|
|
||||||
oam.dbrmctl("reload");
|
|
||||||
log.writeLog(__LINE__, "'dbrmctl reload' done", LOG_TYPE_DEBUG);
|
|
||||||
|
|
||||||
oam.dbrmctl("resume");
|
|
||||||
log.writeLog(__LINE__, "'dbrmctl resume' done", LOG_TYPE_DEBUG);
|
|
||||||
*/ }
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -846,15 +836,10 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
status = processManager.disableModule(moduleName, true);
|
status = processManager.disableModule(moduleName, true);
|
||||||
log.writeLog(__LINE__, "Disable Module Completed on " + moduleName, LOG_TYPE_INFO);
|
log.writeLog(__LINE__, "Disable Module Completed on " + moduleName, LOG_TYPE_INFO);
|
||||||
|
|
||||||
processManager.recycleProcess(moduleName);
|
|
||||||
|
|
||||||
//check for SIMPLEX Processes on mate might need to be started
|
|
||||||
processManager.checkSimplexModule(moduleName);
|
|
||||||
|
|
||||||
processManager.setSystemState(oam::ACTIVE);
|
|
||||||
|
|
||||||
//set query system state ready
|
//set query system state ready
|
||||||
processManager.setQuerySystemState(true);
|
processManager.setQuerySystemState(true);
|
||||||
|
|
||||||
|
processManager.setSystemState(oam::ACTIVE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1611,6 +1596,7 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
status = retStatus;
|
status = retStatus;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//now stop local module
|
//now stop local module
|
||||||
processManager.stopModule(config.moduleName(), graceful, manualFlag );
|
processManager.stopModule(config.moduleName(), graceful, manualFlag );
|
||||||
|
|
||||||
@ -1627,7 +1613,7 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
|
|
||||||
oam::DeviceNetworkList devicenetworklist;
|
oam::DeviceNetworkList devicenetworklist;
|
||||||
pthread_t startsystemthread;
|
pthread_t startsystemthread;
|
||||||
pthread_create (&startsystemthread, NULL, (void*(*)(void*)) &startSystemThread, &devicenetworklist);
|
status = pthread_create (&startsystemthread, NULL, (void*(*)(void*)) &startSystemThread, &devicenetworklist);
|
||||||
|
|
||||||
if ( status != 0 ) {
|
if ( status != 0 ) {
|
||||||
log.writeLog(__LINE__, "STARTMODULE: pthread_create failed, return status = " + oam.itoa(status));
|
log.writeLog(__LINE__, "STARTMODULE: pthread_create failed, return status = " + oam.itoa(status));
|
||||||
@ -1636,20 +1622,19 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
|
|
||||||
if (status == 0 && ackIndicator)
|
if (status == 0 && ackIndicator)
|
||||||
{
|
{
|
||||||
// BUG 4554 We don't need the join because calpont console is now looking for "Active"
|
pthread_join(startsystemthread, NULL);
|
||||||
// We need to return the ack right away to let console know we got the message.
|
status = startsystemthreadStatus;
|
||||||
// pthread_join(startsystemthread, NULL);
|
|
||||||
// status = startsystemthreadStatus;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// setup MySQL Replication after switchover command
|
// setup MySQL Replication after FORCE restart command
|
||||||
/* if (graceful == FORCEFUL)
|
if ( (status == API_SUCCESS) &&
|
||||||
|
(graceful == oam::FORCEFUL) )
|
||||||
{
|
{
|
||||||
log.writeLog(__LINE__, "Setup MySQL Replication for restartSystem FORCE, used by switch-parent command", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "Setup MySQL Replication for restartSystem FORCE", LOG_TYPE_DEBUG);
|
||||||
oam::DeviceNetworkList devicenetworklist;
|
oam::DeviceNetworkList devicenetworklist;
|
||||||
processManager.setMySQLReplication(devicenetworklist);
|
processManager.setMySQLReplication(devicenetworklist);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
log.writeLog(__LINE__, "RESTARTSYSTEM: Start System Request Completed", LOG_TYPE_INFO);
|
log.writeLog(__LINE__, "RESTARTSYSTEM: Start System Request Completed", LOG_TYPE_INFO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3277,6 +3262,7 @@ int ProcessManager::shutdownModule(string target, ByteStream::byte actionIndicat
|
|||||||
int ProcessManager::disableModule(string target, bool manualFlag)
|
int ProcessManager::disableModule(string target, bool manualFlag)
|
||||||
{
|
{
|
||||||
Oam oam;
|
Oam oam;
|
||||||
|
ProcessManager processManager(config, log);
|
||||||
ModuleConfig moduleconfig;
|
ModuleConfig moduleconfig;
|
||||||
|
|
||||||
log.writeLog(__LINE__, "disableModule request for " + target, LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "disableModule request for " + target, LOG_TYPE_DEBUG);
|
||||||
@ -3386,6 +3372,11 @@ int ProcessManager::disableModule(string target, bool manualFlag)
|
|||||||
if ( updateWorkerNodeconfig() != API_SUCCESS )
|
if ( updateWorkerNodeconfig() != API_SUCCESS )
|
||||||
return API_FAILURE;
|
return API_FAILURE;
|
||||||
|
|
||||||
|
processManager.recycleProcess(target);
|
||||||
|
|
||||||
|
//check for SIMPLEX Processes on mate might need to be started
|
||||||
|
processManager.checkSimplexModule(target);
|
||||||
|
|
||||||
//distribute config file
|
//distribute config file
|
||||||
distributeConfigFile("system");
|
distributeConfigFile("system");
|
||||||
|
|
||||||
@ -3414,37 +3405,6 @@ void ProcessManager::recycleProcess(string module, bool enableModule)
|
|||||||
oam.getSystemConfig("PrimaryUMModuleName", PrimaryUMModuleName);
|
oam.getSystemConfig("PrimaryUMModuleName", PrimaryUMModuleName);
|
||||||
}
|
}
|
||||||
catch(...) {}
|
catch(...) {}
|
||||||
|
|
||||||
// restart DBRM Process and DMLProc and return if enable module is being done
|
|
||||||
if (enableModule)
|
|
||||||
{
|
|
||||||
//recycle DBRM processes in all cases
|
|
||||||
restartProcessType("DBRMControllerNode");
|
|
||||||
restartProcessType("DBRMWorkerNode");
|
|
||||||
sleep(5);
|
|
||||||
|
|
||||||
restartProcessType("DMLProc");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//recycle DBRM processes in all cases
|
|
||||||
// restartProcessType("DBRMControllerNode", module);
|
|
||||||
// restartProcessType("DBRMWorkerNode");
|
|
||||||
|
|
||||||
// only recycle ddl/dmlproc, if down/up module is non-parent UM
|
|
||||||
/* if ( ( moduleType == "um" ) &&
|
|
||||||
if ( PrimaryUMModuleName != module)
|
|
||||||
{
|
|
||||||
restartProcessType("DDLProc",module);
|
|
||||||
restartProcessType("DMLProc",module);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
// if( PrimaryUMModuleName == module)
|
|
||||||
// {
|
|
||||||
// stopProcessType("DDLProc");
|
|
||||||
// stopProcessType("DMLProc");
|
|
||||||
// }
|
|
||||||
|
|
||||||
stopProcessType("WriteEngineServer");
|
stopProcessType("WriteEngineServer");
|
||||||
|
|
||||||
@ -3526,10 +3486,6 @@ int ProcessManager::enableModule(string target, int state, bool failover)
|
|||||||
|
|
||||||
if ( newStandbyModule == target)
|
if ( newStandbyModule == target)
|
||||||
setStandbyModule(newStandbyModule);
|
setStandbyModule(newStandbyModule);
|
||||||
|
|
||||||
//set recycle process
|
|
||||||
// if (!failover)
|
|
||||||
// recycleProcess(target);
|
|
||||||
|
|
||||||
log.writeLog(__LINE__, "enableModule request for " + target + " completed", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "enableModule request for " + target + " completed", LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
@ -6518,15 +6474,15 @@ void ProcessManager::setQuerySystemState(bool set)
|
|||||||
Oam oam;
|
Oam oam;
|
||||||
BRM::DBRM dbrm;
|
BRM::DBRM dbrm;
|
||||||
|
|
||||||
log.writeLog(__LINE__, "setQuerySystemState = " + oam.itoa(set), LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "setQuerySystemState called = " + oam.itoa(set), LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
dbrm.setSystemQueryReady(set);
|
dbrm.setSystemQueryReady(set);
|
||||||
log.writeLog(__LINE__, "setSystemQueryReady successful", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "setSystemQueryReady = " + oam.itoa(set), LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
dbrm.setSystemReady(set);
|
dbrm.setSystemReady(set);
|
||||||
log.writeLog(__LINE__, "setSystemReady successful", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "setSystemReady = " + oam.itoa(set), LOG_TYPE_DEBUG);
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
{
|
{
|
||||||
@ -7089,23 +7045,28 @@ void startSystemThread(oam::DeviceNetworkList Devicenetworklist)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (DMLprocessstatus.ProcessOpState == oam::ACTIVE) {
|
if (DMLprocessstatus.ProcessOpState == oam::ACTIVE) {
|
||||||
rtn = oam::ACTIVE;
|
rtn = oam::ACTIVE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DMLprocessstatus.ProcessOpState == oam::FAILED) {
|
if (DMLprocessstatus.ProcessOpState == oam::FAILED) {
|
||||||
rtn = oam::FAILED;
|
rtn = oam::FAILED;
|
||||||
|
status = oam::API_FAILURE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// wait some more
|
// wait some more
|
||||||
sleep(2);
|
sleep(2);
|
||||||
}
|
}
|
||||||
processManager.setSystemState(rtn);
|
|
||||||
|
if ( rtn = oam::ACTIVE )
|
||||||
|
//set query system state not ready
|
||||||
|
processManager.setQuerySystemState(true);
|
||||||
|
|
||||||
|
processManager.setSystemState(rtn);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
//set query system state ready
|
processManager.setSystemState(oam::FAILED);
|
||||||
processManager.setQuerySystemState(true);
|
|
||||||
|
|
||||||
// exit thread
|
// exit thread
|
||||||
log.writeLog(__LINE__, "startSystemThread Exit", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "startSystemThread Exit", LOG_TYPE_DEBUG);
|
||||||
|
@ -2451,17 +2451,17 @@ void processStatusMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//if DMLProc set to ACTIVE, set system state to ACTIVE if in an INIT state
|
//if DMLProc set to ACTIVE, set system state to ACTIVE if in an INIT state
|
||||||
if ( processName == "DMLProc" && state == oam::ACTIVE )
|
// if ( processName == "DMLProc" && state == oam::ACTIVE )
|
||||||
{
|
// {
|
||||||
if ( fShmSystemStatus[0].OpState == oam::BUSY_INIT ||
|
// if ( fShmSystemStatus[0].OpState == oam::BUSY_INIT ||
|
||||||
fShmSystemStatus[0].OpState == oam::MAN_INIT ||
|
// fShmSystemStatus[0].OpState == oam::MAN_INIT ||
|
||||||
fShmSystemStatus[0].OpState == oam::AUTO_INIT )
|
// fShmSystemStatus[0].OpState == oam::AUTO_INIT )
|
||||||
{
|
// {
|
||||||
fShmSystemStatus[0].OpState = state;
|
// fShmSystemStatus[0].OpState = state;
|
||||||
memcpy(fShmSystemStatus[0].StateChangeDate, oam.getCurrentTime().c_str(), DATESIZE);
|
// memcpy(fShmSystemStatus[0].StateChangeDate, oam.getCurrentTime().c_str(), DATESIZE);
|
||||||
log.writeLog(__LINE__, "statusControl: REQUEST RECEIVED: Set System State = " + oamState[state], LOG_TYPE_DEBUG);
|
// log.writeLog(__LINE__, "statusControl: REQUEST RECEIVED: Set System State = " + oamState[state], LOG_TYPE_DEBUG);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user