You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-11-25 20:23:16 +03:00
MCOL-3842: Fix sequence of reinit / reload failover code fix. Cleanup logging.
This commit is contained in:
@@ -2380,17 +2380,21 @@ void pingDeviceThread()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
processManager.distributeConfigFile("system");
|
||||||
|
|
||||||
|
processManager.reinitProcesses();
|
||||||
|
|
||||||
|
// non-amazon
|
||||||
//call dbrm control
|
//call dbrm control
|
||||||
oam.dbrmctl("reload");
|
oam.dbrmctl("reload");
|
||||||
log.writeLog(__LINE__, "'dbrmctl reload' done", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "'dbrmctl reload' done", LOG_TYPE_DEBUG);
|
||||||
// non-amazon
|
|
||||||
// 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 reinit process
|
//set recycle process
|
||||||
processManager.reinitProcesses();
|
//processManager.recycleProcess(moduleName);
|
||||||
|
//processManager.reinitProcesses();
|
||||||
//set query system state ready
|
//set query system state ready
|
||||||
processManager.setQuerySystemState(true);
|
processManager.setQuerySystemState(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3737,6 +3737,12 @@ int ProcessManager::disableModule(string target, bool manualFlag)
|
|||||||
bool degraded;
|
bool degraded;
|
||||||
oam.getModuleStatus(target, opState, degraded);
|
oam.getModuleStatus(target, opState, degraded);
|
||||||
|
|
||||||
|
if (opState == newState || opState == oam::MAN_DISABLED)
|
||||||
|
{
|
||||||
|
pthread_mutex_unlock(&THREAD_LOCK);
|
||||||
|
return API_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
// if current state is AUTO_DISABLED and new state is MAN_DISABLED
|
// if current state is AUTO_DISABLED and new state is MAN_DISABLED
|
||||||
// update state to MAN_DISABLED
|
// update state to MAN_DISABLED
|
||||||
|
|
||||||
@@ -3825,21 +3831,20 @@ int ProcessManager::disableModule(string target, bool manualFlag)
|
|||||||
return API_SUCCESS;
|
return API_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ProcessManager::reinitProcesses()
|
void ProcessManager::reinitProcesses()
|
||||||
{
|
{
|
||||||
log.writeLog(__LINE__, "reinitProcesses... ", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "reinitProcesses... ", LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
restartProcessType("DBRMControllerNode");
|
|
||||||
reinitProcessType("ExeMgr");
|
reinitProcessType("ExeMgr");
|
||||||
reinitProcessType("DBRMWorkerNode");
|
reinitProcessType("DBRMWorkerNode");
|
||||||
restartProcessType("WriteEngineServer");
|
reinitProcessType("WriteEngineServer");
|
||||||
sleep(1);
|
sleep(1);
|
||||||
startProcessType("DDLProc");
|
|
||||||
sleep(1);
|
|
||||||
startProcessType("DMLProc");
|
|
||||||
reinitProcessType("DDLProc");
|
reinitProcessType("DDLProc");
|
||||||
|
sleep(1);
|
||||||
reinitProcessType("DMLProc");
|
reinitProcessType("DMLProc");
|
||||||
|
|
||||||
|
|
||||||
log.writeLog(__LINE__, "reinitProcesses complete", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "reinitProcesses complete", LOG_TYPE_DEBUG);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6739,8 +6744,6 @@ void ProcessManager::setQuerySystemState(bool set)
|
|||||||
Oam oam;
|
Oam oam;
|
||||||
BRM::DBRM dbrm;
|
BRM::DBRM dbrm;
|
||||||
|
|
||||||
log.writeLog(__LINE__, "setQuerySystemState called = " + oam.itoa(set), LOG_TYPE_DEBUG);
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
dbrm.setSystemQueryReady(set);
|
dbrm.setSystemQueryReady(set);
|
||||||
@@ -8169,8 +8172,6 @@ int ProcessManager::updatePMSconfig( bool check )
|
|||||||
sysConfig1->write();
|
sysConfig1->write();
|
||||||
pthread_mutex_unlock(&THREAD_LOCK);
|
pthread_mutex_unlock(&THREAD_LOCK);
|
||||||
|
|
||||||
log.writeLog(__LINE__, "updatePMSconfig completed", LOG_TYPE_DEBUG);
|
|
||||||
|
|
||||||
return API_SUCCESS;
|
return API_SUCCESS;
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
@@ -8510,8 +8511,6 @@ int ProcessManager::setPMProcIPs( std::string moduleName, std::string processNam
|
|||||||
Oam oam;
|
Oam oam;
|
||||||
ModuleConfig moduleconfig;
|
ModuleConfig moduleconfig;
|
||||||
|
|
||||||
log.writeLog(__LINE__, "setPMProcIPs called for " + moduleName, LOG_TYPE_DEBUG);
|
|
||||||
|
|
||||||
pthread_mutex_lock(&THREAD_LOCK);
|
pthread_mutex_lock(&THREAD_LOCK);
|
||||||
|
|
||||||
if ( processName == oam::UnassignedName || processName == "DDLProc")
|
if ( processName == oam::UnassignedName || processName == "DDLProc")
|
||||||
@@ -8630,8 +8629,6 @@ int ProcessManager::distributeConfigFile(std::string name, std::string file)
|
|||||||
Oam oam;
|
Oam oam;
|
||||||
int returnStatus = oam::API_SUCCESS;
|
int returnStatus = oam::API_SUCCESS;
|
||||||
|
|
||||||
log.writeLog(__LINE__, "distributeConfigFile called for " + name + " file = " + file, LOG_TYPE_DEBUG);
|
|
||||||
|
|
||||||
string dirName = std::string(MCSSYSCONFDIR) + "/columnstore/";
|
string dirName = std::string(MCSSYSCONFDIR) + "/columnstore/";
|
||||||
string fileName = dirName + file;
|
string fileName = dirName + file;
|
||||||
|
|
||||||
@@ -9941,7 +9938,7 @@ int ProcessManager::OAMParentModuleChange()
|
|||||||
runStandby = false;
|
runStandby = false;
|
||||||
int retryCount = 0;
|
int retryCount = 0;
|
||||||
//sleep, give time for message thread to startup
|
//sleep, give time for message thread to startup
|
||||||
while (!MsgThreadActive && retryCount < 5)
|
while (!MsgThreadActive && retryCount < 10)
|
||||||
{
|
{
|
||||||
log.writeLog(__LINE__, "Waiting for Message Thread...", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "Waiting for Message Thread...", LOG_TYPE_DEBUG);
|
||||||
sleep(5);
|
sleep(5);
|
||||||
@@ -10043,7 +10040,7 @@ int ProcessManager::OAMParentModuleChange()
|
|||||||
//do it here to get current processes active faster to process queries faster
|
//do it here to get current processes active faster to process queries faster
|
||||||
processManager.setProcessStates(downOAMParentName, oam::AUTO_OFFLINE);
|
processManager.setProcessStates(downOAMParentName, oam::AUTO_OFFLINE);
|
||||||
|
|
||||||
//set other down modules to disable state
|
//set OTHER down modules to disable state
|
||||||
vector<string>::iterator pt1 = downModuleList.begin();
|
vector<string>::iterator pt1 = downModuleList.begin();
|
||||||
|
|
||||||
for ( ; pt1 != downModuleList.end() ; pt1++)
|
for ( ; pt1 != downModuleList.end() ; pt1++)
|
||||||
@@ -10059,7 +10056,7 @@ int ProcessManager::OAMParentModuleChange()
|
|||||||
//distribute config file
|
//distribute config file
|
||||||
distributeConfigFile("system");
|
distributeConfigFile("system");
|
||||||
|
|
||||||
//restart local module
|
//restart local module WHY??
|
||||||
processManager.stopModule(config.moduleName(), oam::FORCEFUL, true);
|
processManager.stopModule(config.moduleName(), oam::FORCEFUL, true);
|
||||||
|
|
||||||
string localModule = config.moduleName();
|
string localModule = config.moduleName();
|
||||||
@@ -10102,11 +10099,12 @@ int ProcessManager::OAMParentModuleChange()
|
|||||||
sleep(2);
|
sleep(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//restart/reinit processes to force their release of the controller node port
|
//restart/reinit processes to force their release of the controller node port
|
||||||
if ( ( config.ServerInstallType() == oam::INSTALL_COMBINE_DM_UM_PM) &&
|
if ( ( config.ServerInstallType() == oam::INSTALL_COMBINE_DM_UM_PM) &&
|
||||||
( moduleNameList.size() <= 0 && config.moduleType() == "pm") )
|
( moduleNameList.size() <= 0 && config.moduleType() == "pm") )
|
||||||
{
|
{
|
||||||
status = 0;
|
int status = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -10326,8 +10324,6 @@ std::string ProcessManager::getStandbyModule()
|
|||||||
string errmsg;
|
string errmsg;
|
||||||
oam.glusterctl(oam::GLUSTER_WHOHAS, "1", pmList, errmsg);
|
oam.glusterctl(oam::GLUSTER_WHOHAS, "1", pmList, errmsg);
|
||||||
|
|
||||||
log.writeLog(__LINE__, "GLUSTER_WHOHAS called:" + pmList, LOG_TYPE_DEBUG);
|
|
||||||
|
|
||||||
boost::char_separator<char> sep(" ");
|
boost::char_separator<char> sep(" ");
|
||||||
boost::tokenizer< boost::char_separator<char> > tokens(pmList, sep);
|
boost::tokenizer< boost::char_separator<char> > tokens(pmList, sep);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user