You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-11-24 08:41:09 +03:00
Fixes for cpimport primary node failover and locking issues.
This commit is contained in:
119
procmgr/main.cpp
119
procmgr/main.cpp
@@ -1649,17 +1649,17 @@ void pingDeviceThread()
|
||||
if (busy)
|
||||
break;
|
||||
|
||||
//set query system state not ready
|
||||
processManager.setQuerySystemState(false);
|
||||
|
||||
processManager.setSystemState(oam::BUSY_INIT);
|
||||
|
||||
processManager.reinitProcessType("cpimport");
|
||||
|
||||
// halt the dbrm
|
||||
oam.dbrmctl("halt");
|
||||
log.writeLog(__LINE__, "'dbrmctl halt' done", LOG_TYPE_DEBUG);
|
||||
|
||||
//set query system state not ready
|
||||
processManager.setQuerySystemState(false);
|
||||
|
||||
processManager.setSystemState(oam::BUSY_INIT);
|
||||
|
||||
aManager.sendAlarmReport(moduleName.c_str(), MODULE_DOWN_AUTO, CLEAR);
|
||||
|
||||
//send notification
|
||||
@@ -1724,6 +1724,36 @@ void pingDeviceThread()
|
||||
//set query system state ready
|
||||
processManager.setQuerySystemState(true);
|
||||
|
||||
// waiting until dml are ACTIVE
|
||||
// disableModule is going to trigger DMLProc to restart wait for it
|
||||
int retry = 0;
|
||||
while (retry < 30)
|
||||
{
|
||||
ProcessStatus DMLprocessstatus;
|
||||
|
||||
try
|
||||
{
|
||||
oam.getProcessStatus("DMLProc", config.moduleName(), DMLprocessstatus);
|
||||
}
|
||||
catch (exception& ex)
|
||||
{}
|
||||
catch (...)
|
||||
{}
|
||||
|
||||
if (DMLprocessstatus.ProcessOpState == oam::BUSY_INIT)
|
||||
log.writeLog(__LINE__, "Waiting for DMLProc to finish rollback", LOG_TYPE_DEBUG);
|
||||
|
||||
if (DMLprocessstatus.ProcessOpState == oam::ACTIVE)
|
||||
break;
|
||||
|
||||
if (DMLprocessstatus.ProcessOpState == oam::FAILED)
|
||||
break;
|
||||
|
||||
// wait some more
|
||||
sleep(2);
|
||||
++retry;
|
||||
}
|
||||
|
||||
goto break_case;
|
||||
}
|
||||
}
|
||||
@@ -2016,6 +2046,7 @@ void pingDeviceThread()
|
||||
|
||||
log.writeLog(__LINE__, "Module failed to auto start: " + moduleName, LOG_TYPE_CRITICAL);
|
||||
|
||||
|
||||
if ( amazon )
|
||||
processManager.setSystemState(oam::FAILED);
|
||||
else
|
||||
@@ -2024,6 +2055,35 @@ void pingDeviceThread()
|
||||
//set query system state ready
|
||||
processManager.setQuerySystemState(true);
|
||||
|
||||
// waiting until dml are ACTIVE
|
||||
// disableModule is going to trigger DMLProc to restart wait for it
|
||||
int retry = 0;
|
||||
while (retry < 30)
|
||||
{
|
||||
ProcessStatus DMLprocessstatus;
|
||||
|
||||
try
|
||||
{
|
||||
oam.getProcessStatus("DMLProc", config.moduleName(), DMLprocessstatus);
|
||||
}
|
||||
catch (exception& ex)
|
||||
{}
|
||||
catch (...)
|
||||
{}
|
||||
|
||||
if (DMLprocessstatus.ProcessOpState == oam::BUSY_INIT)
|
||||
log.writeLog(__LINE__, "Waiting for DMLProc to finish rollback", LOG_TYPE_DEBUG);
|
||||
|
||||
if (DMLprocessstatus.ProcessOpState == oam::ACTIVE)
|
||||
break;
|
||||
|
||||
if (DMLprocessstatus.ProcessOpState == oam::FAILED)
|
||||
break;
|
||||
|
||||
// wait some more
|
||||
sleep(2);
|
||||
++retry;
|
||||
}
|
||||
//clear count
|
||||
moduleInfoList[moduleName] = 0;
|
||||
}
|
||||
@@ -2085,17 +2145,22 @@ void pingDeviceThread()
|
||||
Configuration config;
|
||||
log.writeLog(__LINE__, "*** module is down: " + moduleName, LOG_TYPE_CRITICAL);
|
||||
|
||||
//set query system state not ready
|
||||
processManager.setQuerySystemState(false);
|
||||
|
||||
processManager.setSystemState(oam::BUSY_INIT);
|
||||
|
||||
processManager.reinitProcessType("cpimport");
|
||||
|
||||
// halt the dbrm
|
||||
oam.dbrmctl("halt");
|
||||
log.writeLog(__LINE__, "'dbrmctl halt' done", LOG_TYPE_DEBUG);
|
||||
|
||||
//set query system state not ready
|
||||
processManager.setQuerySystemState(false);
|
||||
|
||||
processManager.setSystemState(oam::BUSY_INIT);
|
||||
|
||||
//call dbrm control
|
||||
oam.dbrmctl("reload");
|
||||
log.writeLog(__LINE__, "'dbrmctl reload' done", LOG_TYPE_DEBUG);
|
||||
|
||||
|
||||
//send notification
|
||||
oam.sendDeviceNotification(moduleName, MODULE_DOWN);
|
||||
|
||||
@@ -2149,6 +2214,36 @@ void pingDeviceThread()
|
||||
//set query system state ready
|
||||
processManager.setQuerySystemState(true);
|
||||
|
||||
// waiting until dml are ACTIVE
|
||||
// disableModule is going to trigger DMLProc to restart wait for it
|
||||
int retry = 0;
|
||||
while (retry < 30)
|
||||
{
|
||||
ProcessStatus DMLprocessstatus;
|
||||
|
||||
try
|
||||
{
|
||||
oam.getProcessStatus("DMLProc", config.moduleName(), DMLprocessstatus);
|
||||
}
|
||||
catch (exception& ex)
|
||||
{}
|
||||
catch (...)
|
||||
{}
|
||||
|
||||
if (DMLprocessstatus.ProcessOpState == oam::BUSY_INIT)
|
||||
log.writeLog(__LINE__, "Waiting for DMLProc to finish rollback", LOG_TYPE_DEBUG);
|
||||
|
||||
if (DMLprocessstatus.ProcessOpState == oam::ACTIVE)
|
||||
break;
|
||||
|
||||
if (DMLprocessstatus.ProcessOpState == oam::FAILED)
|
||||
break;
|
||||
|
||||
// wait some more
|
||||
sleep(2);
|
||||
++retry;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2381,10 +2476,6 @@ void pingDeviceThread()
|
||||
}
|
||||
else
|
||||
{
|
||||
processManager.distributeConfigFile("system");
|
||||
|
||||
processManager.reinitProcesses();
|
||||
|
||||
// non-amazon
|
||||
//call dbrm control
|
||||
oam.dbrmctl("reload");
|
||||
|
||||
Reference in New Issue
Block a user