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 - added in mysql_upgrade script and fix issue with shared memory not cleared at shutdown
This commit is contained in:
@ -84,8 +84,8 @@ test -f $COLUMNSTORE_INSTALL_DIR/post/functions && . $COLUMNSTORE_INSTALL_DIR/po
|
|||||||
mid=`module_id`
|
mid=`module_id`
|
||||||
|
|
||||||
#if um, cloud, separate system type, external um storage, then setup mount
|
#if um, cloud, separate system type, external um storage, then setup mount
|
||||||
if [ $module = "um" ]; then
|
if [ $cloud = "amazon-ec2" ] || [ $cloud = "amazon-vpc" ]; then
|
||||||
if [ $cloud = "amazon-ec2" ] || [ $cloud = "amazon-vpc" ]; then
|
if [ $module = "um" ]; then
|
||||||
systemtype=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation ServerTypeInstall`
|
systemtype=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation ServerTypeInstall`
|
||||||
if [ $systemtype = "1" ]; then
|
if [ $systemtype = "1" ]; then
|
||||||
umstoragetype=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation UMStorageType`
|
umstoragetype=`$COLUMNSTORE_INSTALL_DIR/bin/getConfig Installation UMStorageType`
|
||||||
@ -97,14 +97,14 @@ if [ $module = "um" ]; then
|
|||||||
sudo chown $user:$user -R $COLUMNSTORE_INSTALL_DIR/mysql > /dev/null 2>&1
|
sudo chown $user:$user -R $COLUMNSTORE_INSTALL_DIR/mysql > /dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
#setup rc.local
|
|
||||||
RCFILE=/etc/rc.d/rc.local
|
|
||||||
|
|
||||||
if [ $user != "root" ]; then
|
#setup rc.local for amazon
|
||||||
echo "uncomment runuser in rc.local, amazon AMI"
|
RCFILE=/etc/rc.d/rc.local
|
||||||
sudo sed -i -e 's/#runuser/runuser/g' /etc/rc.d/rc.local >/dev/null 2>&1
|
|
||||||
fi
|
if [ $user != "root" ]; then
|
||||||
|
echo "uncomment runuser in rc.local, amazon AMI"
|
||||||
|
sudo sed -i -e 's/#runuser/runuser/g' /etc/rc.d/rc.local >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -9396,9 +9396,6 @@ int Oam::checkGlusterLog(std::string logFile, std::string& msg)
|
|||||||
******************************************************************************************/
|
******************************************************************************************/
|
||||||
std::string Oam::getMySQLPassword()
|
std::string Oam::getMySQLPassword()
|
||||||
{
|
{
|
||||||
|
|
||||||
return oam::UnassignedName;
|
|
||||||
|
|
||||||
string mysqlUser = "root";
|
string mysqlUser = "root";
|
||||||
|
|
||||||
string USER = "root";
|
string USER = "root";
|
||||||
@ -9422,7 +9419,7 @@ std::string Oam::getMySQLPassword()
|
|||||||
if (!file)
|
if (!file)
|
||||||
{
|
{
|
||||||
writeLog("getMySQLPassword: doesn't exist: " + fileName, LOG_TYPE_DEBUG);
|
writeLog("getMySQLPassword: doesn't exist: " + fileName, LOG_TYPE_DEBUG);
|
||||||
exceptionControl("getMySQLPassword", API_FILE_OPEN_ERROR);
|
return oam::UnassignedName;
|
||||||
}
|
}
|
||||||
|
|
||||||
char line[400];
|
char line[400];
|
||||||
|
@ -305,6 +305,19 @@ void reportThread(string reporttype)
|
|||||||
cmd = installDir + "/bin/mcsadmin getSystemInfo >> " + outputFile;
|
cmd = installDir + "/bin/mcsadmin getSystemInfo >> " + outputFile;
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "echo ' ' >> " + outputFile;
|
||||||
|
system(cmd.c_str());
|
||||||
|
cmd = "echo '******************** System Directories ********************' >> " + outputFile;
|
||||||
|
system(cmd.c_str());
|
||||||
|
cmd = "echo ' ' >> " + outputFile;
|
||||||
|
system(cmd.c_str());
|
||||||
|
cmd = "echo '################# mcsadmin getSystemDirectories ################# ' >> " + outputFile;
|
||||||
|
system(cmd.c_str());
|
||||||
|
cmd = "echo ' ' >> " + outputFile;
|
||||||
|
system(cmd.c_str());
|
||||||
|
cmd = installDir + "/bin/mcsadmin getSystemDirectories >> " + outputFile;
|
||||||
|
system(cmd.c_str());
|
||||||
|
|
||||||
cmd = "echo ' ' >> " + outputFile;
|
cmd = "echo ' ' >> " + outputFile;
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
cmd = "echo '******************** System Configuration File ********************' >> " + outputFile;
|
cmd = "echo '******************** System Configuration File ********************' >> " + outputFile;
|
||||||
|
@ -39,7 +39,6 @@ using namespace installer;
|
|||||||
|
|
||||||
#include "installdir.h"
|
#include "installdir.h"
|
||||||
|
|
||||||
extern string mysqlpw;
|
|
||||||
string pwprompt = " ";
|
string pwprompt = " ";
|
||||||
|
|
||||||
string masterLogFile = oam::UnassignedName;
|
string masterLogFile = oam::UnassignedName;
|
||||||
@ -347,7 +346,6 @@ int sendUpgradeRequest(int IserverTypeInstall, bool pmwithum)
|
|||||||
ByteStream::byte requestID = RUNUPGRADE;
|
ByteStream::byte requestID = RUNUPGRADE;
|
||||||
|
|
||||||
msg << requestID;
|
msg << requestID;
|
||||||
msg << mysqlpw;
|
|
||||||
|
|
||||||
int returnStatus = oam::API_SUCCESS;
|
int returnStatus = oam::API_SUCCESS;
|
||||||
|
|
||||||
@ -385,7 +383,7 @@ int sendUpgradeRequest(int IserverTypeInstall, bool pmwithum)
|
|||||||
{
|
{
|
||||||
string tmpDir = startup::StartUp::tmpDir();
|
string tmpDir = startup::StartUp::tmpDir();
|
||||||
|
|
||||||
cout << "ERROR: Error return in running the MariDB Columnstore Upgrade, check " + tmpDir + "/upgrade*.logs on " << (*pt).DeviceName << endl;
|
cout << "ERROR: Error return in running the MariDB Columnstore Upgrade, check " + tmpDir + "/mysql_upgrade.log on " << (*pt).DeviceName << endl;
|
||||||
return returnStatus;
|
return returnStatus;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,7 +200,6 @@ string tmpDir;
|
|||||||
string HOME = "/root";
|
string HOME = "/root";
|
||||||
string SUDO = "";
|
string SUDO = "";
|
||||||
extern string pwprompt;
|
extern string pwprompt;
|
||||||
string mysqlpw = oam::UnassignedName;
|
|
||||||
|
|
||||||
extern const char* pcommand;
|
extern const char* pcommand;
|
||||||
extern string prompt;
|
extern string prompt;
|
||||||
|
@ -1502,6 +1502,15 @@ void processMSG(messageqcpp::IOSocket* cfIos)
|
|||||||
cmd = "touch " + startup::StartUp::installDir() + "/local/moveDbrootTransactionLog";
|
cmd = "touch " + startup::StartUp::installDir() + "/local/moveDbrootTransactionLog";
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
|
|
||||||
|
//clear shared memory
|
||||||
|
cmd = startup::StartUp::installDir() + "/bin/clearShm > /dev/null 2>&1";
|
||||||
|
int rtnCode = system(cmd.c_str());
|
||||||
|
|
||||||
|
if (WEXITSTATUS(rtnCode) != 1)
|
||||||
|
log.writeLog(__LINE__, "Successfully ran DBRM clearShm", LOG_TYPE_DEBUG);
|
||||||
|
else
|
||||||
|
log.writeLog(__LINE__, "Error running DBRM clearShm", LOG_TYPE_ERROR);
|
||||||
|
|
||||||
// now do local module
|
// now do local module
|
||||||
processManager.shutdownModule(config.moduleName(), graceful, manualFlag);
|
processManager.shutdownModule(config.moduleName(), graceful, manualFlag);
|
||||||
|
|
||||||
|
@ -1714,11 +1714,8 @@ void ProcessMonitor::processMessage(messageqcpp::ByteStream msg, messageqcpp::IO
|
|||||||
{
|
{
|
||||||
log.writeLog(__LINE__, "MSG RECEIVED: Run upgrade script ");
|
log.writeLog(__LINE__, "MSG RECEIVED: Run upgrade script ");
|
||||||
|
|
||||||
string mysqlpw;
|
|
||||||
msg >> mysqlpw;
|
|
||||||
|
|
||||||
// run upgrade script
|
// run upgrade script
|
||||||
int ret = runUpgrade(mysqlpw);
|
int ret = runUpgrade();
|
||||||
|
|
||||||
ackMsg << (ByteStream::byte) ACK;
|
ackMsg << (ByteStream::byte) ACK;
|
||||||
ackMsg << (ByteStream::byte) RUNUPGRADE;
|
ackMsg << (ByteStream::byte) RUNUPGRADE;
|
||||||
@ -6583,15 +6580,17 @@ int ProcessMonitor::glusterUnassign(std::string dbrootID)
|
|||||||
* purpose: run upgrade script
|
* purpose: run upgrade script
|
||||||
*
|
*
|
||||||
******************************************************************************************/
|
******************************************************************************************/
|
||||||
int ProcessMonitor::runUpgrade(std::string mysqlpw)
|
int ProcessMonitor::runUpgrade()
|
||||||
{
|
{
|
||||||
Oam oam;
|
Oam oam;
|
||||||
|
|
||||||
string tmpLog = tmpLogDir + "/mysql_upgrade.log";
|
string tmpLog = tmpLogDir + "/mysql_upgrade.log";
|
||||||
|
|
||||||
string passwordOption = " --password=" + mysqlpw;
|
string mysqlpw = oam.getMySQLPassword();
|
||||||
if ( mysqlpw == oam::UnassignedName )
|
|
||||||
passwordOption = "";
|
string passwordOption = passwordOption = "";
|
||||||
|
if ( mysqlpw != oam::UnassignedName )
|
||||||
|
passwordOption = " --password=" + mysqlpw;
|
||||||
|
|
||||||
for ( int i = 0 ; i < 10 ; i++ )
|
for ( int i = 0 ; i < 10 ; i++ )
|
||||||
{
|
{
|
||||||
|
@ -493,7 +493,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
*@brief run upgrade script
|
*@brief run upgrade script
|
||||||
*/
|
*/
|
||||||
int runUpgrade(std::string mysqlpw);
|
int runUpgrade();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*@brief change my.cnf
|
*@brief change my.cnf
|
||||||
|
Reference in New Issue
Block a user