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
|
||||
{
|
||||
processManager.distributeConfigFile("system");
|
||||
|
||||
processManager.reinitProcesses();
|
||||
|
||||
// non-amazon
|
||||
//call dbrm control
|
||||
oam.dbrmctl("reload");
|
||||
log.writeLog(__LINE__, "'dbrmctl reload' done", LOG_TYPE_DEBUG);
|
||||
// non-amazon
|
||||
// resume the dbrm
|
||||
oam.dbrmctl("resume");
|
||||
log.writeLog(__LINE__, "'dbrmctl resume' done", LOG_TYPE_DEBUG);
|
||||
|
||||
//set reinit process
|
||||
processManager.reinitProcesses();
|
||||
|
||||
//set recycle process
|
||||
//processManager.recycleProcess(moduleName);
|
||||
//processManager.reinitProcesses();
|
||||
//set query system state ready
|
||||
processManager.setQuerySystemState(true);
|
||||
}
|
||||
|
||||
@@ -3737,6 +3737,12 @@ int ProcessManager::disableModule(string target, bool manualFlag)
|
||||
bool 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
|
||||
// update state to MAN_DISABLED
|
||||
|
||||
@@ -3818,28 +3824,27 @@ int ProcessManager::disableModule(string target, bool manualFlag)
|
||||
//distribute config file
|
||||
distributeConfigFile("system");
|
||||
|
||||
processManager.reinitProcesses();
|
||||
processManager.reinitProcesses();
|
||||
|
||||
log.writeLog(__LINE__, "disableModule successfully complete for " + target, LOG_TYPE_DEBUG);
|
||||
|
||||
return API_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
void ProcessManager::reinitProcesses()
|
||||
{
|
||||
log.writeLog(__LINE__, "reinitProcesses... ", LOG_TYPE_DEBUG);
|
||||
|
||||
restartProcessType("DBRMControllerNode");
|
||||
reinitProcessType("ExeMgr");
|
||||
reinitProcessType("DBRMWorkerNode");
|
||||
restartProcessType("WriteEngineServer");
|
||||
reinitProcessType("WriteEngineServer");
|
||||
sleep(1);
|
||||
startProcessType("DDLProc");
|
||||
sleep(1);
|
||||
startProcessType("DMLProc");
|
||||
reinitProcessType("DDLProc");
|
||||
sleep(1);
|
||||
reinitProcessType("DMLProc");
|
||||
|
||||
|
||||
log.writeLog(__LINE__, "reinitProcesses complete", LOG_TYPE_DEBUG);
|
||||
}
|
||||
|
||||
@@ -3900,7 +3905,7 @@ void ProcessManager::recycleProcess(string module, bool enableModule)
|
||||
|
||||
startProcessType("mysqld");
|
||||
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
/******************************************************************************************
|
||||
@@ -6739,8 +6744,6 @@ void ProcessManager::setQuerySystemState(bool set)
|
||||
Oam oam;
|
||||
BRM::DBRM dbrm;
|
||||
|
||||
log.writeLog(__LINE__, "setQuerySystemState called = " + oam.itoa(set), LOG_TYPE_DEBUG);
|
||||
|
||||
try
|
||||
{
|
||||
dbrm.setSystemQueryReady(set);
|
||||
@@ -8169,8 +8172,6 @@ int ProcessManager::updatePMSconfig( bool check )
|
||||
sysConfig1->write();
|
||||
pthread_mutex_unlock(&THREAD_LOCK);
|
||||
|
||||
log.writeLog(__LINE__, "updatePMSconfig completed", LOG_TYPE_DEBUG);
|
||||
|
||||
return API_SUCCESS;
|
||||
}
|
||||
catch (...)
|
||||
@@ -8510,8 +8511,6 @@ int ProcessManager::setPMProcIPs( std::string moduleName, std::string processNam
|
||||
Oam oam;
|
||||
ModuleConfig moduleconfig;
|
||||
|
||||
log.writeLog(__LINE__, "setPMProcIPs called for " + moduleName, LOG_TYPE_DEBUG);
|
||||
|
||||
pthread_mutex_lock(&THREAD_LOCK);
|
||||
|
||||
if ( processName == oam::UnassignedName || processName == "DDLProc")
|
||||
@@ -8630,8 +8629,6 @@ int ProcessManager::distributeConfigFile(std::string name, std::string file)
|
||||
Oam oam;
|
||||
int returnStatus = oam::API_SUCCESS;
|
||||
|
||||
log.writeLog(__LINE__, "distributeConfigFile called for " + name + " file = " + file, LOG_TYPE_DEBUG);
|
||||
|
||||
string dirName = std::string(MCSSYSCONFDIR) + "/columnstore/";
|
||||
string fileName = dirName + file;
|
||||
|
||||
@@ -9941,7 +9938,7 @@ int ProcessManager::OAMParentModuleChange()
|
||||
runStandby = false;
|
||||
int retryCount = 0;
|
||||
//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);
|
||||
sleep(5);
|
||||
@@ -10043,7 +10040,7 @@ int ProcessManager::OAMParentModuleChange()
|
||||
//do it here to get current processes active faster to process queries faster
|
||||
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();
|
||||
|
||||
for ( ; pt1 != downModuleList.end() ; pt1++)
|
||||
@@ -10059,7 +10056,7 @@ int ProcessManager::OAMParentModuleChange()
|
||||
//distribute config file
|
||||
distributeConfigFile("system");
|
||||
|
||||
//restart local module
|
||||
//restart local module WHY??
|
||||
processManager.stopModule(config.moduleName(), oam::FORCEFUL, true);
|
||||
|
||||
string localModule = config.moduleName();
|
||||
@@ -10102,11 +10099,12 @@ int ProcessManager::OAMParentModuleChange()
|
||||
sleep(2);
|
||||
}
|
||||
|
||||
|
||||
//restart/reinit processes to force their release of the controller node port
|
||||
if ( ( config.ServerInstallType() == oam::INSTALL_COMBINE_DM_UM_PM) &&
|
||||
( moduleNameList.size() <= 0 && config.moduleType() == "pm") )
|
||||
{
|
||||
status = 0;
|
||||
int status = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -10326,8 +10324,6 @@ std::string ProcessManager::getStandbyModule()
|
||||
string 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::tokenizer< boost::char_separator<char> > tokens(pmList, sep);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user