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-520. Fixed several instances where we were using a too-new
contructor to ifstream.
This commit is contained in:
@ -3058,7 +3058,7 @@ int ha_calpont_impl_rnd_init(TABLE* table)
|
|||||||
// plan serialization
|
// plan serialization
|
||||||
string tmpDir = aTmpDir + "/li1-plan.hex";
|
string tmpDir = aTmpDir + "/li1-plan.hex";
|
||||||
|
|
||||||
ifstream ifs(tmpDir);
|
ifstream ifs(tmpDir.c_str());
|
||||||
ByteStream bs1;
|
ByteStream bs1;
|
||||||
ifs >> bs1;
|
ifs >> bs1;
|
||||||
ifs.close();
|
ifs.close();
|
||||||
@ -5121,7 +5121,7 @@ int ha_calpont_impl_group_by_init(ha_calpont_group_by_handler* group_hand, TABLE
|
|||||||
ci->warningMsg = msg;
|
ci->warningMsg = msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the previous query has error and
|
// If the previous query has error and
|
||||||
// this is not a subquery run by the server(MCOL-1601)
|
// this is not a subquery run by the server(MCOL-1601)
|
||||||
// re-establish the connection
|
// re-establish the connection
|
||||||
if (ci->queryState != 0)
|
if (ci->queryState != 0)
|
||||||
@ -5221,7 +5221,7 @@ int ha_calpont_impl_group_by_init(ha_calpont_group_by_handler* group_hand, TABLE
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
string query;
|
string query;
|
||||||
// Set the query text only once if the server executes
|
// Set the query text only once if the server executes
|
||||||
// subqueries separately.
|
// subqueries separately.
|
||||||
if(ci->queryState)
|
if(ci->queryState)
|
||||||
query.assign("<subquery of the previous>");
|
query.assign("<subquery of the previous>");
|
||||||
|
@ -674,8 +674,8 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
processManager.recycleProcess(target, true);
|
processManager.recycleProcess(target, true);
|
||||||
|
|
||||||
//distribute config file
|
//distribute config file
|
||||||
processManager.distributeConfigFile("system");
|
processManager.distributeConfigFile("system");
|
||||||
|
|
||||||
//set query system state ready
|
//set query system state ready
|
||||||
processManager.setQuerySystemState(true);
|
processManager.setQuerySystemState(true);
|
||||||
|
|
||||||
@ -917,7 +917,7 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
|
|
||||||
//check for SIMPLEX Processes on mate might need to be started
|
//check for SIMPLEX Processes on mate might need to be started
|
||||||
processManager.checkSimplexModule(moduleName);
|
processManager.checkSimplexModule(moduleName);
|
||||||
|
|
||||||
processManager.setSystemState(oam::ACTIVE);
|
processManager.setSystemState(oam::ACTIVE);
|
||||||
|
|
||||||
//set query system state ready
|
//set query system state ready
|
||||||
@ -1016,7 +1016,7 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
{
|
{
|
||||||
processManager.stopModule(moduleName, graceful, manualFlag);
|
processManager.stopModule(moduleName, graceful, manualFlag);
|
||||||
log.writeLog(__LINE__, "stop Module Completed on " + moduleName, LOG_TYPE_INFO);
|
log.writeLog(__LINE__, "stop Module Completed on " + moduleName, LOG_TYPE_INFO);
|
||||||
|
|
||||||
status = processManager.enableModule(moduleName, oam::MAN_OFFLINE);
|
status = processManager.enableModule(moduleName, oam::MAN_OFFLINE);
|
||||||
log.writeLog(__LINE__, "Enable Module Completed on " + moduleName, LOG_TYPE_INFO);
|
log.writeLog(__LINE__, "Enable Module Completed on " + moduleName, LOG_TYPE_INFO);
|
||||||
}
|
}
|
||||||
@ -1783,7 +1783,7 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
pthread_join(startsystemthread, NULL);
|
pthread_join(startsystemthread, NULL);
|
||||||
status = startsystemthreadStatus;
|
status = startsystemthreadStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
// setup MySQL Replication after FORCE restart command
|
// setup MySQL Replication after FORCE restart command
|
||||||
if ( (status == API_SUCCESS) &&
|
if ( (status == API_SUCCESS) &&
|
||||||
(graceful == oam::FORCEFUL) )
|
(graceful == oam::FORCEFUL) )
|
||||||
@ -3762,7 +3762,7 @@ void ProcessManager::recycleProcess(string module, bool enableModule)
|
|||||||
stopProcessType("WriteEngineServer");
|
stopProcessType("WriteEngineServer");
|
||||||
|
|
||||||
stopProcessType("ExeMgr");
|
stopProcessType("ExeMgr");
|
||||||
|
|
||||||
stopProcessType("PrimProc");
|
stopProcessType("PrimProc");
|
||||||
|
|
||||||
stopProcessType("DBRMControllerNode");
|
stopProcessType("DBRMControllerNode");
|
||||||
@ -3774,13 +3774,13 @@ void ProcessManager::recycleProcess(string module, bool enableModule)
|
|||||||
stopProcessType("mysqld");
|
stopProcessType("mysqld");
|
||||||
|
|
||||||
// restartProcessType("mysqld");
|
// restartProcessType("mysqld");
|
||||||
|
|
||||||
startProcessType("DBRMControllerNode");
|
startProcessType("DBRMControllerNode");
|
||||||
startProcessType("DBRMWorkerNode");
|
startProcessType("DBRMWorkerNode");
|
||||||
|
|
||||||
startProcessType("PrimProc");
|
startProcessType("PrimProc");
|
||||||
sleep(5);
|
sleep(5);
|
||||||
|
|
||||||
startProcessType("WriteEngineServer");
|
startProcessType("WriteEngineServer");
|
||||||
sleep(3);
|
sleep(3);
|
||||||
|
|
||||||
@ -3840,7 +3840,7 @@ int ProcessManager::enableModule(string target, int state, bool failover)
|
|||||||
|
|
||||||
if ( newStandbyModule == target)
|
if ( newStandbyModule == target)
|
||||||
setStandbyModule(newStandbyModule);
|
setStandbyModule(newStandbyModule);
|
||||||
|
|
||||||
log.writeLog(__LINE__, "enableModule request for " + target + " completed", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "enableModule request for " + target + " completed", LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
return API_SUCCESS;
|
return API_SUCCESS;
|
||||||
@ -4152,7 +4152,7 @@ void ProcessManager::setSystemState(uint16_t state)
|
|||||||
if( state == oam::ACTIVE ) {
|
if( state == oam::ACTIVE ) {
|
||||||
//set query system states ready
|
//set query system states ready
|
||||||
processManager.setQuerySystemState(true);
|
processManager.setQuerySystemState(true);
|
||||||
|
|
||||||
//clear alarms if set
|
//clear alarms if set
|
||||||
aManager.sendAlarmReport(system.c_str(), SYSTEM_DOWN_AUTO, CLEAR);
|
aManager.sendAlarmReport(system.c_str(), SYSTEM_DOWN_AUTO, CLEAR);
|
||||||
aManager.sendAlarmReport(system.c_str(), SYSTEM_DOWN_MANUAL, CLEAR);
|
aManager.sendAlarmReport(system.c_str(), SYSTEM_DOWN_MANUAL, CLEAR);
|
||||||
@ -4694,7 +4694,7 @@ int ProcessManager::restartProcessType( std::string processName, std::string ski
|
|||||||
|
|
||||||
if ( systemprocessstatus.processstatus[i].ProcessOpState != oam::ACTIVE )
|
if ( systemprocessstatus.processstatus[i].ProcessOpState != oam::ACTIVE )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ( (processName.find("DDLProc") == 0 || processName.find("DMLProc") == 0) )
|
if ( (processName.find("DDLProc") == 0 || processName.find("DMLProc") == 0) )
|
||||||
{
|
{
|
||||||
string procModuleType = systemprocessstatus.processstatus[i].Module.substr(0, MAX_MODULE_TYPE_SIZE);
|
string procModuleType = systemprocessstatus.processstatus[i].Module.substr(0, MAX_MODULE_TYPE_SIZE);
|
||||||
@ -7722,7 +7722,7 @@ void startSystemThread(oam::DeviceNetworkList Devicenetworklist)
|
|||||||
// wait some more
|
// wait some more
|
||||||
sleep(2);
|
sleep(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( rtn = oam::ACTIVE )
|
if ( rtn = oam::ACTIVE )
|
||||||
//set query system state not ready
|
//set query system state not ready
|
||||||
processManager.setQuerySystemState(true);
|
processManager.setQuerySystemState(true);
|
||||||
@ -8265,7 +8265,7 @@ void ProcessManager::checkSimplexModule(std::string moduleName)
|
|||||||
if ( systemprocessconfig.processconfig[j].ProcessName == "DDLProc")
|
if ( systemprocessconfig.processconfig[j].ProcessName == "DDLProc")
|
||||||
{
|
{
|
||||||
setPMProcIPs((*pt).DeviceName);
|
setPMProcIPs((*pt).DeviceName);
|
||||||
|
|
||||||
log.writeLog(__LINE__, "Set Primary UM Module = " + (*pt).DeviceName, LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "Set Primary UM Module = " + (*pt).DeviceName, LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
oam.setSystemConfig("PrimaryUMModuleName", (*pt).DeviceName);
|
oam.setSystemConfig("PrimaryUMModuleName", (*pt).DeviceName);
|
||||||
@ -8284,7 +8284,7 @@ void ProcessManager::checkSimplexModule(std::string moduleName)
|
|||||||
log.writeLog(__LINE__, "checkSimplexModule: mate process started: " + (*pt).DeviceName + "/" + systemprocessconfig.processconfig[j].ProcessName, LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "checkSimplexModule: mate process started: " + (*pt).DeviceName + "/" + systemprocessconfig.processconfig[j].ProcessName, LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
status = processManager.startProcess((*pt).DeviceName,
|
status = processManager.startProcess((*pt).DeviceName,
|
||||||
"DMLProc",
|
"DMLProc",
|
||||||
FORCEFUL);
|
FORCEFUL);
|
||||||
if ( status == API_SUCCESS ) {
|
if ( status == API_SUCCESS ) {
|
||||||
log.writeLog(__LINE__, "checkSimplexModule: mate process started: " + (*pt).DeviceName + "/DMLProc", LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "checkSimplexModule: mate process started: " + (*pt).DeviceName + "/DMLProc", LOG_TYPE_DEBUG);
|
||||||
@ -11114,7 +11114,7 @@ int ProcessManager::mountDBRoot(std::string dbrootID)
|
|||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
ifstream in(tmpMount);
|
ifstream in(tmpMount.c_str());
|
||||||
|
|
||||||
in.seekg(0, std::ios::end);
|
in.seekg(0, std::ios::end);
|
||||||
int size = in.tellg();
|
int size = in.tellg();
|
||||||
|
@ -1057,7 +1057,7 @@ void ProcessMonitor::processMessage(messageqcpp::ByteStream msg, messageqcpp::IO
|
|||||||
msg >> manualFlag;
|
msg >> manualFlag;
|
||||||
int requestStatus = oam::API_SUCCESS;
|
int requestStatus = oam::API_SUCCESS;
|
||||||
log.writeLog(__LINE__, "MSG RECEIVED: Start All process request...");
|
log.writeLog(__LINE__, "MSG RECEIVED: Start All process request...");
|
||||||
|
|
||||||
//start the mysqld daemon
|
//start the mysqld daemon
|
||||||
|
|
||||||
try
|
try
|
||||||
@ -1548,7 +1548,7 @@ void ProcessMonitor::processMessage(messageqcpp::ByteStream msg, messageqcpp::IO
|
|||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
|
|
||||||
string tmpFile = tmpLogDir + "/mysqldstart";
|
string tmpFile = tmpLogDir + "/mysqldstart";
|
||||||
ifstream file (tmpFile);
|
ifstream file (tmpFile.c_str());
|
||||||
|
|
||||||
if (!file)
|
if (!file)
|
||||||
{
|
{
|
||||||
@ -1829,7 +1829,7 @@ void ProcessMonitor::processMessage(messageqcpp::ByteStream msg, messageqcpp::IO
|
|||||||
}
|
}
|
||||||
|
|
||||||
return_status = API_SUCCESS;
|
return_status = API_SUCCESS;
|
||||||
ifstream in(tmpMount);
|
ifstream in(tmpMount.c_str());
|
||||||
|
|
||||||
in.seekg(0, std::ios::end);
|
in.seekg(0, std::ios::end);
|
||||||
int size = in.tellg();
|
int size = in.tellg();
|
||||||
@ -4973,7 +4973,7 @@ void ProcessMonitor::checkModuleFailover( std::string processName)
|
|||||||
|
|
||||||
oam::DeviceNetworkConfig devicenetworkconfig;
|
oam::DeviceNetworkConfig devicenetworkconfig;
|
||||||
oam::DeviceNetworkList devicenetworklist;
|
oam::DeviceNetworkList devicenetworklist;
|
||||||
|
|
||||||
devicenetworkconfig.DeviceName = config.moduleName();
|
devicenetworkconfig.DeviceName = config.moduleName();
|
||||||
devicenetworklist.push_back(devicenetworkconfig);
|
devicenetworklist.push_back(devicenetworkconfig);
|
||||||
|
|
||||||
@ -5348,7 +5348,7 @@ int ProcessMonitor::runMasterRep(std::string& masterLogFile, std::string& master
|
|||||||
// in log - show-master-status.log
|
// in log - show-master-status.log
|
||||||
|
|
||||||
string masterLog = tmpLogDir + "/show-master-status.log";
|
string masterLog = tmpLogDir + "/show-master-status.log";
|
||||||
ifstream file (masterLog);
|
ifstream file (masterLog.c_str());
|
||||||
|
|
||||||
if (!file)
|
if (!file)
|
||||||
{
|
{
|
||||||
@ -5512,7 +5512,7 @@ int ProcessMonitor::runDisableRep()
|
|||||||
|
|
||||||
if ( MySQLPort.empty() )
|
if ( MySQLPort.empty() )
|
||||||
MySQLPort = "3306";
|
MySQLPort = "3306";
|
||||||
|
|
||||||
string logFile = tmpLogDir + "/disable-rep-columnstore.log";
|
string logFile = tmpLogDir + "/disable-rep-columnstore.log";
|
||||||
|
|
||||||
string cmd = startup::StartUp::installDir() + "/bin/disable-rep-columnstore.sh --installdir=" + startup::StartUp::installDir() + " --tmpdir=" + tmpLogDir + " > " + logFile + " 2>&1";
|
string cmd = startup::StartUp::installDir() + "/bin/disable-rep-columnstore.sh --installdir=" + startup::StartUp::installDir() + " --tmpdir=" + tmpLogDir + " > " + logFile + " 2>&1";
|
||||||
@ -6298,7 +6298,7 @@ int ProcessMonitor::checkDataMount()
|
|||||||
cmd = "export LC_ALL=C;mount " + dbroot + " > " + mountLog + " 2>&1";
|
cmd = "export LC_ALL=C;mount " + dbroot + " > " + mountLog + " 2>&1";
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
|
|
||||||
ifstream in(mountLog);
|
ifstream in(mountLog.c_str());
|
||||||
|
|
||||||
in.seekg(0, std::ios::end);
|
in.seekg(0, std::ios::end);
|
||||||
int size = in.tellg();
|
int size = in.tellg();
|
||||||
@ -6506,7 +6506,7 @@ int ProcessMonitor::glusterAssign(std::string dbrootID)
|
|||||||
{
|
{
|
||||||
log.writeLog(__LINE__, "glusterAssign mount failure: dbroot: " + dbrootID + " error: " + oam.itoa(WEXITSTATUS(ret)), LOG_TYPE_ERROR);
|
log.writeLog(__LINE__, "glusterAssign mount failure: dbroot: " + dbrootID + " error: " + oam.itoa(WEXITSTATUS(ret)), LOG_TYPE_ERROR);
|
||||||
|
|
||||||
ifstream in(tmpLog);
|
ifstream in(tmpLog.c_str());
|
||||||
in.seekg(0, std::ios::end);
|
in.seekg(0, std::ios::end);
|
||||||
int size = in.tellg();
|
int size = in.tellg();
|
||||||
|
|
||||||
@ -6540,9 +6540,9 @@ int ProcessMonitor::glusterUnassign(std::string dbrootID)
|
|||||||
std::string errmsg = "";
|
std::string errmsg = "";
|
||||||
|
|
||||||
log.writeLog(__LINE__, "glusterUnassign called: " + dbrootID, LOG_TYPE_DEBUG);
|
log.writeLog(__LINE__, "glusterUnassign called: " + dbrootID, LOG_TYPE_DEBUG);
|
||||||
|
|
||||||
string tmpLog = tmpLogDir + "/glusterUnassign.log";
|
string tmpLog = tmpLogDir + "/glusterUnassign.log";
|
||||||
|
|
||||||
command = "umount -f " + startup::StartUp::installDir() + "/data" + dbrootID + " > " + tmpLog + " 2>&1";
|
command = "umount -f " + startup::StartUp::installDir() + "/data" + dbrootID + " > " + tmpLog + " 2>&1";
|
||||||
|
|
||||||
int ret = system(command.c_str());
|
int ret = system(command.c_str());
|
||||||
@ -6551,7 +6551,7 @@ int ProcessMonitor::glusterUnassign(std::string dbrootID)
|
|||||||
{
|
{
|
||||||
log.writeLog(__LINE__, "glusterUnassign mount failure: dbroot: " + dbrootID + " error: " + oam.itoa(WEXITSTATUS(ret)), LOG_TYPE_ERROR);
|
log.writeLog(__LINE__, "glusterUnassign mount failure: dbroot: " + dbrootID + " error: " + oam.itoa(WEXITSTATUS(ret)), LOG_TYPE_ERROR);
|
||||||
|
|
||||||
ifstream in(tmpLog);
|
ifstream in(tmpLog.c_str());
|
||||||
in.seekg(0, std::ios::end);
|
in.seekg(0, std::ios::end);
|
||||||
int size = in.tellg();
|
int size = in.tellg();
|
||||||
|
|
||||||
@ -6560,7 +6560,7 @@ int ProcessMonitor::glusterUnassign(std::string dbrootID)
|
|||||||
if (!oam.checkLogStatus(tmpLog, "not mounted"))
|
if (!oam.checkLogStatus(tmpLog, "not mounted"))
|
||||||
{
|
{
|
||||||
log.writeLog(__LINE__, "glusterUnassign failed.", LOG_TYPE_ERROR);
|
log.writeLog(__LINE__, "glusterUnassign failed.", LOG_TYPE_ERROR);
|
||||||
|
|
||||||
string cmd = "mv -f " + tmpLog + " " + tmpLog + "failed";
|
string cmd = "mv -f " + tmpLog + " " + tmpLog + "failed";
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
return oam::API_FAILURE;
|
return oam::API_FAILURE;
|
||||||
|
Reference in New Issue
Block a user